A DS SPI/UART Bridge Hardware Project

本文介绍了一个将DS设备的SPI总线与UART接口桥接的硬件项目,允许DS与具有UART接口的设备进行通信。项目使用Zilog Z8F0412 MCU实现,提供RS232电平驱动,支持多种通信方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

http://masscat.afraid.org/ninds/spiuart.php

 

A DS SPI/UART Bridge Hardware Project

This hardware projects provides a bridge between the DS's DS card slot SPI bus and a UART, allowing the DS to communicate with anything with a UART interface. The hardware implementation given shows a RS232 line driver allowing the DS to communicate with a PC serial port.

Releases

Zilog Code

DS driver

ToDo List

  • Implement flow control on the UART side.
  • Provide a method to configure the UART settings.
  • Implement a method to stop possiblity of the data flows be turned off and never coming back on

Hardware Implementation

The hardware side is based around a Zilog Z8F0412 microcontroller. It is a nice and easy MCU to program (free tools available from the Zilog website), provides the SPI bus and UART interfaces so requires few additional components and is available in DIP packages so no need to get PCBs made up. The MCU can be flashed and debugged through a PC serial port using some open source tools.

The Zilog is programmed in C and compiles to a .hex file which is flashed to the MCU.

Here is a schematic of the circuit with a RS232 line driver and below is the circuit made up on some stripboard and prototype board.

The circuit built up

The DS Card Connector

You have a number of choices as to how to make a DS slot connector. You can hack a DS game, desoldering all the components on it and soldering some flying leads to connect to each card slot pin (this will destroy the DS game - you have been warned). Have a PCB made up professionally or etch one at home. Or if you cannot bring yourself to kill a DS game and have no etching equipment carve one out of a piece of solid copper PCB. It is not fun but is does work.


Software Driver

The driver provides a function interface to initialise the bridge and read data from and write data to it. The driver can be set to be polled or interrupt driven. When built the bridge driver comes as a library, libserial9.a, and a header file, spi_uart_bridge.h, giving the function interface. These are all that is needed to use the driver.

For the driver interface see the doxygen documentation for the spi_uart_bridge.h file.

Screenshots

Below is a picture of GDB talking to the DS over the serial port (note the target remote /dev/ttyS0 line) and some output that appears on the DS screen whilst this happens.


SPI Bus Protocol

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值