cancel
Showing results for 
Search instead for 
Did you mean: 

MFT timer in a mode of counting with a clock and direction

doronkeren
Associate II
Posted on July 02, 2003 at 10:56

MFT timer in a mode of counting with a clock and direction

2 REPLIES 2
doronkeren
Associate II
Posted on May 17, 2011 at 11:34

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;

Tanks

romain2399
Associate II
Posted on May 17, 2011 at 11:34

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.