2003-07-02 01:56 AM
MFT timer in a mode of counting with a clock and direction
2011-05-17 02:34 AM
Timer 0 problem:
I want it to work in a way that T0INA will set direction UP/DOWN and T0INB will be EXT.CLOCK . I programed the timer as follow and set the timer ports as inputs and the timer did not work. ( I tried to set the inputs as AF function , timer start counting UP and input A becames HIGH output and I could not change the direction) Port setup: spp(P2C_PG); P2C0R = 0xFF; P2C1R = 0x00; P2C2R = 0xFF; Setup of timer 0: spp(T0D_PG); T_TCR = 0x08; T_TMR = 0x1A; T_ICR = 0x9A; T_REG0R = 0; T_REG1R = 0; CICR |=0x80; T_TCR |= 0x80; Tanks2011-05-17 02:34 AM
It is correct to configure the input pins in Input TTL, AF is for Output pins of the peripherals.
Try to reset, set, reset the CP0 bit in the FLAGR register to start the Timer from the REG0 register.