??? 05/21/11 23:39 Read: times |
#182327 - CCF4 bit Responding to: ???'s previous message |
Hi Michael,
thanks for your response. yes i clear the CCF4 bit within my interrupt code and i don't need the PCA overflow, but I suspect this may still be causing an interrupt. something that may help diagnose the problem... my code: if (CCF4 == 1) { CCF4 = 0; run_mode = !run_mode; //run_mode is linked to an I/O pin, so pin toggles every time interrupt is called } i cant check my oscilloscope results right now, but it was around about the 10 microsecond range for each trigger of the interrupt. although this didnt happen with the above if statement, it only occurred when there was no if statement in the code. the interrupt did occur with the if statement present when i connected my zero crossing signal. i.e. ccf4 was triggering. obviously my issue is that the interrupt still seems to trigger if this signal is not connected to a PCA input. I tried the following line of code as well... //if ((CCF0 || CCF1 || CCF2 || CCF3 || CF) == 1) this caused the interrupt to trigger also, which pointed me to the CF flag. i.e. counter overflow. However with the ECF bit set to zero this should not trigger an interrupt, but i wasnt sure if the bit would still be set either way? i can only think it is the counter causing the interrupt based on how often the interrupt triggers. I have all other CCF flags set to zero so pretty confident there can be no other triggering on the PCA modules. hope my message makes sense to you... |
Topic | Author | Date |
PCA 8051 issue | 01/01/70 00:00 | |
CCF4 Bit | 01/01/70 00:00 | |
CCF4 bit | 01/01/70 00:00 | |
run_mode?? | 01/01/70 00:00 | |
interrupt vectors | 01/01/70 00:00 | |
interrupt vectors | 01/01/70 00:00 | |
run_mode | 01/01/70 00:00 | |
Now seems like.... | 01/01/70 00:00 | |
Goes for all languages/platforms | 01/01/70 00:00 | |
my code | 01/01/70 00:00 | |
No.... | 01/01/70 00:00 | |
just a thought | 01/01/70 00:00 | |
Another Thought...![]() | 01/01/70 00:00 |