Author Topic: Using Internal Programming lead on External Controller  (Read 11446 times)

Offline GrandadPete

  • New Member
  • *
  • Posts: 8
Using Internal Programming lead on External Controller
« on: November 08, 2010, 04:05:11 PM »
Hi
I've got the job of sorting out my son-in-law's twin pie, which has an internal front controller and now an external rear controller.
The rear controller used to be internal, but blew when he went off-road when the back wheel had not been tightened enough, - let that be a lesson, short the 5v red lead and the controller 'don't like it'.
Anyway he got a replacement external controller from Spacey, and I stripped the MP all down and converted it, I even made an extractor for the hub.
Both motors now work independently, but before linking them together, I want to check the parameters of both controllers.
The front is OK as I can use the internal USB cable.
I have the original multiway din plug from the old internal controller which I want to use as a flying connector on the external controller.
I have tried doing continuity tests on the programming lead, but of coarse this does not work as it probably has a built-in USB to RS232 converter.
Anyone know WHAT WIRES GO WHERE
Any help gratefully received as I want my garage back!!!

Offline MonkeyMagic

  • Cheeky Chimp
  • Technical Officer
  • PhD. Magic
  • ******
  • Posts: 1,041
Re: Using Internal Programming lead on External Controller
« Reply #1 on: November 08, 2010, 04:29:32 PM »
8-Pin DIN connector to MP wiring:

Haha I just did this last night !!!!

Red wire - 5v
Black wire - gnd
Yellow wire - tx
Green wire - (cruise) - I think is used for enable.

Here's a post with the connections plug to pie
http://goldenmotor.com/SMF/index.php?topic=2103.0

Go bananas.

And if you want to thank me, help me decipher the hexadecimal packets to and from the pie !!!

:D

Offline Bikemad

  • Global Moderator
  • Professor
  • PhD. Magic
  • ******
  • Posts: 5,510
Re: Using Internal Programming lead on External Controller
« Reply #2 on: November 08, 2010, 04:41:10 PM »

The external controllers appear to use four leads connected directly to:
+5V
Ground
Tx (not cruise)
Rx

This post might help you with the connections.

Alan
 


Offline MonkeyMagic

  • Cheeky Chimp
  • Technical Officer
  • PhD. Magic
  • ******
  • Posts: 1,041
Re: Using Internal Programming lead on External Controller
« Reply #3 on: November 08, 2010, 04:53:18 PM »
Hi yes maybe I did not phrase that correctly!! Gee you were quick to step in Alan hehe

On the controller, TX is not connected on any I have seen.

I say TX in the previous post - meaning the signal coming from the USB cable.

The newer MP boards with reverse enabled have a wire bridge across (d) and (rx) on the controller.

With power connected to the Pie, and no errors, by dropping (rx) to ground, connected to (d) enables reverse.
As you do not have power connected with the USB settings, (rx) is used for comms.

Some other posts I've read elsewhere is that its bi-directional coming from the (rx) pin only.

I can confirm this because I replaced my internal controller on the rear wheel, only connecting (rx) and leaving (d) alone as I don't need reverse. (tx) is not connected.

Anyway long story short if you want to connect the wires to the controller for a USB cable its:

YELLOW (rx)
GREEN (cruise)
Black (GND)
Red (5v)

I did it last night :D

I'm still not 100% if it transmits via the cruise control port - from what I've experienced it's a high low signal driven by the controller to feed to the USB-connector circuit to enable to 'listen' for data.

MM







Offline GrandadPete

  • New Member
  • *
  • Posts: 8
Re: Using Internal Programming lead on External Controller
« Reply #4 on: November 08, 2010, 09:45:29 PM »
HaHa - I think I may have sorted it.
Most of the above mention a green wire, but my lead had no green wire.
The wiring diagram for the Din socket mentions a grey wire on pin 7 but mine had a dark brown wire on pin 7.
So I got out the stanley knife and started hacking open the rubber cable connector that covers where the main power cables meet up with the data cables. - eureka - the dark brown wire is joined up to a green cable inside this block.
So, from the din socket
     Pin 1 is the yellow lead
     Pin 2 is the black lead
     Pin 6 is the red lead
     Pin 7 is the grey/dark brown = green lead
So I can now try out your suggestions

Thanks for All your Help - Pete

By the way - anyone know why a PI-0200E/I costs $33.00 when you can get a USB to RS232 cable for £1.49. including PP.


Offline GM Canada

  • Super Gary
  • Confirmed
  • PhD. Magic
  • ******
  • Posts: 1,544
Re: Using Internal Programming lead on External Controller
« Reply #5 on: November 08, 2010, 09:53:02 PM »

By the way - anyone know why a PI-0200E/I costs $33.00 when you can get a USB to RS232 cable for £1.49. including PP.



The PI-0200E/I have a circuit board in them.

Gary

Offline GrandadPete

  • New Member
  • *
  • Posts: 8
Re: Using Internal Programming lead on External Controller
« Reply #6 on: November 08, 2010, 09:59:51 PM »
So has the USB to RS232 cable.

It seems to do the same job

Pete

Offline GM Canada

  • Super Gary
  • Confirmed
  • PhD. Magic
  • ******
  • Posts: 1,544
