PICAXE USB Recorder

alband

Senior Member
Hi, I new so pls tell me any uwriten rules of this place :)

Here the poroble,
I want to record the data coming from my USB hub when a device is connected using a PICAXE. As my understanding goes, USB uses only 12MHz and the PICAXE08M can handle 16MHz. Is it possible to set any PICAXE's to 12MHz and can anyone think up a program to record data at this rate?

One other thought is that the memory of even the best PICAXE's mighn't cope with the amount of data. Does anyone know if it is possible to interface a PICAXE with an external memory chip?

BTW, if anyone is interested in a cool PICAXE/Visual Basic6 project, I've managed after a while to interface an 08M with my PC so that two variable resistors control the cursor. Private mail me and I'll send you the various codes.

Thanks in advance (and sorry this is a bit long),
David
 

ylp88

Senior Member
Hi there!

Judging by what you want to try and accomplish, I might dare to ask how much experience you have with PICAXE. Basically, there is no way that a PICAXE chip would be able to handle the signalling rate of USB data. Even at 16MHz, the internal clock frequency of the chip is only 4MHz (most PIC chips divide the oscillator frequency by 4 to drive the CPU) which further limits the system. Performance is further made slower due to the overheads the PICAXE platform introduces. I doubt that any plain PICmicro could manually pick-up the bitstream and record them in a suitable fashion for further inspection - some PICmicros so have embedded USB functionality, however...

Memory is a completely different issue - *IF* the PICAXE somehow managed to capture the dataflow, I doubt that the PICAXE would have sufficient memory to even capture the header/packet control information before running out of storage space, let alone trying to record any of the actual data. Adding external memory (which is not usually feasible using an 08M, but is possible using larger chips like the 18/28/40 chips) will slow things down even more, which as already discussed is big enough of a problem already!

Interestingly, what are you trying to pursue by recording the USB datastream?

ylp88
 
Last edited:

demonicpicaxeguy

Senior Member
somehow i doubt even the quickest a biggest picaxe could do this, however there are options and many of them, out of mere curiosity why on earth would you want to capture the raw datastream? what is the application exactly
 

Texy

Senior Member
Hi, I new so pls tell me any uwriten rules of this place :)

BTW, if anyone is interested in a cool PICAXE/Visual Basic6 project, I've managed after a while to interface an 08M with my PC so that two variable resistors control the cursor. Private mail me and I'll send you the various codes.

Thanks in advance (and sorry this is a bit long),
David
Not sure if this is an unwritten law, but my personal opinion.....
Why have private emails when you have some code to share - why not post it here for all to see?
Welcome to the forum:)

Texy
 

Andrew Cowan

Senior Member
About the code controling the mousee...

Either post it in completed projects, or if you don't want to, please send it to me :).

Thanks,

Andrew
 

alband

Senior Member
I'll post mouse instruction asap in different thred ("PICAXE mouse interface" or something)

I was expecting these types of answer, it was just a mear hope.

ciseco; wat's a key logger, sounds useful.
 

alband

Senior Member
I've posted the mouse thing - it's long!

Back to subject. Cant one buy special devices to record serial data?:confused:

I have reasons to be secrative about the aplication :cool:, but basicaly I wan't to interface a PIC and a device. I don't know the divices protocol. I can't find out the devices protocol. The device connects to the PC via a USB cable and while it is connected, the data I want is sent from the PC to the device. Therefore I want to be able to capture and analyse this datastream.

Thanks,
David.
 

hippy

Technical Support
Staff member
II have reasons to be secrative about the aplication :cool:, but basicaly I wan't to interface a PIC and a device. I don't know the divices protocol. I can't find out the devices protocol. The device connects to the PC via a USB cable and while it is connected, the data I want is sent from the PC to the device. Therefore I want to be able to capture and analyse this datastream.
Your best bet is to track down a USB data packet 'sniffer' which runs on the PC itself. I used one a while ago but cannot remember its name, Google will help. This was free but has a limited capture buffer. It was enough to indicate what was going wrong with a particular USB connection but USB is so fast and sends so much data I wouldn't want to try and determine a protocol from that and I wouldn't be confident you could anyway.

