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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/09/06 08:09
Read: times


 
#121896 - FAQ: P89LPC9221
To Whom It May Concern,

Hello, is anybody familiar with Philips P89LPC9221 ucontroller?

I am facing problem to calculate the timer overflow of the ucontroller.

I am using the internal RC oscillator with 7.3728MHz. I have set the DIVM = 0x00. Therefore the CCLK should be 7.3728MHz and the PCLK should be 3.6864MHz.

I have set the timer 0 to mode 1 16-bit timer.
MOV TMOD,#00100001B
MOV TAMOD,#00000000B

Now if I wish to create a pulse with frequency = 3.6864MHz/2 by complemeting a port in timer 0 interrupt service routine, what value should i reload the TH0 and TL0?

I have tried to calculate with the following method but using scope to measure the pulse frequency, i always get 50KHz. Is there any mistakes I make?

(65535-x)/3.6564M = 1/3.6564M
65535-x = 1
x = 65534
x = 0xfffe
=> TH0 = 0xff;
TL0 = 0xfe;


Please help. Thanks.

Regards,
IVAN :)

List of 31 messages in thread
TopicAuthorDate
FAQ: P89LPC9221            01/01/70 00:00      
   Code Architect            01/01/70 00:00      
   that\'s impossible            01/01/70 00:00      
      pin toggle            01/01/70 00:00      
         Sure, but that does not achieve 3.xx MHz            01/01/70 00:00      
            interrupt            01/01/70 00:00      
               that will not do it as I did show in my post            01/01/70 00:00      
                  mode 2            01/01/70 00:00      
                     slovakian math ?            01/01/70 00:00      
                  usermanual of 89LPC9xx insufficient            01/01/70 00:00      
                     please read the WHOLE thread            01/01/70 00:00      
                        Can timer mode 2 overcome interrupt overhead?            01/01/70 00:00      
                           with mode 2 the reload is automatic as \"the            01/01/70 00:00      
                     did you not read            01/01/70 00:00      
   Re: 50kHz output...            01/01/70 00:00      
   I eneterd a FAQ on this            01/01/70 00:00      
      Where? I can't see it            01/01/70 00:00      
         here            01/01/70 00:00      
            I think you misplaced it...            01/01/70 00:00      
               I placed the FAQ correctly but - shame on me - pl            01/01/70 00:00      
                  What is the fastest frequency of Timer Mode 2            01/01/70 00:00      
                     fastest output            01/01/70 00:00      
                        Couldn't Wait in Endless Loop            01/01/70 00:00      
                           NOOOOOOOOO            01/01/70 00:00      
                              Where should i CPL p0.5 then?            01/01/70 00:00      
                                 oooh, then it's impossible, of course            01/01/70 00:00      
                                    89LPC9221 i2c interface            01/01/70 00:00      
                                       I am against "sharing code" but it is there            01/01/70 00:00      
                                          I2C interface with 89LPC9221            01/01/70 00:00      
                                             what does CodeArchitect do ?            01/01/70 00:00      
                                             push-pull?            01/01/70 00:00      

Back to Subject List