V6.2 has problem with clock rate

Showing results for 
Search instead for 
Did you mean: 

V6.2 has problem with clock rate

Contributor II

I developed a program using V6.1 on MC9RS08KA1. The program sent RS232 data out from an output port at 2400baud. All works fine. However, when I complied the same program using V6.2 and downloaded to the same MC9RS08KA1 (all software, hardware, everything were the same except CodeWarrior version). I found that the RS232 signal generated had the frequency changed, the period for each pulse was shorter. Since the signal is generated purely by using instruction delays in the program, I suspect there is something wrong with the internal clock frequency. Could V6.2 affects the trim value in the register or did something that increased the clock rate?

Labels (1)
Tags (1)
0 Kudos
2 Replies

Senior Contributor IV

Hello John,


Perhaps the programmer is trimming to a different frequency with the version change.

I seem to remember that this changed from a fixed value to an adjustable value at some point.

This being a general thing - not specific to the RS08 or KA.


NXP Employee
NXP Employee

What do you mean with 'the signal is generated purely by using instruction delays in the program'?

It may be that the compiler is more agressive in optimizations, and this may affect your delay instructions if they are not properly implemented.

If you are using delay routines in C, it may be a good thing to declare the loop variables/etc as volatile. Even better and recommended: implement delays in assembly code so you have complete control over it.


Some other hints: add the option -Lst (to create listing files) to your project and compile them with both compilers. Then compare them using a diff utility. Or compare the map file to find out where are the differences.