MS3 board USB to UART converter/CAN Passthrough

A forum for discussing the MegaSquirt related (but non-B&G) board development, assembly, installation, and testing.

Moderators: jsmcortina, muythaibxr

Post Reply
thomas505
Helpful MS/Extra'er
Posts: 48
Joined: Tue Apr 12, 2011 11:15 pm

MS3 board USB to UART converter/CAN Passthrough

Post by thomas505 »

Hello again,
Hopefully this should be an easy one this time :D. I'm finishing up the firmware for an MS3 dash display that i've been working on (to complement my MS3 card - which is another topic). And a few things have cropped up that I wouldn't mind changing, one of these being the ability to use CAN passthrough to tune the MS3 remotely. Now i've pretty much got my head around the CAN side of things, and the documentation for the serial protocol definately seems detailed enough but I still need to actually hook a laptop up to my PIC18F4580 (which has a hardware USART port - just like about every PIC i've ever seen :P) and would rather use USB than a serial port (as my laptop doesn't have a serial port :P).

Now, my question :P, what is the chip that the MS3 uses as a USB - serial converter? I am 99% sure its from FTDI and I *think* its an FT232 or something along those lines? If anyone can help me out it would be greatly appreciated.

Thanks again, Thomas.

EDIT: Looks like an FTDI FT232R will do what I want? (Although I definitely wouldn't mind the EXACT same chip :P)
Last edited by thomas505 on Sat Jul 14, 2012 7:10 pm, edited 1 time in total.
WestfieldMX5
Master MS/Extra'er
Posts: 404
Joined: Tue Dec 30, 2008 9:46 am
Location: Belgium
Contact:

Re: MS3 board USB to UART converter

Post by WestfieldMX5 »

Definitely a FTDI FT232R, drivers here.
2016 Westfield SEiW MX5 1.8 - 6sp - Torsen - MSM turbo - MS3 Pro - 2.3kg/hp
thomas505
Helpful MS/Extra'er
Posts: 48
Joined: Tue Apr 12, 2011 11:15 pm

Re: MS3 board USB to UART converter

Post by thomas505 »

Awesome, thanks for the prompt reply.
thomas505
Helpful MS/Extra'er
Posts: 48
Joined: Tue Apr 12, 2011 11:15 pm

Re: MS3 board USB to UART converter/CAN Passthrough

Post by thomas505 »

Next question,
In the CAN technical documentation, it mentions the following:
http://www.msextra.com/doc/ms3/can_tech.html wrote:Older code versions were limited to only sending or receiving data in 8 byte blocks and required the specification of a “blockingFactor” However, this limit has been removed as the Megasquirt-3 (and MS2/Extra) codes automatically buffer the requests so the tuning software may send or request larger blocks of data. Without this automatic buffering the overhead of the serial commands was large and transfer rates were very low. So the tuning software MUST know if this is a local or remote request and if it is dealing with an older firmware it must only ask or send a maximum of eight data bytes at one time for the remote transfers.
Now, how large is this buffer? I think I remember reading 1000 bytes somewhere? But I can't seem to find it again... Also, does the MS3 make use of the hardware handshaking/FIFO buffer in the FT232RL at all? Or does it simply accept all data and return buffer full if the buffer has overrun (this is what I think is the case).

Any help appreciated.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 board USB to UART converter/CAN Passthrough

Post by jsmcortina »

MS3 handles the FT232 just the same as the MAX232. The CPU serial module TX and RX (ONLY) are connected.

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".
thomas505
Helpful MS/Extra'er
Posts: 48
Joined: Tue Apr 12, 2011 11:15 pm

Re: MS3 board USB to UART converter/CAN Passthrough

Post by thomas505 »

Awesome, from here the only thing I need is buffer information. Was I correct in saying the MS3 uses a 1024 byte buffer for serial? And if so, is it possible to use a smaller buffer (preferably 256 bytes, though I could do 512) or will tunerstudio keep trying to send 1024 byte messages?

Thanks, Thomas.
jsmcortina
Site Admin
Posts: 39621
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MS3 board USB to UART converter/CAN Passthrough

Post by jsmcortina »

I need more context to understand your question. It sounds like it more for Phil to answer though. The MS3 (1.1) can handle packets of up to 1k.

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".
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: MS3 board USB to UART converter/CAN Passthrough

Post by racingmini_mtl »

If I understand what you want to do correctly, the buffer size is not critical. Even if TS sends a 1024-byte packet, since the CAN bus speed is much higher than the serial port speed you shouldn't need to buffer much more than one CAN packet (8 bytes). I don't think you want to buffer the complete packet and then send it over CAN because that will slow down communications a lot.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
thomas505
Helpful MS/Extra'er
Posts: 48
Joined: Tue Apr 12, 2011 11:15 pm

Re: MS3 board USB to UART converter/CAN Passthrough

Post by thomas505 »

jsmcortina wrote:I need more context to understand your question. It sounds like it more for Phil to answer though. The MS3 (1.1) can handle packets of up to 1k.

James
I want to implement CAN passthrough for the new serial format (as everything else so far seems to be working fine).
racingmini_mtl wrote:If I understand what you want to do correctly, the buffer size is not critical. Even if TS sends a 1024-byte packet, since the CAN bus speed is much higher than the serial port speed you shouldn't need to buffer much more than one CAN packet (8 bytes). I don't think you want to buffer the complete packet and then send it over CAN because that will slow down communications a lot.

Jean
But then how would you check CRC? From my understanding you require the entire packet to be stored to verify its contents.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: MS3 board USB to UART converter/CAN Passthrough

Post by racingmini_mtl »

In CAN passthrough, any CRC verification should be done by either the PC or the MS3 not the passthrough device. But that's my opinion and I don't know if that works with the current implementation of TS or MS3. James and Phil will have to chime in. If that's not the case then it's a problem because the communications are being slowed down uselessly. And there is also the need to buffer every packet in full.

I should add that the CAN protocol is reliable so a CRC check is not needed for that part of the comm link.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Post Reply