CAN Receive - data timeout?

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Post Reply
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

CAN Receive - data timeout?

Post by MWPau »

Hi guys,

Im trying to use can receive to pull some 11bit can data from an electric power steering system so i can log it.
I've set it up as reading into a CANADC, then into a generic sensor which i view in TS.
The value seen in TS flickers between the correctly read value and 0 (or 1024 depending on data format) very often.
The EPS system is only sending out the can packet about once every second.

Is the flickering caused by some kind of MS3 can read timeout or something else?

Thanks once again :)
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN Receive - data timeout?

Post by racingmini_mtl »

That may be a stupid question but are you reading ADCs from the TinyIOx?

Also, posting your msq and a datalog would be helpful.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: CAN Receive - data timeout?

Post by MWPau »

Doh! Yup, thats it.

CANADC selection is reading 1-4 and 5-8 from the TinyIOx.
I'm only using 1-5 though, and forgot i then couldn't use 6,7,8.

I'll move the can receiving up to CANADC10 tomorrow and give it a go.
That will probably fix it then i guess.

Thanks once again Jean.
This MS3 setup is pretty complex, so i keep missing little things like this :(
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN Receive - data timeout?

Post by racingmini_mtl »

It is complex when you start interacting with many CAN devices (in addition to the many MS3 settings).

Maybe the MS3 should be checking for that type of conflict. This way you'd be getting an error message if you attempt to receive a CANADC that's already being polled.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: CAN Receive - data timeout?

Post by MWPau »

Yeah, that would be handy.
Or at least having these similar settings in the same dialog box.
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: CAN Receive - data timeout?

Post by MWPau »

The next problem is i need to read a signed 12bit value (the top 4 bits of the high byte are used for something else).
I gather there is no easy way to do this, so ill be editing the 1.4.0 source (thanks for getting this up so quickly James!!).
It would be nice if this could be added to the MS3 FW, but i know that its impossible to support every odd combination like this.

It'll be great when its working though, ill be displaying steering wheel angle (along with a heap of other MS3 data) on in-car videos using RaceRender :yeah!:
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN Receive - data timeout?

Post by racingmini_mtl »

Actually, just adding a mask to the list of parameters would allow the user to do what you want. And I don't think this is something that exceptional so it would be useful to add in my opinion. You'd need to have a mask up to 4 bytes long and the code would have to extend the sign the correct way. The multiply and divide fields would have to be used to shift the bits as needed.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
MWPau
Master MS/Extra'er
Posts: 411
Joined: Thu Mar 03, 2011 6:24 pm

Re: CAN Receive - data timeout?

Post by MWPau »

After just modifying the source, i had exactly the same thought :)
Give the 32bit mask option, and have the FW also shift right to the first used mask bit (would remove the need for a right shift & mask fields).
Toyota Celica GT4/Alltrac with 5S-GTE stroker (2.2L I4 turbo, high CR) on E85 w/FlexFuel.
MS3 + MS3X + KnockBoard + RTC + BT + DIY CAN-IO-Board + DIY CAN Digital Dash.
Post Reply