Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   MSPNP (https://www.miataturbo.net/mspnp-55/)
-   -   Adding regular USB? (https://www.miataturbo.net/mspnp-55/adding-regular-usb-95688/)

Davidss 01-08-2018 02:18 AM

Adding regular USB?
 
So inside the MS3 PNP box there is an open pin header labeled and ready for direct connection to USB. Anyone added a USB port to the case? It would be nice to have versus the serial to USB converter.

Lokiel 01-08-2018 03:51 AM

Yes,

1. Drill a hole for the cable in the case and insert a rubber grommit to stop the cable sheathing being cut through.
2. Cut the end off an existing serial cable that has Tx, Rx, GND and Pwr wires
3. Thread the cable through the hole you drilled in Step 1
4. Connect the 4 USB pins to the corresponding Serial Port pins (GND=Pin5, Pwr=Pin9, the 2 data pins to Pins2&3 - don't remember which way round so look that up) - I used a Female 4-pin connector for the serial wires.
5. Add zip-ties to both sides of the fascia to stop the cable pulling out, allowing enough for stress relief.

Now you can connect via a USB port.

Like so:
https://s19.postimg.org/5d8sir41r/US...psu3lytmbz.jpg
https://s19.postimg.org/7talwlm4f/US...psbbyrhn7l.jpg


My USB panel socket mounts to a box housed in my glovebox:
https://s19.postimg.org/xgmb8o9q7/Fa...ps4xbcdpig.jpg

pyr0boy 01-04-2019 11:49 PM

Sorry to bring up this semi-dead thread but along the same lines as the OPs question, I was hoping some one could chime in about this, adding a USB connector directly to the MSPNP Pro, there is an unused header with +, - tx and rx, which seems to indicate that its a communications port of some kind.
I've added a photo to help illustrate this.
The area I'm talking about is the 'J5' header
https://cimg1.ibsrv.net/gimg/www.mia...333f94a441.jpg

Joe Perez 01-05-2019 10:25 AM

This question is an excellent example of why it annoys me that B&G and DIY have stopped publishing schematics for new products. It would be easy to answer the question if they did.

It does not appear to be a USB header. USB uses a differential pair (+/-) for data transmission in both directions; it does not have have discrete TX and RX lines like RS232.

pyr0boy 01-05-2019 12:45 PM

Thanks Joe,
If that's the case, it could be that this is a secondary serial (RS232) header perhaps, and one could if so inclined hard wire a FTDI serial to USB directly to it.
Although it would raise the question of which if either takes precedence.
With space limited in the foot well, I'm looking for a solution to streamline the conga of cables and adapters I'm using.

shuiend 01-05-2019 01:09 PM

I have asked DIY why a USB port was not included on the Pro's. It was mostly a positioning choice and making one board module and usable in several different types of cases.

Joe Perez 01-05-2019 01:19 PM


Originally Posted by pyr0boy (Post 1517635)
If that's the case, it could be that this is a secondary serial (RS232) header perhaps, and one could if so inclined hard wire a FTDI serial to USB directly to it.
Although it would raise the question of which if either takes precedence.

I honestly cannot answer that. Again, the manufacturer, @DIYAutoTune has chosen not to reveal this information in order to make our lives harder in a bid for some sadistic pleasure which only they can understand.

I can say that in the base MS architecture, there is only one serial port available into the CPU. Typically, a decision is made in the design stage as to whether to present this through a UART driver as RS-232, or into a USB client interface. While I'm sure it's possible, I have never worked on a design in which a single serial channel was multiplexed into different external ports.

If you're really feeling bored, visually trace the TX and RX lines back to their source.

pyr0boy 01-05-2019 11:28 PM

USB Install
 
Well I decided to take your advise and take a closer look at the PCB of the MS3Pro module that is the heart of the MS3PNP, started following the traces, although I found it rather difficult with the silkscreen, after poking around a little more, I found something I had shamefully over looked.
There is a native USB pin out, as well as a header pin out, so using an old PC USB expansion connector, I made up a harness for it.

Shuiend is correct about space issues being the reason, at least as far as I can tell, I was going to put a direct USB output onto the case itself, however with the parts I'm using the 21mm cutout would have no chance of fitting, although i think DIY could do it with a breakout board and PCB mounted USB socket.
But as I don't have a mill (yet :drool:) I feel that cutting a rectangular hole wouldn't look acceptably good, and verostrip PCB has no place in an ECU like this.
The cable is mounted on the same end cap as the MAP hose, I used a stainless steel cable glanded rated to IP67, with a cable tie as further strain relief, the cable I used is 4 core individually shield AWG24, thus far I haven't had any problems.

Instead I have mounted the socket in the glovebox along with my WBO2
One thing to keep in mind if anyone else chooses to do this, you need to install the FDTI drivers, Driver Setup EXE, as with my Win10 the auto driver install didn't work, once drivers are install, change "Communication Settings" in TS, still RS232, put change the port.

Here are some photos to show what I've done. (Please excuse the plastic chips in the glove box)
I'd be happy to answer any questions, if anyone is interested in this.

https://cimg3.ibsrv.net/gimg/www.mia...2790308b56.jpg
https://cimg6.ibsrv.net/gimg/www.mia...331b284234.jpg
https://cimg5.ibsrv.net/gimg/www.mia...18e087622b.jpg
https://cimg7.ibsrv.net/gimg/www.mia...efdcf44e04.jpg

Mudflap 01-06-2019 12:54 PM

I've got that same header in my ms3pro pnp and the silkscreen text next to it clearly states USB. I'll be trying this out at some point. Anyone want to just try it and report back?

pyr0boy 01-06-2019 01:05 PM

I've done it and it works nicely, I wrote a little write-up about it, just waiting for a mod to ok it.

Short answer: it works but needs you to install FTDI drivers/change comm settings etc

Lokiel 01-06-2019 06:31 PM

Not sure why my original MS3Pro USB I/O picture no longer works so posting it again:
https://cimg8.ibsrv.net/gimg/www.mia...46a3d6708f.jpg
Yes, it does work, just make sure that you get your USB pins correct (silkscreen print shows the USB pin order).
You only need 4 pins, +ve,GND,D+,D-; 5th pin isn't needed.
I put a rubber grommet in the fascia and zip-ties either side so that the cable is held firmly in place (be sure to allow some slack for stress relief inside the case to prevent the cable from pulling out.

Note: If I were to do it again, I'd drill the hole in the fascia further to the right to give more clearance to the serial port (I only ever use USB and you can't use both serial and USB so it's not a problem but it would make fitting the serial adapter easier).

pyr0boy 01-06-2019 07:09 PM

That's essentially what I did. Although I used a stainless cable gland with IP67 rating and a cable tie for extra strain relief.

https://cimg5.ibsrv.net/gimg/www.mia...cf1787dbf4.jpg

Lokiel 01-06-2019 08:45 PM

^
Pos-cat added for nice clear photo showing colour-coded USB wires (helps make this mod "idiot-proof" - always a good thing).

Mudflap 02-12-2019 03:23 PM

Got a really strange issue that I'm praying someone has the answer. I grabbed a USB cable and wired it up like the image above. I connected it to the car, go into communication settings and let Tunerstudio find it. Success! Now I have full contact with the ECU. sweet.

But if the car is running, and I plug in that USB, the car goes to crap. It sounds like it is running on 1 cylinder (a lawn mower). Pull the USB plug, goes back to running fine. Bizarre.

Anyone have a clue?

Mudflap 02-12-2019 03:43 PM

BTW - just checked, any USB port (without tunerstudio even on). Meaning, I can instantly go from running well to lawnmower just by inserting the USB. Pull it, back to normal.

Lokiel 02-12-2019 05:57 PM

I've never tried plugging in the USB WITH the car running.

I'm guessing that it interferes with the normal operation/timing of the ECU which is trying to keep your car running AND establish USB communication at the same time.

The initial handshaking is probably introducing additional delays for normal engine operation.

Does it work fine if the USB is already plugged in before you start the car?

Joe Perez 02-12-2019 06:42 PM


Originally Posted by Lokiel (Post 1522585)
I've never tried plugging in the USB WITH the car running.

I'm guessing that it interferes with the normal operation/timing of the ECU which is trying to keep your car running AND establish USB communication at the same time.

The initial handshaking is probably introducing additional delays for normal engine operation.

I'm not arguing that you're wrong, I'm just puzzled.

Obviously I don't have access to the schematics for the PnP3 (because Bruce Bowling and Al Grippo are evil, fascist monsters who bite the heads of off live kittens), but wouldn't DIY just be using a standard RS-232-USB chip, like a CH340 or an FT2232?

So far as I am aware, the CPU in the MS3 doesn't have anything to do with managing the USB link, it just speaks 232 to an external ASIC, which handles all of that in hardware. Shouldn't be any different from the ECU's point of view from connecting an old-school DB9 RS232 cable while the engine is running.

Mudflap 02-12-2019 07:12 PM

What changes are happening in the ECU with car engine starter vs. ACC? I'm going to probe some voltages tonight to see if there is a supply issue. Also, is the computer supplying a 5V in addition to the ECU 5V? Some kind of ground loop? Do I we need some kind of regulator or diode?

Can someone else out there try this? I can't be the only one.

gooflophaze 02-12-2019 07:47 PM

Nothing aside from from alternator. Are you by chance using your laptop plugged into a wall outlet?

Also, try rerunning the experiment with the USB cable by itself. Wondering if there's an internal short on the cable.

Lokiel 02-12-2019 10:12 PM

Joe, I believe that the MS3 is an embedded device so from a programming perspective, you just have a main loop within which you handle EVERYTHING. If you're lucky you also have interrupt handling.

Attempting to set up communication with TunerStudio via USB or Serial I/O at start-up would be "the norm" so that should be thoroughly ironed out by now.

Attempting to establish communication while controlling the engine too is a different story if the initial "handshaking" takes too much time (eg. a function call takes a long time to respond/return or the implemented code has timing delays built into it for this - this would be bad programming practice). Serial communication has been around a long time and is very simple so it wouldn't surprise me if that's OK but USB communication is more complex.

Think about how long Windows or Linux takes to detect an inserted USB stick. They're REAL operating systems that can run high-end machines with multiple cores and hyperthreading, not simple embedded devices, and even they still take a while to detect them.

Joe Perez 02-12-2019 10:34 PM


Originally Posted by Lokiel (Post 1522608)
Joe, I believe that the MS3 is an embedded device so from a programming perspective, you just have a main loop within which you handle EVERYTHING.

In the base MS3 design, external I/O is all handled via RS-232, which is native to the CPU hardware (minus the physical UART, of course.)

Also:



Originally Posted by Lokiel (Post 1522608)
Think about how long Windows or Linux takes to detect an inserted USB stick. They're REAL operating systems that can run high-end machines with multiple cores and hyperthreading, not simple embedded devices, and even they still take a while to detect them.

Two differences here:

1: In the above example, the Windows / Linux machine is the host, whereas in the case of the MS3, the ECU is the guest. Reconsider your example from the point of view of the USB stick. They don't contain a lot of general-purpose CPU capacity.

2: Again, I go back to my earlier assumption that DIY is most likely using an ASIC to convert between USB (on the PC side) and RS-232 (on the MS side). If this is true, and I'd bet $1 that it is, this means that all of the heavy tasks of "participating in a USB connection" on the ECU side are being handled by hardware external to the MS3 CPU, and therefore, completely invisible to it.


Consider the following: Assume that I have a modern computer, running Win10-64, and I attach a USB - RS232 dongle to it. On the DB9 end of the dongle, I attach a 1980s vintage 9600 baud external modem.

In this scenario, do you believe that the modem is being tasked with performing any computational challenges greater than it was back when it was plugged into my '386?

No. The USB dongle takes care of that.

In this scenario, the chip which is translating between RS-232 (which the ECU CPU speaks naively) and USB (which has a high computational overhead) is taking care of all of the heavy stuff which isn't directly related to transmitting and receiving data.

Again, all of this is just speculation, since the heartless, kitten-killing bastards Bruce Bowling and Al Grippo, who control the Megasquirt intellectual property, changed their minds and decided that us peons outside the Holiest of Holies, are not worthy of seeing the schematics.

Lokiel 02-13-2019 12:07 AM

Agreed that we're just speculating what it MIGHT be and I don't really care as long as it "just works" when I have it already plugged in before starting the engine, I can live with it not being able to be dynamically plugged in and out with the engine running (would prefer it though).

sixshooter 02-13-2019 09:16 AM

I can plug a USB cable from my serial adapter on the reverent built ms3 basic into my laptop when both are already running without any issue resulting. I have no idea if that's helpful or not. Maybe since the serial adapter stays plugged into the ms3 it has already initiated communication at power up.

pyr0boy 02-13-2019 11:08 PM

While I have no where near as much experience in the programming side of this equation, my initial thought, which granted could be completely wrong, is that there is an error on the ground side of things, potentially an internal short.

The fact that it reverts to running well simple by removing the cable, with no interaction with tunerstudio indicates to me that it is a ground issue (maybe between the ground and shielding), regardless of whether or not its internal or external.

First suggest fix would be to try a different USB socket, second would be to ensure that no pin of the socket or cabling itself is touching a metal component.
A ground loop though the usb and something like the crank/cam sensor could in theory, atleast in my mind, result in enough decreased resolution to prevent acceptable running.

While its not visible in by pathetic images above.no part of my wiring or socket is anywhere near other metal objects.

I truly do not believe this is a software or ecu hardware issue, unless there is a short somewhere around the usb header.
I hope this provides somewhere for you to start looking.

Ted75zcar 02-13-2019 11:49 PM

There is a big difference between a true USB Host/device and a usb to uart serial bridge. "Real" usb almost always requires a transceiver. The USB in the MS is a UART bridge. It converts serial to usb. The VBUS line must be handled appropriately or you can get back drive issues that are bad mamma jamma.

gooflophaze 02-14-2019 12:02 AM

Looked at the pictures again - and hey, isn't that a FTDI 232RL right above the header?

Unpin/unplug the 5v. I have a theory - it's spamming the TX line (RX to MS) with garbage, probably keeping the mcu from doing it's loops properly. http://www.msextra.com/doc/pdf/Megas...2014-10-28.pdf has some details on the protocol. So it's programatical, not electrical - though why it's losing it's timing... bad decoupler cap on vbus, resetting the ftdi, garbage in 1 cylinder out?

Mudflap 02-14-2019 04:20 PM

After poking at it a couple more times, I've abandoned the idea. The entire reason I did this was because I wanted to use the OEM ecu bracket. But the bracket sits directly on top of the RS-232 port.

So I pulled all the USB business, machined a new bracket and am back to RS-232 setup.

Good luck guys!

BTW: who in their right mind would NOT use Tunerstudio with the engine running? If I was unable to tune realtime, I would not use this platform.

pyr0boy 02-14-2019 11:35 PM


Originally Posted by Mudflap (Post 1522965)
After poking at it a couple more times, I've abandoned the idea. The entire reason I did this was because I wanted to use the OEM ecu bracket. But the bracket sits directly on top of the RS-232 port.

So I pulled all the USB business, machined a new bracket and am back to RS-232 setup.

Good luck guys!

BTW: who in their right mind would NOT use Tunerstudio with the engine running? If I was unable to tune realtime, I would not use this platform.

Your right about not using tunerstudio and plug/unplug with engine on/running.
I do that rather often, mainly because I leave the laptop in the car, and if something doesn't feel right I plug it right in while running, and it works fine.
Something is definitely up with yours, honestly I wish you stuck with it because inquiring minds want to know, but understand the frustration that it caused, and your actions there after.

My main motivation wasn't like yours, I didn't like the chain of cables and adapters


All times are GMT -4. The time now is 02:59 PM.


© 2024 MH Sub I, LLC dba Internet Brands