Arduino based PIM

Ecu Hardware Modifications
megajuz3003
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
cars: 2001 VU SS
Location: Brisbane

Re: Arduino based PIM

Post by megajuz3003 »

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
pman92
Posts: 464
Joined: Thu May 03, 2012 10:50 pm
cars: HZ One Tonner
VE Ute
Location: Castlemaine, Vic

Re: Arduino based PIM

Post by pman92 »

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: View Post
MrModule.com.au
pman92
Posts: 464
Joined: Thu May 03, 2012 10:50 pm
cars: HZ One Tonner
VE Ute
Location: Castlemaine, Vic

Re: Arduino based PIM

Post by pman92 »

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: View Post
MrModule.com.au
megajuz3003
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
cars: 2001 VU SS
Location: Brisbane

Re: Arduino based PIM

Post by megajuz3003 »

pman92 wrote: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)
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 6725 times
megajuz3003
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
cars: 2001 VU SS
Location: Brisbane

Re: Arduino based PIM

Post by megajuz3003 »

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
megajuz3003
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
cars: 2001 VU SS
Location: Brisbane

Re: Arduino based PIM

Post by megajuz3003 »

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
pman92
Posts: 464
Joined: Thu May 03, 2012 10:50 pm
cars: HZ One Tonner
VE Ute
Location: Castlemaine, Vic

Re: Arduino based PIM

Post by pman92 »

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: View Post
MrModule.com.au
megajuz3003
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
cars: 2001 VU SS
Location: Brisbane

Re: Arduino based PIM

Post by megajuz3003 »

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
Tazzi
Posts: 3422
Joined: Thu May 17, 2012 8:53 pm
cars: VE SS Ute
Location: WA
Contact:

Re: Arduino based PIM

Post by Tazzi »

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.
Your Local Aussie Reverse Engineer
Contact for Software/Hardware development and Reverse Engineering
Site:https://www.envyouscustoms.com
Mob:+61406 140 726
Image
megajuz3003
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
cars: 2001 VU SS
Location: Brisbane

Re: Arduino based PIM

Post by megajuz3003 »

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:
Post Reply