If you've got a PICmicro then I assume you're using the Microchip USB stack or similar so you should be able to capture the USB packets with that.
 

alband

Senior Member
BeanieBots - that didn't work but it showed one type of solution in using software rather than hardware, and after running some searches on similar packages I found some other similar software called "Device Monitoring Studio" it works but has unfortunately proved that the nature of the device I'm trying to hack is complicated making the hack near impossible.
Thanks for the help though everyone, much appreciated.
David.
 

demonicpicaxeguy

Senior Member
BeanieBots - that didn't work but it showed one type of solution in using software rather than hardware, and after running some searches on similar packages I found some other similar software called "Device Monitoring Studio" it works but has unfortunately proved that the nature of the device I'm trying to hack is complicated making the hack near impossible.
Thanks for the help though everyone, much appreciated.
David.
never say impossible.... whats the device?
 

demonicpicaxeguy

Senior Member
an ipod..... not exactly a great problem i think from memmory they come up as a "mass storage device" , it's a bit of a long shot but you might be able to use the "i drive" thingy with it instead of a usb stick, the question is what do you want to do with it, can you post some of the stream you captured?
 

hippy

Technical Support
Staff member
Technical I'm sure posted some code to communicate with an iPod. That used serial rather than USB, but there's no easy way to control a USB Slave device from a PICAXE anyway.
 

alband

Senior Member
Code 1

Ok, trying not to spread the word here but,
I want to put the iPod into charge mode and charge it with a PICAXE.
An iPod will charge from a PC via USB so; it uses 5v as does a PICAXE. The USB plug has two serial pins, as I understand one clock one data. I've tried just connecting 5v across the appropriate pins but that didn't work so the iPod needs to be "tolled" to charge. That serial transfer to an iPod thing sounds good hippy, I'll look for it but if you can find it and post a link that would be great.
As for posting my findings; I can but I think what I found will make as much sense to you as it did me. I'm using "Device monitoring wizard" for Vista, and this is what "URB view" gave me when I plugged it in. The fist 6 digits in each section is the packet number. This starts a 000260 because it had to start monitoring when the iPod was plugged in and I then had to disconnect and reconnect it. The "PnP Event" means I've either connected it or disconnected it. The next part is the packet name, I think. Then in which direction the packet went (not sure which is up and which is down). Then the date and very exact time. Then a description of the packet. I've encluded the "interesting" packets - just after plugging it in. It then repeats the end packets over and over.
Don't bother reading it unless you have lots of time.
Thanks,
David.
Ah... just tried to post it but it is over the maximum limmit so I'll put it in two messages.

000260: PnP Event: Device Connected (UP), 14.09.2008 22:32:44.368 +22.422
The USB device has just been connected to the system.
000261: Control Transfer (DOWN), 14.09.2008 22:32:44.369 +0.001
Pipe Handle: 0x0

41 00 32 00 43 00 23 00 7B 00 61 00 36 00 37 00 A.2.C.#.{.a.6.7.
38 00 8.
Setup Packet
000262: Control Transfer (UP), 14.09.2008 22:32:44.370 +0.001. Status: 0x00000000
Pipe Handle: 0x8526fad4

12 01 00 02 00 00 00 40 AC 05 62 12 01 00 01 02 .......@¬.b.....
03 02 ..
Setup Packet
000263: Control Transfer (DOWN), 14.09.2008 22:32:44.370 +0.0
Pipe Handle: 0x0

12 01 00 02 00 00 00 40 AC 05 62 12 01 00 01 02 .......@¬.b.....
03 02 32 00 62 00 63 00 65 00 2D 00 34 00 33 00 ..2.b.c.e.-.4.3.
37 00 36 00 2D 00 34 00 64 00 65 00 32 00 2D 00 7.6.-.4.d.e.2.-.
38 00 30 00 39 00 36 00 2D 00 37 00 30 00 61 00 8.0.9.6.-.7.0.a.
61 00 39 00 65 00 38 00 66 00 65 00 64 00 31 00 a.9.e.8.f.e.d.1.
39 00 7D 00 00 00 00 00 00 00 00 00 00 00 00 00 9.}.............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 ...
Setup Packet
000264: Control Transfer (UP), 14.09.2008 22:32:44.370 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

22 03 30 00 30 00 30 00 41 00 32 00 37 00 30 00 ".0.0.0.A.2.7.0.
30 00 31 00 41 00 33 00 37 00 39 00 41 00 32 00 0.1.A.3.7.9.A.2.
43 00 C.
Setup Packet

000265: Control Transfer (DOWN), 14.09.2008 22:32:44.370 +0.0
Pipe Handle: 0x0

22 03 30 00 30 00 30 00 41 00 32 00 37 00 30 00 ".0.0.0.A.2.7.0.
30 00 31 00 41 00 33 00 37 00 39 00 41 00 32 00 0.1.A.3.7.9.A.2.
43 00 36 00 2D 00 34 00 64 00 65 00 32 00 2D 00 C.6.-.4.d.e.2.-.
38 00 30 00 39 00 36 00 2D 00 37 00 30 00 61 00 8.0.9.6.-.7.0.a.

Setup Packet

000266: Control Transfer (UP), 14.09.2008 22:32:44.370 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

09 02 20 00 01 01 00 C0 FA 09 04 00 00 02 08 06 .. ....Àú.......
50 00 07 05 83 02 00 02 00 07 05 02 02 00 02 00 P...ƒ...........

Setup Packet

000267: Control Transfer (DOWN), 14.09.2008 22:32:44.370 +0.0
Pipe Handle: 0x0

09 02 20 00 01 01 00 C0 FA 09 04 00 00 02 08 06 .. ....Àú.......
50 00 07 05 83 02 00 02 00 07 05 02 02 00 02 00 P...ƒ...........
43 00 36 00 2D 00 34 00 64 00 65 00 32 00 2D 00 C.6.-.4.d.e.2.-.
38 00 30 00 39 00 36 00 2D 00 37 00 30 00 61 00 8.0.9.6.-.7.0.a.

Setup Packet

000268: Control Transfer (UP), 14.09.2008 22:32:44.370 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

09 02 95 00 03 02 04 C0 FA 09 04 00 00 00 01 01 ..•....Àú.......
00 00 09 24 01 00 01 1E 00 01 01 0C 24 02 01 01 ...$........$...
02 02 02 03 00 00 00 09 24 03 02 01 01 01 01 00 ........$.......
09 04 01 00 00 01 02 00 00 09 04 01 01 01 01 02 ................

Setup Packet

000269: Control Transfer (DOWN), 14.09.2008 22:32:44.370 +0.0
Pipe Handle: 0x0

09 02 95 00 03 02 04 C0 FA 09 04 00 00 00 01 01 ..•....Àú.......
00 00 09 24 01 00 01 1E 00 01 01 0C 24 02 01 01 ...$........$...
02 02 02 03 00 00 00 09 24 03 02 01 01 01 01 00 ........$.......
09 04 01 00 00 01 02 00 00 09 04 01 01 01 01 02 ................
61 00 39 00 65 00 38 00 66 00 65 00 64 00 31 00 a.9.e.8.f.e.d.1.
39 00 7D 00 00 00 00 00 00 00 00 00 00 00 00 00 9.}.............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 .....
Setup Packet

000270: Control Transfer (UP), 14.09.2008 22:32:44.371 +0.001. Status: 0x00000000
Pipe Handle: 0x8526fad4

