Arduino based PIM

Ecu Hardware Modifications
Posts: 67
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: Arduino based PIM

Postby megajuz3003 » Wed Apr 24, 2019 8:43 am

pman92 wrote:I'll post up a copy of the 2/3 transistor circuit I used to interface ALDL to the UART RX/TX lines. I have found it work's good and is probably better than joining them directly for various reasons.

If you want a smaller physical mega2560, look into a mega2560 pro embedded.
They are like a mini Arduino Mega.
Like $10 on aliexpress



Thanks man, the pro embedded looks like a nice bit of kit, hopefully I can find one that runs something other than the CH340G Uart-USB my laptop outright refuses to talk to them :lol:.. I have half a dozen arduinos here and the only 2 it will talk to are the ones with FTDI chips (my Genuine UNO and MEGA) the desktop doesn't care what chip it is, it will talk just fine :comp:

I would love you input on the transistor version of converting the ALDL to Serial.. with the 8192 I always used the MAX232 way of doing it. works well but components are getting expensive and Genuine MAX232s aren't cheap, last time I made a transistor circuit was for the 160baud ALDL in my old VN :punk:


The Engine/ECU are from FG so whats that 08 + I think

Posts: 317
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: Arduino based PIM

Postby pman92 » Wed Apr 24, 2019 10:38 am

https://electronics.stackexchange.com/q ... low-enough

Here's the circuit I'm using, with the diode and 47k resistor added as described in one of the answers (so that a logic low is recognised, I had the same problem with it not recognising it without the diode to drop the voltage that extra 0.6v).

There was a big blog post somewhere that that circuit came from but I can't find it now.

You can remove one of the transistors and LED if you don't want the LED activity Indicator light (I don't have them in my BCM simulator)
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 317
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: Arduino based PIM

Postby pman92 » Wed Apr 24, 2019 10:42 am

Might have trouble finding one without the 340G chip.

You can get a version without any USB at all, and use an external USB to UART board (That has FTDI or another chip) connected to pins 0 and 1
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 67
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: Arduino based PIM

Postby megajuz3003 » Wed Apr 24, 2019 12:16 pm

pman92 wrote:https://electronics.stackexchange.com/questions/135745/logic-low-not-low-enough

Here's the circuit I'm using, with the diode and 47k resistor added as described in one of the answers (so that a logic low is recognised, I had the same problem with it not recognising it without the diode to drop the voltage that extra 0.6v).

There was a big blog post somewhere that that circuit came from but I can't find it now.

You can remove one of the transistors and LED if you don't want the LED activity Indicator light (I don't have them in my BCM simulator)


ive seen a lot of examples similar to that, must be a popular style..

this is the circuit I was using before I moved to a dedicated FT230X circuit and I never had an issue with it.. at least for the time being I might make one up with this, only because I have 50 odd knock off MAX232 chips around here :lol:
aldlintfmax.gif
aldlintfmax.gif (21.75 KiB) Viewed 243 times

Posts: 67
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: Arduino based PIM

Postby megajuz3003 » Wed Apr 24, 2019 12:20 pm

pman92 wrote:Might have trouble finding one without the 340G chip.

You can get a version without any USB at all, and use an external USB to UART board (That has FTDI or another chip) connected to pins 0 and 1


I was thinking that, everything I saw used the 340G.. might just have to add a FTDI chip or use one of the many USB to RS232 adapters I have floating around here lol.. have heaps of them for work lol

Posts: 67
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: Arduino based PIM

Postby megajuz3003 » Thu Apr 25, 2019 12:58 pm

Just looking through what I've got here in all the tuner pro ADX files to see if there anything I'm missing,

with BitMasks where is has operand 0x70 and result 0x10 what happens here, I know its probably a stupid question but I've always seen them as the same value so its never been an issue working out BitMasks

Posts: 317
Joined: Thu May 03, 2012 10:50 pm
Location: Castlemaine, Vic

Re: Arduino based PIM

Postby pman92 » Fri Apr 26, 2019 8:56 am

Byte is 8 bits, eg. 1010 1010

0x70 = 0111 0000
0x10 = 0001 0000

I thought bitmasks were a bitwise and between the byte and the operand, looking for the result.

It should be the same as the operand being 0x10
VR-VY Holden BCM Simulator: LINK
Ford Smartlock Bypass Module: LINK

Posts: 67
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: Arduino based PIM

Postby megajuz3003 » Fri Apr 26, 2019 10:34 am

pman92 wrote:Byte is 8 bits, eg. 1010 1010

0x70 = 0111 0000
0x10 = 0001 0000

I thought bitmasks were a bitwise and between the byte and the operand, looking for the result.

It should be the same as the operand being 0x10



To check bit bitmasks elsewhere I’ve been using

Byte AND Int <>0 , where Int = operand

If that returns true then I set the parameter I’m checking as the true result, everywhere I’ve used it it works and gives me the same results as Tuner pro. But in this case I’m not sure what to do... it’s for the
gear selector, every position has the operand the same and a different value for the result

User avatar
Posts: 1811
Joined: Thu May 17, 2012 8:53 pm
Location: WA

Re: Arduino based PIM

Postby Tazzi » Fri Apr 26, 2019 11:04 am

I posted up a diagram and ALDL coding example for the M2 forums a while ago. Transistor circuit is similar to what has been described by pman except simplified.

Ill grab a screen shot shortly.

Only issue with the ELM is trying to capture broadcast information on the VPW/CAN line as its designed for 'send one/receive one' scenarios. Using the ELM to send the commands should be ok, so long as your happy to deal with switching headers ect of each different message, which should be ok. Just make sure not to use 'Strings' in your coding... its seems appealing but is a massive resource drain and is extremely slow for processing.

When doing gears, usually youll have something along the lines of:
0 = park
10= Neutral
20 = Drive
30 = Reverse
ect

Setup a mask to check for specific combinations of bits are enabled and then go from there.

if (IsBitSet(MyByte,4) && IsBitSet(Mybyte,5)){ //drift mode engaged}

I think it was the E38's, not sure if it was on the HSCAN line though, but bit 7 was used to indicate sport mode (Maybe..). Been a while since having to look at it. That could have been the GMLAN side.
Image

Posts: 67
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: Arduino based PIM

Postby megajuz3003 » Fri Apr 26, 2019 12:03 pm

Tazzi wrote:Only issue with the ELM is trying to capture broadcast information on the VPW/CAN line as its designed for 'send one/receive one' scenarios. Using the ELM to send the commands should be ok, so long as your happy to deal with switching headers ect of each different message, which should be ok. Just make sure not to use 'Strings' in your coding... its seems appealing but is a massive resource drain and is extremely slow for processing.


At the moment I’m still wrapping my head around that side of things :lol: started working out what pids I need to query, a couple look like they are manufacturer specific so I might have to work out a way to select between gm/ford and generic on start up

Tazzi wrote:When doing gears, usually youll have something along the lines of:
0 = park
10= Neutral
20 = Drive
30 = Reverse
ect

Setup a mask to check for specific combinations of bits are enabled and then go from there.

if (IsBitSet(MyByte,4) && IsBitSet(Mybyte,5)){ //drift mode engaged}

I think it was the E38's, not sure if it was on the HSCAN line though, but bit 7 was used to indicate sport mode (Maybe..). Been a while since having to look at it. That could have been the GMLAN side.


So essentially I’m checking both the operand and result to see if they are both set?.. once I’m sure I know how to read it then becomes the issue of trying to generate that byte :wtf:

PreviousNext

Return to Hardware Modification and Development

Who is online

Users browsing this forum: No registered users and 1 guest