About S12G128 EEPROM

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

About S12G128 EEPROM

1,421 Views
kimkang-mok
Contributor II

Hi, Actually I want to know why CAN and UART has problem when I use Initialize CLK for EEPROM.

I follow the S12GN32's EEPROM Code.

My PLL Bus CLK is 32Mhz. I use 125kbps CAN Speed and baud 9600 UART Communication.

The symptoms of my program are as follows:

1. When I except EEPROM Initializing code, My CAN function and UART function is working.

2. When I include EEPROM Initializing code, My CAN function and UART function is not working.

I need all three functions.

How can I solve this problem?

7 Replies

940 Views
TurboBob
Contributor IV

Radek:

You said :

I would like to also recommend using an external oscillator as the source clock for CAN module instead of PLL.

do you mean that an 8mhz crystal is not suitable for CAN applications?  I looked thru the reference manual and could find no recommendations.

thank you

Bob

0 Kudos

940 Views
RadekS
NXP Employee
NXP Employee

Hi Bob,

No, the meaning is exactly opposite.

The 8mhz crystal is suitable as CAN clock source in most of the cases.

The PLL clock is suitable as CAN clock source rather only for debugging purposes.

For real application, the crystal should be used as the clock source.

The difference is in accuracy. The internal IRC clock have accuracy +/-1.3%. The PLL unlock detection is between 0.5 and 2.5%. So, the PLL based on IRC may not fulfill clock CAN accuracy requirements on edge cases.

I hope it helps you.

 

Have a great day,
Radek

940 Views
TurboBob
Contributor IV

Thank you for clarifying.  It makes sense.     I posted in another (old) thread,  not sure I will every get a reply.  That question was if there is a patch or port of the AN2295 bootloader for the '12s

thanks

Bob Bailey

0 Kudos

940 Views
RadekS
NXP Employee
NXP Employee

Hi Robert,

Yes, I guess that thread from 2008 will be not followed anymore.

 

About bootloader for S12G)

I would like to recommend AN4258 Serial Bootloader for S12(X) Microcontrollers Based on 180 nm Technology

http://www.nxp.com/files/microcontrollers/doc/app_note/AN4258.pdf

http://www.nxp.com/files/microcontrollers/doc/app_note/AN4258SW.zip

It is simple serial bootloader where S12G is already supported (S12G128, but other derivatives may be added).

 

there are also few other older bootloaders. For example:

AN2153 A Serial Bootloader for reprogramming the MC9S12DP256 FLASH Memory

http://www.nxp.com/files/microcontrollers/doc/app_note/AN2153.pdf

http://www.nxp.com/webapp/Download?colCode=AN2153SW

AN2546 HCS12 Load RAM and Execute Bootloader User Guide

http://www.nxp.com/files/microcontrollers/doc/app_note/AN2546.pdf

http://www.nxp.com/webapp/Download?colCode=AN2546SW

AN3275 S12 All-Access Bootloader for the HCS12 Microcontroller Family

http://www.nxp.com/files/microcontrollers/doc/app_note/AN3275.pdf

http://www.nxp.com/webapp/sps/download/license.jsp?colCode=AN3275SW

AN3391 LFAE Bootloader Example and Interface for use with AN2546 (CAN bootloader for S12XE)

http://www.nxp.com/files/microcontrollers/doc/app_note/AN3391.pdf

http://www.nxp.com/files/microcontrollers/doc/app_note/AN3391SW.zip

However, these bootloaders do not support S12G family directly. On another side, the AN3391 may be more universal.

 

I hope it helps you.

Best regards

Radek

940 Views
TurboBob
Contributor IV

Thanks,  I will give it a try.

0 Kudos

940 Views
kimkang-mok
Contributor II

Thank you for your interest in my post.

I already solve this problem.

My problem arose due to changes in Clock speed.

Thank you for your kindness.

0 Kudos

940 Views
RadekS
NXP Employee
NXP Employee

Hi Kim,

The question is what your EEPROM Initializing code does. Could you share your EEPROM Initializing code here?

 

In fact, the maximum bus clock frequency for an S12G family is just 25MHz.

So, when you overclock MCU and “initialize EEPROM”, the clock may be reconfigured or simply unlocked and unstable.

 

Please do not use bus clock higher than 25MHz for S12G MCUs.

I would like to also recommend using an external oscillator as the source clock for CAN module instead of PLL.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos