prescaler settings for MC9S12NE64

prescaler settings for MC9S12NE64

Post by johnny.kar » Sat, 19 Feb 2005 22:23:04


Hi, this may be a bit offtopic, but anyhow.....

I'm using Codewarrior to develop for the MC9S12NE64 and i'm trying to
create a timer interrupt. It works fine but as soon as i enable the
prescaler i don't get a timer interrupt anymore.

//set time channel 7 to output compare
TIOS_IOS7 = 1;

//Set prescaler to 128
TSCR2_PR0 = 1;
TSCR2_PR1 = 1;
TSCR2_PR2 = 1;

//Disable reset on aoutput compare.
TSCR2_TCRE = 0;

//Set the counter to a specific value
TC7 = TCNT + 0x5B;

//Timer Stops While in Freeze Mode
TSCR1_TSFRZ = 1;

//Enable interrupt for timer channel 7
TIE_C7I = 1;

//Timer enable
TSCR1_TEN = 1;


And as i said, if i set TSCR2_PR0 - PR2 to 0 then it works fine. Can
anyone tell me what i'm doing wrong?

Best Wishes

Johnny Karlsson
 
 
 

prescaler settings for MC9S12NE64

Post by wade_ » Thu, 24 Feb 2005 10:34:17