09 02 95 00 03 02 04 C0 FA 09 04 00 00 00 01 01 ..•....Àú.......
00 00 09 24 01 00 01 1E 00 01 01 0C 24 02 01 01 ...$........$...
02 02 02 03 00 00 00 09 24 03 02 01 01 01 01 00 ........$.......
09 04 01 00 00 01 02 00 00 09 04 01 01 01 01 02 ................
00 00 07 24 01 02 01 01 00 23 24 02 01 02 02 10 ...$.....#$.....
09 40 1F 00 11 2B 00 E0 2E 00 80 3E 00 22 56 00 .@...+.à..€>."V.
C0 5D 00 00 7D 00 44 AC 00 80 BB 00 09 05 81 01 À]..}.D¬.€»....
C0 00 04 00 00 07 25 01 01 00 00 00 09 04 02 00 À.....%.........
01 03 00 00 00 09 21 01 01 00 01 22 D0 00 07 05 ......!...."Ð...
83 03 40 00 01 ƒ.@..
Setup Packet

000271: Control Transfer (DOWN), 14.09.2008 22:32:44.371 +0.0
Pipe Handle: 0x0

09 02 95 00 03 02 04 C0 FA 09 04 00 00 00 01 01 ..•....Àú.......
00 00 09 24 01 00 01 1E 00 01 01 0C 24 02 01 01 ...$........$...
02 02 02 03 00 00 00 09 24 03 02 01 01 01 01 00 ........$.......
09 04 01 00 00 01 02 00 00 09 04 01 01 01 01 02 ................

Setup Packet

000272: Control Transfer (UP), 14.09.2008 22:32:44.371 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

09 02 20 00 01 01 00 C0 FA 09 04 00 00 02 08 06 .. ....Àú.......
50 00 07 05 83 02 00 02 00 07 05 02 02 00 02 00 P...ƒ...........

Setup Packet

000273: Select Configuration (DOWN), 14.09.2008 22:32:44.371 +0.0
Configuration Index: 1

000275: Select Configuration (UP), 14.09.2008 22:32:44.397 +0.0. Status: 0x00000000
Configuration Index: 1
Configuration Handle: 0x863f32c8
000276: PnP Event: Query Device Text (UP), 14.09.2008 22:32:44.398 +0.001
Description: iPod

000277: PnP Event: Query Device Text (UP), 14.09.2008 22:32:44.398 +0.0
Location: Port_#0003.Hub_#0008

000278: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.400 +0.002
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000279: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.400 +0.0. Status: 0x00000000
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000280: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.400 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x20 bytes from the device

000281: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.401 +0.001. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x20 bytes from the device

000282: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.401 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x20 bytes from the device

000283: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.401 +0.0. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0xd bytes from the device
 

alband

Senior Member
Code 2

000284: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.401 +0.0
Descriptor Type: Device
Descriptor Index: 0x0
Transfer Buffer Size: 0x12 bytes


000285: Control Transfer (UP), 14.09.2008 22:32:44.401 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

12 01 00 02 00 00 00 40 AC 05 62 12 01 00 01 02 .......@¬.b.....
03 02 ..
Setup Packet

000286: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.401 +0.0
Descriptor Type: Configuration
Descriptor Index: 0x0
Transfer Buffer Size: 0x9 bytes


000287: Control Transfer (UP), 14.09.2008 22:32:44.401 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

09 02 20 00 01 01 00 C0 FA .. ....Àú
Setup Packet

000288: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.401 +0.0
Descriptor Type: Configuration
Descriptor Index: 0x0
Transfer Buffer Size: 0x20 bytes


000289: Control Transfer (UP), 14.09.2008 22:32:44.402 +0.001. Status: 0x00000000
Pipe Handle: 0x8526fad4

09 02 20 00 01 01 00 C0 FA 09 04 00 00 02 08 06 .. ....Àú.......
50 00 07 05 83 02 00 02 00 07 05 02 02 00 02 00 P...ƒ...........

Setup Packet

