1
FreescaleTM MC9S12NE64 / Initialize Timer Port on power on
« on: October 09, 2009, 05:25:40 PM »
Hi, Mark
I am trying to control a RC servo, I know it works but when i turn on the power the servo times out before the timer port is initialized.
Can you please tell me if I can initialize the timerport imediately on power up. Initializing it in my task takes to long.
Thanks
Marco
I am trying to control a RC servo, I know it works but when i turn on the power the servo times out before the timer port is initialized.
Can you please tell me if I can initialize the timerport imediately on power up. Initializing it in my task takes to long.
Code: [Select]
TSCR1 = 0x80; //10000000 (Turn on the Timer port)
TSCR2 = 0x03; //00000011 (Set Prescale to 8)
TIOS = 0xF0; //11110000 (set all channels to output compare)
TTOV = 0xF0; //11110000 (enable Toggle output on overflow)
TCTL1 = 0xAA; //11111111 (OutputModeX, OutputLevelX) 0x55;//0xAA; //0xFF;
Thanks
Marco