Frequency change while debugging - DEMO9S08SH32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Frequency change while debugging - DEMO9S08SH32

1,656 Views
wtowens
Contributor I

I have a project to convert code from a M68HC08 to a newer processor.  I have converted the code to a MC9S08SH8 using Code Warrior and a DEMO9S08SH32 Demo board.  The first part of the program is most delays to allow some of the devices to be initialized.   If I run the code from the start with a break point where I want to stop in the program, the output on the debugging laptop displays frequency changing ~15Mhz and the program seems to stop running.  If I run the code and put breakpoint in to make the code execute in smaller quantities the program works without any problems.  If I stop the program after it has stopped running the frequency reverts back to the ~8.0Mhz like it should be.   No sure what is causing this to happen, maybe a software/hardware interrupt or just something between the CPU and the debugging system.  If you can give me any information as to where to look please replay.

 

 

 

 

Added p/n to subject.

 



Message Edited by NLFSJ on 2008-10-15 04:33 PM
Labels (1)
0 Kudos
Reply
2 Replies

867 Views
wtowens
Contributor I
I have done some more testing and found that the change in frequency pops up right after a RTI instruction from an interrupt routine is executed.   All the original code is in assembly so I am trying to stick with that for now instead of converting it to C.
 
The interrupt is from an overflow of one of the TPM timers which is expected.  It gets to the routine without problems and executes the code correctly but when the RTI instruction is executed the frequency changes for ~8mhz to 16mhz.  Even if i single step over the RTI instruction it will not stop in the code and show the next instruction.  I have to hit the Stop arrow in the debugger to get back to code.  I'm wondering if maybe the return information is getting stepped on in the interrupt routine.
 
Thanks for help, I'm a newbee to this processor, more use to the Microchip  and zworld stuff.:smileysad:
0 Kudos
Reply

867 Views
fabio
Contributor IV
Hi Wtowens,

Are you configuring ICS registers? Are you trimming ICS internal clock source within your code?

Small changes on the measured BUSCLK frequency are not unusual (due to the way the BDM measures the BUSCLK frequency) but a change from 8MHz to 15MHz is not the case.

When you say: "If I stop the program after it has stopped running the frequency reverts back to the ~8.0Mhz like it should be. ". What do you mean with "after the program stopped"?

Does your program ends with a while(1) or for(;;:smileywink: statement?

Regards,


0 Kudos
Reply