000290: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.402 +0.0
Descriptor Type: String
Descriptor Index: 0x0
Transfer Buffer Size: 0x2 bytes
LanguageId: 0x0

000291: Control Transfer (UP), 14.09.2008 22:32:44.402 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

04 03 ..
Setup Packet

000292: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.402 +0.0
Descriptor Type: String
Descriptor Index: 0x0
Transfer Buffer Size: 0x4 bytes
LanguageId: 0x0

000293: Control Transfer (UP), 14.09.2008 22:32:44.402 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

04 03 09 04 ....
Setup Packet

000294: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.402 +0.0
Descriptor Type: String
Descriptor Index: 0x3
Transfer Buffer Size: 0x2 bytes
LanguageId: 0x409

000295: Control Transfer (UP), 14.09.2008 22:32:44.402 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

22 03 ".
Setup Packet

000296: Get Descriptor Request (DOWN), 14.09.2008 22:32:44.402 +0.0
Descriptor Type: String
Descriptor Index: 0x3
Transfer Buffer Size: 0x22 bytes
LanguageId: 0x409

000297: Control Transfer (UP), 14.09.2008 22:32:44.403 +0.001. Status: 0x00000000
Pipe Handle: 0x8526fad4

22 03 30 00 30 00 30 00 41 00 32 00 37 00 30 00 ".0.0.0.A.2.7.0.
30 00 31 00 41 00 33 00 37 00 39 00 41 00 32 00 0.1.A.3.7.9.A.2.
43 00 C.
Setup Packet

000298: Class-Specific Request (DOWN), 14.09.2008 22:32:44.403 +0.0
Destination: Interface, Index 0
Reserved Bits: 0
Request: 0xfe
Value: 0x0
Get 0x1 bytes from the device

000299: Control Transfer (UP), 14.09.2008 22:32:44.403 +0.0. Status: 0x00000000
Pipe Handle: 0x8526fad4

00 .
Setup Packet

000300: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.403 +0.0
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000301: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.403 +0.0. Status: 0x00000000
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000302: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.403 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x24 bytes from the device

000303: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.431 +0.028. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x24 bytes from the device

000304: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.431 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x200 bytes from the device

000305: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.431 +0.0. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0xd bytes from the device

000306: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.431 +0.0
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000307: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.431 +0.0. Status: 0x00000000
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000308: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.431 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0xfc bytes from the device

000309: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.432 +0.001. Status: 0xc0000004
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x0 bytes from the device

000310: Reset Pipe (DOWN), 14.09.2008 22:32:44.432 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)


000311: Reset Pipe (UP), 14.09.2008 22:32:44.432 +0.0. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)


000312: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.432 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x200 bytes from the device

000313: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.432 +0.0. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0xd bytes from the device

000314: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.432 +0.0
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000315: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.432 +0.0. Status: 0x00000000
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device

000316: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.432 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x12 bytes from the device

000317: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.432 +0.0. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x12 bytes from the device

000318: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.432 +0.0
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0x200 bytes from the device

000319: Bulk or Interrupt Transfer (UP), 14.09.2008 22:32:44.433 +0.001. Status: 0x00000000
Pipe Handle: 0x85d93184 (Endpoint Address: 0x83)
Get 0xd bytes from the device

000320: Bulk or Interrupt Transfer (DOWN), 14.09.2008 22:32:44.433 +0.0
Pipe Handle: 0x85d931a4 (Endpoint Address: 0x2)
Send 0x1f bytes to the device
 

benryves

Senior Member
The Vinculum USB modules (VDRIVE and VMUSIC) allow you to communicate with USB slaves over a serial connection (the firmware will handle some devices, eg FAT-formatted mass storage devices and printers, for you automatically). They appear to support some low-level USB communication, so could be worth looking into (try the firmware documentation for some indication of what they are cabable of).
 

alband

Senior Member
Hi,
The VDrive looks good. Not sure exactly what it does though. Would I for example communicate to it through a PICAXE and it would understand the PICAXE and communicate to the iPod in the iPod's language?
Thanks
David
 

