i am doing the Quadrature Encoder Mode counter. but i dont know why my counter wont count. it is my setting problem??
Quadrature Encoder Mode counter. but i dont know why my counter wont count. it is my setting problem??
0] Enable the counter at the end after configuring all its other registers, as explained in HRM.
1] There is no need to program PORT registers to enable counter’s pins. CUD, CDG & CZM pins comes under ‘Additional use column’ of port multiplexing. All the input signals in the ‘Additional Use’ column are enabled by their module only, regardless of the state of the PORTx_MUX and PORTx_FER registers
2] The Timer registers (TIMER0) are not configured properly. Why you are writing to PERIOD & WIDTH register? (also WIDTH>PERIOD?). The assembly level code for configuring timers is given at the end of chapter.
3] CNT_STATUS register is W1C register.
4] I am not seeing any ISR for this code, as you enabled some interrupts by writing to CNT_IMASK registers.
BTW, are the signals at the input of CDG:CUD in ‘gray-code’ format?
Retrieving data ...