I am trying to read the timer2 capture function and then output it to the lcd screen. please advise if this code is enough to make this function operate or I should use a unit32 for val !
T2CTRL |= 0x0D;
{
T2MSEL |= 0x11; // T2MSEL.T2MOVFSEL = 00010001
union counter2
{
char byte[3];
unsigned int val;
};
union counter2 t2cnt;
t2cnt.byte[0] = T2MOVF2;
t2cnt.byte[1] = T2MOVF1;
t2cnt.byte[2] = T2MOVF0;
HalLcdWriteStringValue ("C:", t2cnt.val, 10, 1);
}