gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > A DS serial port

#97561 - masscat - Thu Aug 10, 2006 1:46 pm

EDIT: The SPI/UART bridge now has a webpage. Corrected the link to the MCU programming tool.

I have put together a SPI UART bridge so that you can connect a DS to anything with an RS232 port. The port settings are currently fixed at 9600 baud, 8 data bits, no parity and 1 stop bit.

The hardware side is based around a Zilog Z8F0412 microcontroller. It takes the SPI bus from the DS Card port and puts the data received out of its UART port. Any data received over the UART is sent to the DS during the SPI transfer.

The hardware is not portable - I have put in a seperate power supply as I am not sure how much current the DS card port can supply and the microcontroller is a big chip. But the main reason for me developing it is to debug over, it is cheap to build and somebody with little hardware knowledge (me) can put it together.

Check the webpage for the latest release.

If you want to change and build the zilog code you can get the development environment from the Zilog website. The serialnds.hex file from the zilog tarball above is the file you program the MCU with. You can program/debug the MCU by connecting the debug port (see schematic) to your PC and using the tools from here.

To make the DS Card slot connector either hack an DS cart that you do not want anymore, etch one or, like me, carve one out of a plain copper PCB board using a stanley knife (not a fun job but I could not bring myself to destroy a DS cart and I do not have the equipment to etch PCBs).


Last edited by masscat on Sat Aug 12, 2006 6:12 pm; edited 1 time in total

#97750 - jester - Fri Aug 11, 2006 11:59 am

have you got an image of this working?

#97782 - masscat - Fri Aug 11, 2006 2:56 pm

Here is a shot of the circuit.
The board with the big old blue capacitors on is the RS232 line driver. The other piece of veriboard is the voltage regulator (most of the other components on that board are from a different project). The Zilog MCU is on the prototype board.

Here is a shot of the hand carved ds connector.

Here is a capture of GDB talking to the DS over the serial port. Note the "target remote /dev/ttyS0" command - for non-linux people /dev/ttyS0 is a serial port.

Here is a shot of the DS screen whilst talking to GDB.

#97789 - Linkiboy - Fri Aug 11, 2006 3:25 pm

I see what you mean by not portable...

Anyways, that is quite impressive. if you optimize the design more you could make it... portable, somehow.

Although what is the difference(in functionallity) between this and natrium42's serial interface?

#97797 - masscat - Fri Aug 11, 2006 4:47 pm

Linkiboy wrote:
I see what you mean by not portable...

Anyways, that is quite impressive. if you optimize the design more you could make it... portable, somehow.

Although what is the difference(in functionallity) between this and natrium42's serial interface?

The design is going to stay as optimised as it is as I do not have the skills to implement the bridge in a small FPGA or similar device. Also I do not want to have to get any PCBs made up so lovely big DIP packages is what I like.

This and natrium42's passme serial interface both provide a UART you can use to talk to other devices.
As for differences:
From what I know of the passme serial interface the DS does the bit bashing for the UART which means that it takes a number of SPI transfers to get the desired baud at the other end. Where as only one transfer per byte is needed in my case (8 data byte values are escaped and sent in two transfers to allow commands to be sent between the bridge and the DS). So the DS spends less time interacting with the SPI bus.
My bridge can buffer a small amount of received data. I do not know if there is any buffering on the passme one.
There is a nice software driver for my bridge.
The baud rate is currently fixed in my bridge where as you could vary it with the passme by lengthening/shortening the bit bashing bit size.
I do not have a passme device (functionally important to me).

That is about it.

#97911 - Lynx - Sat Aug 12, 2006 9:07 am

I love seeing pics of hardware hacking! Keep up the good work! PM me if you think I might be able to help you out with anything.
_________________
NDS Homebrew Roms & Reviews