HCS08QG4 internal clock, trimming and rs232 problems !!!!

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

HCS08QG4 internal clock, trimming and rs232 problems !!!!

2,273 Views
marcom
Contributor I
Hi,

I am starting to work with HC08SQG4.

I am working with CW5 + Indart tool with DataBlaze programmer.

The micro must work with internal clock (ICS) - external expensive for this application! 

I configured the Serial Port (SCI register ) to communicate with these params: 19200baud, 8bit, no parity, 1 stop bit.

I check Rx/Tx with Teraterm.

I trim not the internal clock, I initialize the registers with the freescale factory value stored in flash, as found in application notes.

If I connect the micro through the debugger, it's all OK: tx and rx are perfetct !!!

If I upload the program through datablaze, I send and receive a lot wrong characters.

In "communication settings of MCU" of the Debugger , I find 16000000 as Bus frequency.

The same I find in datablaze !

These are default settings of tool for this micro, I believe.


But If I set this param in datablaze to 18000000, and change the serial port settings of PC (teraterm) to 14400 (the micro tx/rx is set stll to 19600 !!!!!), communication is perfect !!!!

In programmer tab, when I need to check the IGS trimming box?

It' no so clear, the triiming procedure (code, debugger, programmer).

Can You help me ?

I think, that datablaze and debugger have not the same trimming behavior.


Which is a asimple workaround for this problem ????


Thank You


Marco

Labels (1)
0 Kudos
Reply
1 Reply

495 Views
peg
Senior Contributor IV

Hi Marco,

Firstly, I don't know anything about InDart or Datablaze specifically.

What I do know is:

The chip comes from the factory with recommended trim values at $FFAE and $FFAF. Just to get comms working you can ignore the fine trim as it makes little difference as far as the baudrate is concerned. When you ask a programmer to set the trim it will calculate the value and then programme the flash registers where the factory values were (after a mass erase).

It is up to YOU to copy the values from these FLASH registers into the working registers at $3A-$3B for them to have any effect. You usually do this right at the top of your code. You also should check for $FF in the FLASH registers and then do nothing as the default value in $3A-$3B will be better than copying this erased value into the working registers.

The factory values can vary from what the programmer determines due to operating voltage and other conditions on your actual PCB. But the factory values are usually close enough to get successful comms.

When you are in your debugger you should check the values in the working registers to see that they are what you think they should be.

Hope this helps

David

 

0 Kudos
Reply