I have an LPC24 board and I'm struggling to get the counter to reset to 0.
int countval; T1TCR = 0x02; /*Counter Reset*/ T1TCR = 0x01; /*Counter Enable*/ T1CTCR = 0x05; /*Count Pulses*/ countval = T1TC; simplePrintf("%d", countval); /*Print to Display*/
It counts the pulses on the pin fine however the count always seem to start from either 7 or 14 depending on where I place the counter setup code.
Any help would be appreciated.
Also, I would take a look at the system viewer and view your timer peripheral to see if you can see the registers. every time you stop the processor the timer values will update there values.