CAN example samples available for AN4258

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

CAN example samples available for AN4258

Jump to solution
484 Views
koauts
Contributor II

Hello, I previously saw an answer that CAN can be applied to the manual AN4258 using the s12xs64 chip.

 

The link below is for relevant inquiries :

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12X-How-to-used-msCAN-in-bootloader/m-p/17...

 

Are there any CAN sample examples of s12xs series that can be applied to the An4258 manual?

 

 

 
Tags (2)
0 Kudos
1 Solution
445 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I would suggest you to read the principle of AN4258. It is short and easy to understand.

The handshake is solved by XON and XOFF protocol bit for dynamic data flow. There is a buffer in the MCU which is filled directly from PC and when it is full the XOFF is send from MCU to the PC to stop data flow. Then the MCU flashes the data. After they are flashed (buffer is empty) the XON is send from the MCU to the PC and data flows continues.

 

The AN4258 works:     PC(UART) <----    XON/XOFF driven Handshake  ----> MCU(UART)

 

The solutions you can use:

1) PC(UART)<->MCU_MASTER(UART/CAN) <-> MCU(CAN)

2) PC(CAN)<->MCU(CAN)

In both cases you can perform some dynamic handshake with filling and processing a buffer on MCU side or you can use static handshake when you send an exact and appropriate number of bytes to the MCU and wait (PC) for confirmation of data processing (MCU) to be able to send next data set.

 

The second option is, of course, better but you need some PC CAN interface and SW to control handshake.

 

So, finally if you exclude entire UART communication from AN4258 you can implement any data flow between your Master device and MCU via CAN.

 

Best regards,

Ladislav

View solution in original post

0 Kudos
6 Replies
468 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

as I wrote in previous answer. There is no CAN communication example related to AN4258. The examples mentioned in the previous answer shows how to use CAN and the implementation/porting is up to the engineer. One of the reasons why CAN protocol example was not made is that there must some master device with CAN communication which can communicate with the MCU with defined upper level protocol. The easiest way of such protocol is implemented in the AN4258 because there are simple possibilities of communication via UART. (Hyperterminal was used in past for development)

Best regards,

Ladislav

0 Kudos
452 Views
koauts
Contributor II

Thank you for answer.

I have more questions.

Does the need for a master device mean that the bootloader can be executed through master-slave communication?
example:
PC---(SCI)-->Master(mcu)---(CAN)-->Slave(mcu)---(SCI)-->PC

I was planning a bootloader that would simply exchange data with the PC solely through CAN communication.

So, would it be difficult to plan to expand the CAN module to AN4258SW and work only with CAN without serial communication such as SCI?

Tags (1)
0 Kudos
451 Views
koauts
Contributor II

Ultimately, the goal is to be able to perform the bootloader with just one MCU.

Tags (1)
0 Kudos
446 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I would suggest you to read the principle of AN4258. It is short and easy to understand.

The handshake is solved by XON and XOFF protocol bit for dynamic data flow. There is a buffer in the MCU which is filled directly from PC and when it is full the XOFF is send from MCU to the PC to stop data flow. Then the MCU flashes the data. After they are flashed (buffer is empty) the XON is send from the MCU to the PC and data flows continues.

 

The AN4258 works:     PC(UART) <----    XON/XOFF driven Handshake  ----> MCU(UART)

 

The solutions you can use:

1) PC(UART)<->MCU_MASTER(UART/CAN) <-> MCU(CAN)

2) PC(CAN)<->MCU(CAN)

In both cases you can perform some dynamic handshake with filling and processing a buffer on MCU side or you can use static handshake when you send an exact and appropriate number of bytes to the MCU and wait (PC) for confirmation of data processing (MCU) to be able to send next data set.

 

The second option is, of course, better but you need some PC CAN interface and SW to control handshake.

 

So, finally if you exclude entire UART communication from AN4258 you can implement any data flow between your Master device and MCU via CAN.

 

Best regards,

Ladislav

0 Kudos
323 Views
koauts
Contributor II

Can you provide information about the memory map of MC9S12XS64?

It is difficult to define vector table overrides and their location for the application.

Tags (1)
0 Kudos
293 Views
lama
NXP TechSupport
NXP TechSupport

Attached

L.

0 Kudos