CAN Communication with MCU

information about how to make an ECU (MoTeC or non MoTeC) work with a MoTeC dash or data logger

CAN Communication with MCU

Postby Aaron95 on Fri Nov 24, 2017 12:24 am

Hello.

I trying to Design My own Display.

Before I design Display I need to transfer my data from Motec M800 to my MCU.

(The MCU i use is TRK-MPC5604P - freescale)

I looked through the home page and knew that there is can address range and i have to select my own can address.

Can you check if its right? And if i misunderstand plz tell me how to get M800 address.

And Can i have some information that can help me with tranferring data.
Aaron95
 
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Re: CAN Communication with MCU

Postby adrian on Fri Nov 24, 2017 8:47 am

The M800 has a default CAN stream as per the attached document. This CAN setup mimics a serial stream in that everything is sent on one address and there is a header and check sum. You can send this on any address you like.

You can also setup custom Data Sets which you can then set to send sequentially if you prefer.
Attachments
PSAU0015_MoTeC_M800_Set_3_Data_Protocol.pdf
(130.9 KiB) Downloaded 1562 times
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Communication with MCU

Postby Aaron95 on Sun Nov 26, 2017 2:21 pm

Thanks for your reply

I check your upload file and i had a few questions.

First there is no CAN ID.

And If there is. Is it possible to send all the data in one CAN ID?

I know that usually only 8bytes is the maximum by one CAN ID.
Aaron95
 
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Re: CAN Communication with MCU

Postby David Ferguson on Sun Nov 26, 2017 3:52 pm

The M800 can be programmed for any CAN ID using the ECU Manager -- typical values are 1520 (0x5F0) or 232 (0x0E8). Templates on the dash side typically allow the user to specify the CAN-ID the ECU is sending.
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1379
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California

Re: CAN Communication with MCU

Postby adrian on Mon Nov 27, 2017 9:36 am

Like David said you set the address in the ECU Manager software, this can be (almost) whatever you like.

The default stream that I gave you the information on is sent like a serial stream. All of the data is sent on a single CAN address, 8 bytes at a time. So the first message will have the 4 header bytes and then the first 2 channels (4 bytes, 2 bytes per channel). The next message (on the same address) has 4 channels and so on until all of the channels are sent. You then have the checksum at the end, then the header starts again.

I have attached an image of the raw data coming from the ECU.

If you don't want to configure your device to read this message you can simply set up a custom dataset in the ECU and then transmit that sequentially. This will then just have all of the channels you select, 4 channels per message, on sequential addresses from the base address you select. I have attached another document showing you how this is formatted.
Attachments
MoTeC M800 CAN data format.pdf
(21.33 KiB) Downloaded 1401 times
M800 CAN.png
M800 CAN.png (10.9 KiB) Viewed 25164 times
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Communication with MCU

Postby Aaron95 on Thu Nov 30, 2017 1:04 am

Thanks for your advise

I tried to handle the motec can address data set.

I tagged the picture below.

Can you check if it right to send data in sequentially.

And i couldn't understand the file you send me about Sequential data set.

<Sequential format transmits each group of 4 channels in custom data set item number order on a
sequentially incremented CAN address starting at the address specified. Up to 16 CAN addresses can be
used for 64 channels, transmitted at the rate specified.>
Attachments
캡처.PNG
캡처.PNG (223.38 KiB) Viewed 25130 times
Aaron95
 
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Re: CAN Communication with MCU

Postby adrian on Thu Nov 30, 2017 8:46 am

If you want to transmit the channels in a standard sequential manner you need to do the following:

1. Go to Adjust|General Setup|Communications|Setup Custom Datasets
2. Add all of the channels you want to transmit to Data Set 1
3. Go to Adjust|General Setup|Communications|CAN Setup
4. Set CAN 0 Data to 8
5. Set CAN 0 Address to the CAN address you want to use - remembering this is a decimal value, not hex.

With this setup it will transmit the first four channels in your list on the address you set, the next four channels on address + 1 and so on until all of the channels are transmitted.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Communication with MCU

Postby Aaron95 on Fri Dec 01, 2017 7:32 pm

In sequentail data is one item assigned by 2 Bytes?

And to assigned the item. Do i just refer the protocol description?

In general, it is expressed as 125kbps, 500kbps, 1Mbps in CAN communication. In Motec, it is possible to change this speed by user?
Attachments
KakaoTalk_20171130_220815344.png
KakaoTalk_20171130_220815344.png (40.17 KiB) Viewed 25091 times
Aaron95
 
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Re: CAN Communication with MCU

Postby adrian on Mon Dec 04, 2017 9:23 am

Yes every channel sent out of the ECU is 2 bytes. The resolution and units are what ever is set in the ECU.

No, if you use a custom data set it will send the messages you select, not the ones in the default setup (see below example).

The ECU can be set to either 1Mbps or 500kbps by going to Tools|Options|Communications.
Attachments
M800 Custom Sequential.png
M800 Custom Sequential.png (14.67 KiB) Viewed 25049 times
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Communication with MCU

Postby Aaron95 on Tue Dec 19, 2017 3:59 pm

Thank for your help.

Can you tell me the difference of ADL MDD ECU.

And also i check can communication by CANoe but i can't check the data by motec ecu manager and CANoe at the same time.

Is there way to check data at the same time? (like dual data send)
Aaron95
 
Posts: 10
Joined: Wed Nov 22, 2017 7:21 pm

Next

Return to ECU to Dash Comms

Who is online

Users browsing this forum: No registered users and 2 guests