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 18:00
Read: times


 
#32895 - RE: PCA CEX Output
Adding the CCFn to the interrupt indeed got the serial port back, but it also changed the frequency to 78hz. :(


Can anyone explain to me how to set this up? I understand (or think I do) how it all should work but the flags I set seem to be wrong.

This is how I see it...

For P1.3 High Speed Output, I will be using CMOD, CCON, CCAP0H, CCAP0L, CCAPM0, CH, CL, and Interrupt 6.

CMOD |= 0x02 <--- Timer Uses Clock FPca/2
CCAPM0 = 0x4C <--- Tog,Mat,Ecom = CEX

CCAP0H = \
CCAP0L = // These Values control the timing

EC = TRUE <-- This enables Interrupt 6
CR = TRUE <-- This Starts the PCA Timer


So, as far as I understand, the PCA will generate an interrupt (6) when CH/CL match CCAP0H/CCAP0L

In interrupt 6, I need to reset CH/CL to zero, and clear the interrupt flag...

CH = 0;
CL = 0;
CCF0 = FALSE;

This to me should restart clock and trigger again when the next match occurs.

On it's own it seems to work fine generating the 32khz output I want. But I cant get it to work at the same time as the serial port.

Something must be conflicting between the two but I can't see anything in common with them to cause it.

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