This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC1758 CAN Controller

Hello, EveryOne

I'm newbie to CAN protocole and embedded software. I need some help with the famous protocol CAN. The MCU that I use is LPC1768 and I have an evaluation bord MCB1700.

I need to use my MCB1700 to communicate with an equipement by CAN Communication. This equipement are using a special CAN protocol.

Here is the CAN protocol:

CAN 2.0A Std, 500Kbps, CAN ID : 0x401
Frame Format : [START][SESSIONID][COMMAND][LENGTH][DATA][CRC][END]

1) [START] ( Length : 1byte )
Start Byte for each frame
Value : 0x7B (Fixed)
2) [SESSIONID] ( Length : 1byte )
Session IDentifier.
EVSE Controller have to send same SESSIONID with received REQ SESSIONID.
3) [COMMAND] ( Length : 1byte )
COMMAND Code.
Refer to '2.Command' sheet.
4) [LENGTH] ( Length : 2byte )
Data Packet Size
Byte Order: Little Endian
5) [DATA] ( Length : 0~254byte )
Maximum data size : 254bytes
Byte Order: Little Endian
6) [CRC] ( Length : 1byte )
XOR(exclusive-or) sum of all bytes from [COMMAND] to [DATA]
7) [END] ( Length : 1byte )
End Byte for each frame
Value : 0x7D (Fixed)

According to the description, the length of data could be 254 bytes!

As I know, the CAN open protocole could transfert 8 bytes in one frame and the CAN FD protocole could transfert at most 64bytes.

My question is: 1. Can I use my MCB1700 to send a can frame more than 254 bytes? 2. If yes, should I re-write the can drivers provided by keil? 3. To send a data 254 bytes, how long will it occupy the CAN bus?

Parents Reply Children
  • As a reference:

    AN3154
    Application note
    CAN protocol used in the STM32 bootloader

    Read Memory Command: Reads up to 256 bytes of memory starting from an
    address specified by the application

    Write Memory Command: Writes up to 256 bytes to the RAM or Flash memory
    starting from an address specified by the application

    www.st.com/.../jcr:content/translations/en.CD00264321.pdf

  • I think so too. But it's not mentioned in the user guide.
    I will check this point with the manufacturing.
    Thanks a lot for your help

  • Divide the above data by 8 bytes, every 8 bytes is a packet, send the packets one by one.???

    Nah, that wouldn't work reliably. It needs at least some way to keep itself from the START byte showing up in any but the first CAN frame of the packet.

    I said it in my first reply: there has to be some transport protocol operating between this packet format and the actual CAN bus; something like ISO 15765-2. If it's actually CAN to begin with, that is.