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

Back to Subject List

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


 
#121943 - usermanual of 89LPC9xx insufficient
Responding to: ???'s previous message
Erik Malund said:
Mode 2 has to be used.
that will not do it as I did show in my post, it will at best produce 1/2 the frequency the Op wants.

However had the OP done the horrendous, awful, terrible, cumbersome effort of looking in the user manual, he would have found:
"CLKOUT CPU clock divided by 2 when enabled via SFR bit (ENCLK - TRIM.6). It can be used if the CPU clock is the internal RC oscillator, watchdog oscillator or external clock input, except when XTAL1/XTAL2 are used to generate clock source for the real time clock/system timer."

Erik



I have checked the value of UCFG1 through my parallel programmer (All-100). It is using internal RC osc as clock source.

Actually, I could generate a pulse with 3.xxMHz frequency to port 3.0 (XTAL2) after i have enabled ENCLK - TRIM.6.

However, my hardware grayscale clock is connected to P0.5. Thus, I am thinking of using timer 0 mode 1 (16-bit timer) to generate a clock pulse with frequency (3.xxMHz/2).

Refering to 89LPC9xx usermanual, the clock used for timer is PCLK which is 7.xxMhz/2 (CCLK/2). Hence, i thought the timer reload value should be calculated this way:

(65535-x)(1/3.xxM) = 1/3.xxM
=> x = 65534
=> TH0 = 0xff, TL0 = 0xfe

I think the above formula is incorrect since the output doesn't create a clock pulse of 3.xxMhz/2.

I am not quite familiar with LPC9xx series, but for 80c51 series, the calculation is (65535-x)(12/fOSC) = 1/fTimer

And the usermanual doesn't mention much about the formula to calculate it...

Anyone has any idea to calculate it?

My timer routine is as follows:

TMR0_ISR:

CPL P0.5
CLR TF0
MOV TH0,#0FFH
MOV TL0,#0FEH




RETI

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