Okay an update here... And thankfully my cable still works!!
I have been toying with port listening and a few bits and pieces trying to decipher the comms. to the controller from the USB cable.
The following has been established:
-Communication is 5v serial to the controller.
-There are 4 wires going from the USB connector to the controller - red, black, yellow and GREEN
-Method is hexadecimal, I can communicate with 9600bps, 8Data bits, No parity and 1 stop bit, no flow control but I am still not 100% if this is the correct throughput values.
-When connecting to the PI-200 software, it pulls TX to gnd, the controller then pulls the cruise control signal high - which feeds back to the USB connector. I think here if that input pin is HIGH it allows the programming, as this happens when the software reads 'connect success'
I'm still not 100% sure of the accurateness of the data, but I'm sure with a bit of practice I can work this out.
Example of connect string:
55 55 55 55 55 55 55 55 55 55 55 55 55 55 55
Disconnect string:
2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A
Get Config string
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
The attached text file was just some quick notes I made. Top part showing a note from a save file from the PI-200 software (read this with a HEX edit program) then the 'output to controller' part is from listening to a serial port monitor.
LOL also - did you know there is 2 LED's inside the USB connector housing, haha a RED one for power, and a amber one that shows ready status. They should have put a window in that thing!!
From what I can tell, the software sends the data in 3/4 lots
>Current, voltage & regen
>PAS on/off, PAS direction, Reverse on/off, Reverse Immediate/from stop
>Motor type (DC/BLDC) / PHASE, FWD speed, REV speed
>Lastly it looks be part of lot 3 but it seems to be power duty settings
TOM - if you read this can you please confirm how I would program the MagicPie with my own portable microcontroller ?
1. Do I first need to apply 5v to the controller, then bring TX to ground to enable programming?
2. Can you please confirm the baud rate and serial parameters?
3. Is it possible for you to provide an example here? --> Apply 5v to controller, use these settings to communicate, then send this string... ??
The reason I'm doing this is for many reasons, but I can build a graphic touch screen, basically a custom CA that will show everything a CA does but allow me to change settings (legal mode) etc. hehe
We can then make the Pie a snail at the touch of a screen or enable/disable various functions.
I personally want to adjust the current on the fly, so when a big hill approaches I can have a half second delay while the PIE reconfigures to POWER mode, then after the hill I can change back to limit the current etc so its smooth riding
Thoughts anyone? I'm close !!