Content originally posted in LPCWare by emimad on Mon Sep 21 06:28:09 MST 2015
Thanks to all!
yes, R2D2... I have a program using RITIMER correctly 8-) my problem is to know how to read TC value :( I'm newbie with Cortex, sorry.
Your answer was very clearifying so I'll add your code at the start of my main() function.
//init Timer32
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 17, (IOCON_FUNC2 | IOCON_MODE_PULLUP)); //CT32B0_CAP0
Chip_TIMER_Init(LPC_TIMER32_0);//init timer
LPC_TIMER32_0->CTCR = 2;//falling edge CT32B0_CAP0
LPC_TIMER32_0->TCR = 1; //start timer
In the RITIMER handle I'll add the next code:
CountValue = Chip_TIMER_ReadCount(LPC_TIMER32_0);
LPC_TIMER2->TC=0; // reset TC
That should be enough :)
Thank you very much 0:)