CAN questions (was: MS3 pre-1.4 alpha 8 released)

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

CAN questions (was: MS3 pre-1.4 alpha 8 released)

Post by Alfagta »

Hello,

i have a Setting error and don't know how to handle this one...
Can anyone help?
Config error.JPG
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

Looks like your CAN transceiver is broken.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

How does the MS can check this?
This Error is coming up when i try to send Can data to the MS.

Broadcasting with the MS is working normally.
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

If the CAN system fails to initialise within a reasonable period of time, the code decides that it must be broken and flags that error.

Code: Select all

    /* wait for synch to bus */
    ix = 0;
    while ((!(CAN0CTL0 & 0x10)) && (ix < 0xfffe)) {
        ix++;
        asm("nop");
        asm("nop");
        asm("nop");
        asm("nop");
    }
    if (ix == 0xfffe) { // normal behaviour ~38
        // CAN broken
        conf_err = 190;
    }
The only times I've seen it are when a customer has damaged the MS3 card and broken the processor. Sometimes the CAN chip gets broken too.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

Ah okay,
I think mine is okay because Broadcasting work without any error.
The only Problem is that i receive strange data.
I'm trying to figure out why i get this Data.I think the Problem is my test System.
However it's not possible for me to send Data to the MS.
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

The setting error only occurs when i send packages with my can device and Switch the MS on while i'm sending continuously packages.
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

Alfagta wrote:The setting error only occurs when i send packages with my can device and Switch the MS on while i'm sending continuously packages.
That's probably the problem, the CAN module likely needs to see a clear bus to be able to initialise. You'd have to read the Freescale datasheet for the part (MC9S12XEP100) to be sure.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Reverant
Super MS/Extra'er
Posts: 1233
Joined: Sat Apr 15, 2006 12:39 am
Location: Athens, Greece

Re: MS3 pre-1.4 alpha 8 released

Post by Reverant »

On a microsquirt module, I've also seen the MCP2551 being placed 180* from the factory!
The man behind MS Labs
2005 Audi A3 2.0L TFSI DSG AWD - Extreme MS3
2002 Mazda Miata 1.8 6sp - Enhanced MS3 1.4.0, sequential injection, sequential ignition, big turbo, lots of boost
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by racingmini_mtl »

Reverant wrote:On a microsquirt module, I've also seen the MCP2551 being placed 180* from the factory!
That's not good! But it's good to know that this has been seen. However, in this case it can't be the issue since there has been some transmission which would not happen with a reversed chip.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

Hello,

the tranmission to the MS is working now.
Now it's time for the receive from the MS.
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

Hello,

can communication works fine now.
But i have another question, in the "Can Receiving" i can choose 24 Can ADC Inputs.
But it is not possible to set 24 Can ADC Inputs because there are only 16 fields.

So why do we have 24 ADC Inputs?
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

Alfagta wrote:So why do we have 24 ADC Inputs?
You can fetch data into them using the "CAN polling" system.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

jsmcortina wrote: You can fetch data into them using the "CAN polling" system.
James
Yes i know but this is the "old" Megasquirt Can Protocol or isn't it?
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

Alfagta wrote:
jsmcortina wrote: You can fetch data into them using the "CAN polling" system.
James
Yes i know but this is the "old" Megasquirt Can Protocol or isn't it?
Yes, but you can use them at the same time.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

And if i will use them i had to implement the Original Megasquirt Can Protocol which i don't fully understand right now.
Because the alignment of the Data in the Register's are not the same as standart Can Protocol 2.0A/B
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

Alfagta wrote:And if i will use them i had to implement the Original Megasquirt Can Protocol which i don't fully understand right now.
Because the alignment of the Data in the Register's are not the same as standart Can Protocol 2.0A/B
If you do want to do that, take a look at the protocol document in http://www.msextra.com/doc/pdf

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Alfagta
Experienced MS/Extra'er
Posts: 239
Joined: Wed Aug 21, 2013 2:54 am

Re: MS3 pre-1.4 alpha 8 released

Post by Alfagta »

I can Request Data from the MS now.
I also can parse an request from the MS.
But i don't relly know how the Response for an MS Request has to Looks like.
For ADC Polling i get the following Message from the MS:
From id:0
To id:5
Var Block:7
Var Offset:2

So how has the Response to be?
Alfa 156 GTA
Alfa 75 Race Car MS III -- alway latest FW
Alfa 164 V6 Turbo
Alfa 155 2,5TD RIP
Test MS II --always latest FW
Tunerstudio V2.6.11 Registered
MegaLog Viewer V3.4.04 Registered
thokes82
Helpful MS/Extra'er
Posts: 102
Joined: Mon Apr 27, 2009 5:02 am
Location: Munster, Germany
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by thokes82 »

Did you see the Teensy or Arduino posts in the expansion boards section of this forum? They contain both protocols, MS and standard. I suggest to take a look at https://github.com/merkur2k/MSCan_Gauge ... /README.md
that is how I learned it... :D
Image
Race car building documentation: www.kessel.tk (nice pics but only german laguage so far...)
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by jsmcortina »

Did the PDF document not explain it clearly enough?

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Peter Florance
Super MS/Extra'er
Posts: 3653
Joined: Fri Apr 02, 2004 8:40 pm
Location: Virginia Beach, VA
Contact:

Re: MS3 pre-1.4 alpha 8 released

Post by Peter Florance »

Reverant wrote:On a microsquirt module, I've also seen the MCP2551 being placed 180* from the factory!
That would do it...
Peter Florance
PF Tuning
81 BMW Euro 528i ESP Car
60-2 Wheel LS2 Coils, Low Z Inj
Co-Driver 1999 BMW E46 DSP car.
Post Reply