Hello again!!
I'm having a problem with HCS12.... It's a very rare one.. Let`s start from basics....
This is waht i'm using:
- MC9S12A128B
- 20MHz oscillator CLK and no PLL, no nothing so the uC is at 10MHz
- PEAR_NECLK=1; // PE 4-7 General I/O
- DDRE=0xF0; // PE 4-7 Output
*** TIMER IC ***
TIOS=0x00; // Channel 4 as IC
TCTL3=0x03; // IC Channel 4 interrups with both edges
TIE=0x10; // Channel 4 IRQ Enable
TSCR2=0x00; // No prescaler
TSCR1=0x80; // Timer Enabled
The code is a basic program that analizes the IC values... is very simple it doesn't matter.... the problem is that I debug it, no WARNINGS, no ERRORS.... Then I run it and it works fine because i've got some LEDs to monitorize the process... now here's the problem... I HALT it and it's like the uC RESETS itself....
At first I set the data in the debugger to be scoped periodically and while the program is running I can see the values of the data wich are correct.... then when I HALT it and BOOOMMM!!! all variables go to ZERO and the SOURCE windows blanks and appears a message saying "no reference source found".... That cause me a HUGE problem because I can debug correctly my soft so I can't make any corrections or test the proper funcionallity... I'm blowing my head trying to solve this but I can't tell why it's not working fine.. It's the first time it happens to me....
I've been using this from a long time.... At first I guess it could be a problem of sync because I allways use a 16MHz OSC CLK but know I need to speed it up so I'm using a 20MHz one because PLL blows my mind!!.... I checked the IO_DELAY and it's correctly set at 11....(240/20)-1=11
PLEASE ANY HELP WOULD BE STRONGLY APPRECIATED.... THANKS IN ADVANCE!!!
Alban clarified subject
Message Edited by Alban on 2007-02-28 02:10 PM