68hc12 TOVF interrupt problems ICC12

I'm trying to get the timer overflow interrupt working on the hc12 dp256b but so far I haven't had any luck.

The overflow interrupt is never generated in my program(used a breakpiont in isr) and I can't find the logic error in my code.

Here is my work environment: CHIP: hc12dp256 COMPILER: ICC12 DEBUGGER: NOICE

Here's the code that doesn't work

------------------------------------------------------------------------------ #include #include

#pragma interrup_handler TOVF_ISR() (isrs installed in vector table file)

int count

void main(void) { //setup TFLG2|=0x80; //Clear interrupt flag TSCR2 =0x8D; //Set timer frequency(250kHz), Enable TOVF int TSCR1|=0x90; //enable timer and fast clear TOC7

asm("cli"); count=0; while(count

Reply to
Marcipicus
Loading thread data ...

why do you set TCRE?

not what you asked, but what happens when main() returns?

why? RTI will do so, and your ISR doesn't run very long.

Oliver

--
Oliver Betz, Munich
despammed.com might be broken, use Reply-To:
Reply to
Oliver Betz

=_NextPart_000_0195_01C9ADFE.4134FD60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

dp256b

breakpiont

--
>=20
> Thanks to anyone who can help me out
 Click to see the full signature
Reply to
PhilW

Please do not use html in Usenet. This is a pure text medium.

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
 Click to see the full signature
Reply to
CBFalconer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.