Re: Using Internal Programming lead on External Controller
« Reply #7 on: November 08, 2010, 10:10:46 PM »
You have tried this with success?

Gary
« Last Edit: November 08, 2010, 10:15:13 PM by GM Canada »

Offline Bikemad

  • Global Moderator
  • Professor
  • PhD. Magic
  • ******
  • Posts: 5,510
Re: Using Internal Programming lead on External Controller
« Reply #8 on: November 09, 2010, 03:09:04 AM »

I know the quality is pretty poor, but I think the attached picture may help identify the connections.

Alan
 

Offline MonkeyMagic

  • Cheeky Chimp
  • Technical Officer
  • PhD. Magic
  • ******
  • Posts: 1,041
Re: Using Internal Programming lead on External Controller
« Reply #9 on: November 09, 2010, 03:54:37 AM »
So we are confirming that a RS232 to USB cable works??
How does it know what COM port to use?? I thought the PI-200 autoassigned??

I don't there there are any comms on green only high and low enable signal??

I'm curious now !! lol


Offline Magzy

  • Confirmed
  • Bachelor of Magic
  • ****
  • Posts: 107
Re: Using Internal Programming lead on External Controller
« Reply #10 on: November 09, 2010, 05:40:38 AM »
Once you get the "USB to the serial converter" for $2 you still need to wire in the Controller harness.

Get an old female lead going out of the adapter end of the cable and then strip it bare so you can see the wires

Serial port -


Pins Numbers and Pin meanings



I'd say this will work but the mention of com ports (on the controller??) bothers me.

Only one way to find out - and there's minimal wires to connect...
« Last Edit: November 09, 2010, 05:44:34 AM by Magzy »

Offline Magzy

  • Confirmed
  • Bachelor of Magic
  • ****
  • Posts: 107

Offline GrandadPete

  • New Member
  • *
  • Posts: 8
Re: Using Internal Programming lead on External Controller
« Reply #12 on: November 09, 2010, 09:30:39 AM »
Wow - I seem to have stirred up a hornets nest here?
All I said was 'it seems to do the same thing'
Namely taking a USB signal and converting to a serial 5 volt (rs232) signal with a baud rate and no handshaking.
I did not say that I had got it working.

Consider me suitably humbled but if I had programmed the controller chip I would have made it standard rs232 comms, (which it probably has built in anyway)

Pete

Offline GM Canada

  • Super Gary
  • Confirmed
  • PhD. Magic
  • ******
  • Posts: 1,544
Re: Using Internal Programming lead on External Controller
« Reply #13 on: November 09, 2010, 11:23:01 AM »
Wow - I seem to have stirred up a hornets nest here?
All I said was 'it seems to do the same thing'
Namely taking a USB signal and converting to a serial 5 volt (rs232) signal with a baud rate and no handshaking.
I did not say that I had got it working.

Consider me suitably humbled but if I had programmed the controller chip I would have made it standard rs232 comms, (which it probably has built in anyway)

Pete

I don't know about a hornets nest, but certainly curiousity. I was told when they came out a standard cable would not work. But if it does we certainly would all like to know.

Gary

Offline MonkeyMagic

  • Cheeky Chimp
  • Technical Officer
  • PhD. Magic
  • ******
  • Posts: 1,041
Re: Using Internal Programming lead on External Controller
« Reply #14 on: November 09, 2010, 02:17:12 PM »
My experience tapping the cable -->

I have a rs232 module that can convert 5v TTL to 3v TTL vice versa, and 12v TTL reduction vice versa and has a USB output I can port the data to.

So I port the data to a serial connection, and receive the packets.

Nothing ever that I can grab comes out of green, in fact it stops the USB connector when I put in-line with my module. Yellow does not do this. I could be wrong but my thoughts it ran in full-duplex mode.

So this is what I experienced:

1. Connect yellow wire from the PI-200 cable to RX of my module, parallel with the 8-pin connector
2. Open serial com port to listen (currently nothing on TX)
3. Start PI-200 software
4. Clicking connect sends a hexadecimal string to the controller (connect string)
5. GREEN goes HIGH - 5v - I believe this tells the USB-connector ready for data (no packets sent)
6. Software reads 'Connect Success'
7. Save settings will send the command string to the controller. As long as GREEN is high, it will send.
8. Disconnect sends a hexadecimal string to the controller
9. GREEN goes low....

So with the above, I've already disconnected everything but I can nearly guess if I connect a diode forward facing to the USB connector GREEN wire - passed from 5v red the PI-200 software will read 'connect success'. I'll test this.

I'll try this and it will confirm that GREEN does not send any strings.
Where is TOM haha

Anyway - there is a possibility of using a rs232 cable direct to the wheel but I will have to write some software to send the correct commands. (connect first, then apply changes, disconnect)

I'm still trying to get how it reads the settings from the wheel because I can't see the return string anywhere. Only the 'get config' command string. So I guess I have still have some toying to do.

This is an interesting topic, on closer inspection of the USB circuit - it has 2 transistors which I am near certain up the voltage from 3v TTL to 5v TTL to read from the wheel. So I will get back to testing what happens with green wire!!

I'm really glad others are interested in this too, hopefully we can come up with something awesome

MM