demonicpicaxeguy

Senior Member
Ok, trying not to spread the word here but,
I want to put the iPod into charge mode and charge it with a PICAXE.
An iPod will charge from a PC via USB so; it uses 5v as does a PICAXE. The USB plug has two serial pins, as I understand one clock one data. I've tried just connecting 5v across the appropriate pins but that didn't work so the iPod needs to be "tolled" to charge.
the ipod as far as i know operates as a "mass storage device" so i doubt and can say with some confidence that the ipod doesn't require an special instructions to tell it to go into charge mode over the elaborate usb protocol,

after a quick search and quick drink.........

here's the pinouts http://pinouts.ru/PortableDevices/ipod_pinout.shtml
it indicates to get the ipod to charge off the usb port you have to have the following on the ipods usb port:

d- must be pulled to 5v via a 10k resistor
d+ must be pulled down to gnd via a 10k resistor
usb 5v pretty obvious via a 5v regulator eg 7805
usb gnd again obvious

good luck and don't let the magic smoke out
 

alband

Senior Member
I'm not keen on trying stuff cause I don't want to break the iPod, plus I doubt it's protocol is that simple. Apple take great care on making the iPods as un-hackable as possible.
I also know that the set-up described in the pin 27 section doesn't charge it as I tried it.
Just need to capture that bit stream and understand it.
Thanks
 

hippy

Technical Support
Staff member
Just need to capture that bit stream and understand it.
Plus you'll then need to replicate it to make the iPod do what you want.

That's not going to be easy without some extra hardware to interface a PICAXE to the iPod as you're talking about an entire USB enumeration process plus all the keep-alive acknowledgements that go backwards and forwards frequently. USB is far more complicated than simple serial. It's a lot more than 'a bit stream'.

Consider this -

* The iPod can be charged by a mains powered plug-in PSU
* It's extremely unlikely that PSU is doing USB comms
* There must be a simple means to switch iPod to charging without USB

There are examples out there of people charging iPods from non-USB sources, simple 'emergency chargers' for $2 which claim to charge iPod, so it seems possible without all this messing about with USB capture. Have you scoured Google ?
 

alband

Senior Member
Well... I've just doen some testing and found out some crucal info. WHat I've been looking for is that little lightning bolt that measn th iPod is charging. Now normally I charge my Ipod overnight in a dock. The dock is powered by an american mains charger with a UK adapter. When the iPod is in the dock the lightningbolt appears and it charges and I assumed this was the case when I plugged it straight into the charger - no dock... Oh no! When plugged straight into the chrger the ipod comes on but the lightnig bolt isn't there. I think is is charging but can't be sure. I'm going to leeve it plugged to the Charger all nigh and see if it has charged by morning.
If it has, it means that iPods can be charged very easily but will only display the charging icons etc. with a bit of cirial comunication. This comcunictaion must happen throught the dock and PC but not straight from cheap chargers. This could mean that the two 10k setup as above works, as that also turns on the iPod but with no charge icons.
If it hasn't charged it means the modern iPod must need some serial communication, or at least the data pins to be the right voltage for it to charge.
I will try to remember to post back 2morrow morning with results.
 

ciseco

Senior Member
Alband, my misses has a motorola phone that does something similar, so I bought a ?2.95 car charger and like on blue peter, sticky tape n' stuff got it working that way, never bothered to open it and find out why, this might be an approach???

Miles
________
vaaapp
 
Last edited:

alband

Senior Member
The battery icon actualy went up sooner than I thought and so I can now confirm it does charge from the charger without dock. Now the twin 10k setup. I can't confirm it as yet, that will take a while, but I'm pretty sure it'll work. I need to wear down the iPod first then try and charge it with the homemade twin 10k before I can be sure that works.
About the charge icon thing. I now know that the dock tells the iPod it is being charged just like the PC. Has anyone out there taken apart a dock before that they can examine? It could just be case of getting the other pins at the right level.
That pinout diagram has some stuff bellow and on pin 21.
http://pinouts.ru/PortableDevices/ipod_pinout.shtml
Is the serial protocol listed there the same as PICAXE?
Thanks.
 

