Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/14/03 19:00
Read: times


 
#43404 - RE: sq wave function gen. uC limited.?!
Responding to: ???'s previous message
The square wave frequency that you can output will depend on several factors. If you need to use an timer interrupt and then have software toggle the I/O port pin in the ISR then the frequency resolution is related to execution time of the ISR, latency time to get to the ISR and achievable clcoking rated that can be realized by the timer.

If you used as timer output, such as TIMER 2 running in High Speed output toggle mode then the square wave resolution would be limited to the counter frequency of the timer channel. In general it is not possible to generate all output frequencies at all integer frequencies off single frequency crystal. You may be able to achieve resolution of better than 1 Hz from one frequency to the next but it is unlikely to be able to produce like, 233 Hz, 234 Hz, 235 ... Hz each in exact timing to those numbers.

It can be handy to make yourself a spreadsheet to list the integer frequencies in a column, Then calculate the timer dividers in the next column. (Since these are integer divisors they wont lead to the exact frequency). In the third column you can compute the exact frequency and in the 4th show the percentage error at each desired frequency step.

Michael Karas




List of 9 messages in thread
TopicAuthorDate
sq wave function gen. uC limited.?!            01/01/70 00:00      
   RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
      RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
   RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
      RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
         RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
   RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
      RE: sq wave function gen. uC limited.?!            01/01/70 00:00      
         RE: sq wave function gen. uC limited.?!            01/01/70 00:00      

Back to Subject List