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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/21/05 14:20
Read: times


 
#95478 - PCA timer to measure period
Hello, i'm trying to do a period measure using pca. I tried to write some code but it doesn't work, i don't know what's wrong.

thank you very much if somebody could help me

Raffaele



unsigned int lettura, prevlettura1,period;

void pca_isr() interrupt 6 using 1
{
if (CCF0)
{
lettura = (CCAP0H<<8) + CCAP0L;
period = lettura - prevlettura1;
prevlettura1=lettura;
CCF0=0;
}
}

void pca_init()
{
EA=1;
CCON = 0x00;
CMOD = 0x00;
CH = 0x00;
CL = 0x00;
CCAPM0 = 0x21;
CCON = 0x40;
EC=1;
}


List of 7 messages in thread
TopicAuthorDate
PCA timer to measure period            01/01/70 00:00      
   one problem            01/01/70 00:00      
   Try this            01/01/70 00:00      
   PCA timer to measure period            01/01/70 00:00      
      reading registers            01/01/70 00:00      
         like this            01/01/70 00:00      
            so you must change            01/01/70 00:00      

Back to Subject List