Jump to content

Raspberry pi v3 dash display fit megasquirt


mad_pete

Recommended Posts

I believe that the Raspberry Pi has a UART that is able to run as a serial port, so no need to Convert to and from USB
Just configure the OS correctly (e.g. not to run a console on the serial) and connect to the right GPIO pins

Note I've not done this myself but I'm sure a web search will tell you how.

Edit: I guess that megasquirt is full RS232 and running at 12V which will need to be converted to 3.3V for a UART connection

Link to comment
Share on other sites

As Zardos says, the GPIO header should have 3v3 (possibly TTL compatible) serial TX/RX pins. Your MS will be running "full" RS232 at +/-12v so you'll need whatever the 3v3 version of a MAX232 chip is. Best bet check the Pi forums etc. as someone's bound to have solved this one before. Likely a ready-made board on eBay from China for a few pennies. Something like this in fact.

If you do USB-Serial you want anything that uses an FTDI chip, although Linux seems to handle the rest more sensibly than windows ever did - if you only have one USB-Serial attached it is likely to always be /dev/ttyUSB0

Also - show us what you're making! :P

Link to comment
Share on other sites

...also these guys make a good point about turning off the system console on that port if you're using the serial port for other things, it could proper mess you up:

Quote

The UART is /dev/ttyAMAO, it defaults to output system log. But if user wants to use this UART to connect to other modules through UART, for example, GPS module, we need to change the configuration.

The detailed steps are as following:

We need to modify two files: /boot/cmdline.txt and /etc/inittab.

Modify /boot/cmdline.txt:

Replace the original content:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

With:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait


Modify /etc/inittab:

Comment out the last line of /etc/inittab. To comment out, it simply addess a '#'.

 

$ sudo vi /etc/inittab

  1. T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Save the changes, and reboot. We will get an UART with baud rate of 115200.

 

Link to comment
Share on other sites

  • 1 month later...

Okay. Update.

RPi v3 is very impressive.  Very fast, built in wifi and Bluetooth. Nice bit of kit.

Doesn't like 12v instead of 5.5v

But that aside I have working:

  • Power to the Pi from the car
  • In car monitor
  • TunerStudio (loads straight in, super easy) 
  • Auto shutdown from the car PSU

Not yet working :

  • Serial port - got the thing from ebay haven't it talking yet - I need to recheck the settings. Swapped controller fromthe Bluetooth to the serial 
  • Touch screen

 

 

IMG_3237.JPG.f2f7c33e16bab54d510a4eddd97605a1.JPG

IMG_3242.JPG.587958aafafaf81fd3b647c1f4d46a60.JPG

 

 

 

Link to comment
Share on other sites

Nice!

19 hours ago, mad_pete said:

TunerStudio (loads straight in, super easy) 

Did you configure TunerStudio to auto start? If so, how? I never managed to get that working.
Same with the auto shutdown, had some trouble with reading the GPIO pin for that IIRC.

Link to comment
Share on other sites

May be obvious but the Pi serial pins will be 3v3, whereas the MS RS232 output will be +/-12v. You'll need a MAX232 (possibly MAX3232 for 3v3 if memory serves) to convert levels. Plenty of ready-made boards for peanuts on eBay.

Link to comment
Share on other sites

17 hours ago, elbekko said:

Nice!

Did you configure TunerStudio to auto start? If so, how? I never managed to get that working.
Same with the auto shutdown, had some trouble with reading the GPIO pin for that IIRC.

Auto start 

https://www.youtube.com/watch?v=-UnS-xxT0Aw&feature=youtu.be

Auto stop

http://www.instructables.com/id/Simple-Raspberry-Pi-Shutdown-Button/

My PSU gives me a latch on shutdown and then waits a minute before a hard power off.  I put the latch pins to the GPIO pins. I'll add some pictures.

I think for the serial port I might (and not for the first time) be forgetting to run Tunerstudio with a user that is allowed access to the Serial port.

 

 

Link to comment
Share on other sites

  • 1 month later...

Can't get the serial port to work at the moment. Will go and find a rpi forum to post to. I've turned off the console and swapped the Bluetooth over.

if I loop the serial gpio pins thx and extra the tunerstudio minicomm sees the chars and if I connect a laptop to the megasquirt that works hmm.

Link to comment
Share on other sites

Ok got a small null modem connector from eBay and it seems to mostly work. The dectect came back with msns or similar repeated for firmware and version and the port check fails but if I just run it the gauges do indeed spring to life. Maybe the null modem doesn't have all the loopbacks in place. So that's the most important bit. Just need to wire it in and maybe find a custom dash I like. :-).  Maybe I'll see if the firmware needs an update.

Link to comment
Share on other sites

You should only need 3 wires for the RS232 cable: Tx, Rx, Ground.

Any time a USB adapter is involved there's opportunity for problems as they can buffer data or have flow control / wrong speed etc.

You'd almost be better off using the Pi's GPIO UART pins and a stock MAX3232 driver.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 year later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We use cookies to ensure you get the best experience. By using our website you agree to our Cookie Policy