What is a debug interface?
The s1mp3 I²C debug interface is a simple adapter to connect the pc to the s1mp3 player without occupying hardware resources like USB or GPIO's. Its purpose is to provide debug possibilities without disabling any of the usual hardware functions. This way its possible to use this interface even to develop USB client drivers or other low-level stuff. To communicate with the pc, some few lines of code will be enough already. The debug console s1debug will provide functions like:
- debug output (putch, puts, ...)
- single command tracing/stepping
- reading/writing registers/ports/memory
- support for breakpoints
Only assumption is having the S1Debug API be present in memory.
The interface reaches handshaked transfer speeds (bidirectional) between 2 and 3 kbps, with an error rate of 0% (could depend on the pc/spp speed and the used cable length).
Get yourself an interface
If you have some experience, it shouldn't be any problem for you to build this interface.
You can also obtain some ready-mounted and tested pcb-board from Wire(the author) at s1mp3.de for just 15 EUR - buy now
If you don't want your board powered by SPP at all, you could leave SPP pins 1, 14, 16 and 17 unconnected and may shortcut the diode. But don't forget to connect an external 5V power source to the I2C connector then.
- 1x PCF8574(A)P < DBG_INTERFACE_ADDR differs for the two chips. it is 0x70 for the A version and 0x40 for the non-A version. the default is 0x70. You might need to change it in the client
- 1x male DB-25 connector
- 1x male DB-9 connector
- 1x female DB-9 connector
- 3x 220 ohm resistors
- 2x 560 ohm resistors
- 2x 2.2 kohm resistors
- 1x red led
- 1x green led
- 1x 100nF capacitor
- 1x diode 1N4148
The interface gets connected to the PC's SPP (also known as printer/parallel port) and provides a single DB-9 male connector:
1 2 3 4 5 _____________ \ . . . . . / \ . . . . / --------- 6 7 8 9
- 1,2,3 - GND
- 4,5,6 - VCC (ext.5V)
- 7 - SCL
- 8 - SDA
- 9 - INT
To connect our debug interface to the i²c bus, we need at least three cables: GND, SCL, and SDA. On the ATJ2085 these signals are located at pin 49 (GND), pin 63 (SCL), and pin 62 (SDA). The best method may be to solder three, thin wires to the place, where the radio controller usually gets placed:
______ GND ()| |() ()| |() ()| |()- GND ()| |()- SCL GND ()|______|()- SDA °
After soldering, fix the cables with tape or hot glue, to prevent damage to your board. An optional wire could be placed to supply the interface with a stable 5V source (probably from the USB connector). The other end of these wires get soldered to a DB-9 female plug, according to the pin description above. Don't use too long cables! A length between 5..10cm (2..4inch) seems to work fine. If you wish to still use your player, you should be able to add a small 2.5mm stereo jack (like for the earphones) and drill a small hole in the players case. Fix the jack with hot glue.
Some sample interfaces
- I2C - the s1mp3 i2c controller
- s1debug - the debug console, controlling the interface from host side
- s1Debug API - the debug API, controlling the interface from client side