Main Site Documentation

G120 - CAN 1000Kb not supported anymore or was this never supported?


#1

We found out today that the G120 module is not able to support a CAN bus speed from 1000Kb with the current firmware. I also noticed that this speed is (no longer) listed in the documentation.

@ GHI, can you confirm you dropped (or never supported) the 1000Kb CAN speed on the G120?


#2

Why do you think it is not supported?


#3

It’s not possible to set a presale value to 2.5, so we changed the APB clock divider and tested this again with a presale value 5 for 1Mb (PCLKDIV = 1 instead 2 => APB clock 120Mhz instead of 60Mhz) and all test are ok.
But off course then the other devices on the APB clock are failing…

So for me with the knowledge I have at this moment, it is not possible to get a correct CAN bit timing for 1Mb on the G120 (with the current firmware)
Please correct me if I’m wrong, I will happy to admit I’m wrong if you can show me how to get this working :wink: I even send you some beers :stuck_out_tongue:


#4

We also added the Synchronization Jump Width as a aparameter in the CAN init, using values 1,2 and 3 but the difference is to big. With a BRP 2 you get a speed off 1250 Kb and BRP 1 gives 833 Kb. (using 60Mhz as APB Clock)


CAN1 = new CAN(CAN.Channel.Channel_1, (uint)(((T2 - 1) << 20) | ((T1 - 1) << 16) | ( SJW << 14) | ((BRP - 1) << 0)), BUFFER);

I also tested adding the sampling bit 23 but this is only recommended for low to medium speed buses, but tested it anyway, you never know…


#5

@ Gus - Is it possible to give me a simple yes/no answer pretty please so I know what my options are?

I’m facing a deadline here on a commercial application in 7 day’s.

If it’s a no then I have 2 options:

  • switch back to EMX (this works) but then I have to make the electronic engineers work the night shift and order new PCB’s on next day delivery… It’s possible with Euro circuits but the overhead cost is significant. ( i already had to order my V1 board this way)

  • Make all other devices we absolutely need work on the 120Mhz APB clock by register poking… could work but no way to tell until it’s actual is working…

If it’s a yes, then I can focus on testing and wait for your answer or work around.

A clear answer is much appreciated.

You can also just email me at dv at emrol dot com if we need to discuss this off the forum.


#6

have you tried this between two G120 modules?


#7

I’d give GHI a direct call on this one to make sure you get an answer in a timeframe that doesn’t require someone to read a post on the forum… Edit: then Gus reads the forum :slight_smile:


#8

Will test tomorrow, just saw the post. Curious about using modules on both ends


#9

TYVM Brett :wink:


#10

@ Gus - @ Gus - Just send mail to support, I wait until tomorrow.


#11

@ Gus - Yes this was tested on 3 G120HDR modules and 10 G120 modules on a custom board. ( I had some los of face before so I wanted to be 1000% sure)

[EDIT] but always with a external CAN analyzer and a existing CAN bus with verified 1Mb CAN communication.


#12

Between 2 G120 modules this “could” work because both would ha a “wrong” speed…
But then again, no this is not working , we put both CAN1 and CAN2 on the same bus with the correct messages and filters and all we get is buss off errors when we add a 3e CAN unit (analyzer or EMX module)

CAN1 sending to CAN2 and vica versa is not working.


#13

After we have been looking a bit “deeper” in to this issue it seems there is no real “rocket since” involved. It’s just a mathematic issue.
If on a clock = 60Mhz for the APB devices CAN is working fine (tested an calculated) with a BRP 5 for 500kb, 10 for 250kb and 20 for 125Kb it is absolutely logical to get BRP 2.5 for 1000Kb. but putting 2.5 in 10 bit is just not possible. So we started to read out the APB divider (default on 4 but set on 2 by the GHI firm ware) and got the idea to change this to 1, so we could use 5-10-20-40 as BRP and this worked like a train in all test!


#14

To be clear, this was done by:


        Register PClockDivider = new Register(0x400FC1A8);
        PClockDivider.Write(1);

And this only worked when we use USB debugging because UART is on the same clock.
(we use COM debugging because USB client and host are used in this project)


#15

We are working on it now.


#16

:slight_smile:


#17

@ David@ Emro

We are still working on the issue and hope to have an answer for you by tomorrow.


#18

Ty guy’s, really appreciate this!


#19

Except for the timing differences, are there known stability issues with the firmware running the APB clock on 120Mhz? We noticed a great speed improvement on SD access and mounting SD or USB host memory against the USB client interface… Not sure why because the USB clock is a separate one…But in general I think we won about 3 seconds in the boot / initialize faze by changing the clock speed.


#20

No known issues but this is outside the specifications.