alband

Senior Member
Well I've just tryed the home maid version and it doesn't work, It actualy drains power. :confused::(
After testing the mains charger it supplies:
5V at VCC
2.6V at D-
1.9V at D+
And 0 at GND
I'm going to try and replicate that now.
 

BeanieBots

Moderator
Boy would I be in trouble if I ever tried the home maid:D
One way of draining energy I suppose. I'm sure she'll bare with you;)
 

alband

Senior Member
I managed to replicate the voltages at each pin but still had no success. I think the iPod keeps trying to communicate with the device it's connected to until the right conditionns are established, as the screen doesn't automatically dim but stays on while its connected.
Any ideas?:confused:
 

alband

Senior Member
Hehe, If only :rolleyes:.
There must be some kind of special circuitry layout needed between the two data pins. The iPod will be using up its battery trying to look for this. I'll just have to have a really good look at the circuitry in the mains charger.
 
iphone

i have a similar problem with my iphone and a charger.

The charger is a 3rd party charger for a 3rd generation ipod (and works fine with that) But will discharge my iphone slowly.

I did read something somewhere about it but cant remember what the casue was.


mark
 

alband

Senior Member
Well I've had a look and have some conclusion which I'll test tonight.
Attached (in second message - 2 attachments per message) is a schematic of the second half (explained later) of the charger.
The charger is a two half job.
1st half gets the AC mains ready to be put through the transformer coils.
2nd half deals with the output from the 2nd transformer coil and charges the iPod + an indicator LED.
This is an old device so most stuff is analogue. There is a small IC in the first half that resembles a small 7805 in shape but I cant see the markings on it. There is a photocouple just below the transformer joining the 1st and 2nd halves. There is also a small IC in the second half that at first I thought was a transistor but after checking the silkscreen, it says it an IC.

In the schematic (second message)...

J2.1 & J3.1 are the transformer output pins.
J4.1 & J5.1 are a photocouple output pins.
Q1 is not a transistor but is the transistor like IC meantioned above.
There is also a component missing on the schematic below R6. It appears as a little three pined chip in the second picture (...423). I think this is some kind of switching diode.
The numbers next to resistors 1-4 are the resistances across them. NB this could not be there actual resistance, but the resistance of them plus other components in the circuit.

Anyway, I'm going to try putting resistors of those values into my breadboard and will post the results.
 

Attachments

Last edited:

BeanieBots

Moderator
Anyway, I'm going to try putting resistors of those values into my breadboard and will post the results.
Please, please set your video running before you turn on. I don't think anyone has ever actually caught the majic smoke on film.
By the way, R6=100k, even the blurry picture is clear enough to make out the "104" printed on it. One of the most critical values of course is the inductor. How will you replicate its value?

Mains + complete guesswork. Like I said, please video. At least your relatives will have something to ponder over!
 

alband

Senior Member
(Still haven't done it yet) Ah the thing is I've already put 5V across the USB pins and it charged. All I'm going to do is replicate the resistors and I'm sue it'll work. How do you know 104 = 100K - what is the code for chip resistor values?
 

alband

Senior Member
Well, the four resistors are as follows (in schematic):
R1 = 430K
R2 = 750K
R3 = 510K
R4 = 510K
:D:D:D:D
Ah. Succsess. I thought it diddn't work but just this second after poking the contacts I got the lighting bolt. Like thought, it just needed those resistors to be the right values.

So, now what...
 

alband

Senior Member
I've done some more PICAXE related testing and found that if anyone (including me) is going to use a picaxe to charge an iPod, the output pin would need to be attached to a relay with a 5V supply, as the output pin voltage isn't sufficiant. I don't know if an FET would work.:)
 
Top