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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/27/05 06:31
Read: times


 
#95983 - 65536, not 65535
Responding to: ???'s previous message
hi,

Adam Klaum said:
So for a 1.4 ms time I need to start the timer at:
65535 - 1290 = 64245 = FAF5 hex
And for the 16.781818182 ms time I need to start the timer at:
65535 - 15467 = 50068 = C394 hex


Adam, 16-bit timer overflows when it counts up from 65535 to 65536 (to zero due its 16 bit wide). By other words when you need to count for one timer clock then you should reload timer with value 65535 (65536-1).
So replace 65535 with 65536 in your calculations.

Regards,
Oleg

List of 30 messages in thread
TopicAuthorDate
General Pulse Width Modulation on 8051            01/01/70 00:00      
   The logic seems good            01/01/70 00:00      
      How to post code            01/01/70 00:00      
      Code I'm using            01/01/70 00:00      
         Problem lies with SDCC and PSW handling.            01/01/70 00:00      
            similar "issue" with Keil?            01/01/70 00:00      
            PSW not touched in recent version            01/01/70 00:00      
               Old SDCC (ver ??) vs New SDCC (ver 2.50)            01/01/70 00:00      
                  strange            01/01/70 00:00      
                     not strange, sorry            01/01/70 00:00      
                        Still no good            01/01/70 00:00      
                           Still not strange            01/01/70 00:00      
   Alternative method            01/01/70 00:00      
   65536, not 65535            01/01/70 00:00      
      Caught that errror            01/01/70 00:00      
         why not use the PCA, it is made for this            01/01/70 00:00      
            No PCA available            01/01/70 00:00      
               slim PICkins            01/01/70 00:00      
               go ahead, spend $7            01/01/70 00:00      
                  Why not read 8051 stuff?            01/01/70 00:00      
                     Excellent - Thanks            01/01/70 00:00      
                  Atmel Flip            01/01/70 00:00      
                     MAX232(equivalent)            01/01/70 00:00      
                        Another Option            01/01/70 00:00      
                     level convertor            01/01/70 00:00      
                        aka "Transceiver"            01/01/70 00:00      
         JSIM.EXE is all you need and it FREE.            01/01/70 00:00      
   Still not strange            01/01/70 00:00      
   Follow Up to the original post            01/01/70 00:00      
      Dumb and dumberrer            01/01/70 00:00      

Back to Subject List