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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/21/02 11:02
Read: times


 
#32868 - PCA CEX Output
I am trying to get a 32khz output on P1.3 of the 89C51AC2 using C.

As far as I could tell, I should be using the CEX output mode of the PCA.
This I set up as follows:

// Optic Clock Output on pin P1_3 for temp/humid @ 32khz using PCA
CMOD = 0x02; // Using Internal Clock FPca/2
CCAP0H = 0xFF; // Value for compare
CCAP0L = 0xE6; // 65536 - 26 Value for compare
CCAPM0 = 0x4C; // Tog, Mat, Ecom = CEX Output for Module 0 (P1.3)
CCON |= 0x40; // Start Timer

But, all the above code does is set up a output of 38.1hz.

I believe this i because the PCA clock just counts from 1 through 65525 toggling the output when it matches CCPAnH (&L)

Is there a way to get the PCA to reset in the same way that the serial port does...eg Auto Reload of value, so that the values in CCPAnH (&L) actually affect the frequency of the output?



List of 9 messages in thread
TopicAuthorDate
PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output            01/01/70 00:00      
RE: PCA CEX Output added link            01/01/70 00:00      
RE: PCA CEX Output -- David            01/01/70 00:00      

Back to Subject List