The usual way send data from a microcontroller is either over RS-232 with MAX232 serial ICs, crystals, and a relatively ancient computer, or by bit-banging the USB protocol and worrying about driver issues. Not content with these solutions, [Scott] came up with sound card μC/PC communication that doesn’t require any extra components.
[Scott] bought a cheap USB sound card dongle on eBay (although a built-in sound card will do) and wired up the tip and ring of the plug to the microcontroller. The data is sent from the microcontroller a lot like Morse code – a short gap between pulses is a zero, a long gap is a one. This is parsed by a Python script using PyAudio. Synchronization, timing, and calibration is automatic because of a 10-bit ‘packet header’ explained in this video.
Continue reading “Sound card microcontroller/PC communication”
If you’re planning to do some hacking with CPLD or FPGA chips you’ll need a way to program them. JTAG is one of the options and here’s a cheap method that uses the serial port (translated).
This method requires only four signals (TDI, TMS, TCK and TDO) plus ground. But the problem is that an RS232 serial port operates with 12V logic levels and the JTAG side of the programmer needs to operate with the logic levels native to the device you’re programming. Commercial programmers use a level convert IC to take care of this for you, but that doesn’t mesh with the cheap goal of this project. Instead, [Nicholas] uses Zener diodes and voltage dividers to make the conversion. There is also an LED for each data signal to give some feedback if you’re having trouble.
You can use this along with a programming application that [Nicholas] whipped up using Visual Studio. It works well via the serial port, but he did try programming with a USB-to-Serial dongle. He found that this method slows the process down to an unbearable 5-minutes. Take a look, maybe you can help to get that sloth-like programming up to a manageable speed.
[Mike Lu] likes to add serial ports to his routers to use for debugging but he didn’t want to drill holes in his new RT-N12. After a bit of head-scratching he thought about repurposing the four unused wires on one of the RJ45 Ethernet connectors. This would allow him to interface with the necessary signals and still have the option of using that port for a network connection. The first step was to build the circuit to output the correct serial levels and connect it to the unused pins on the jack. Next, to separate serial and Ethernet on the outside of the router he build a short adapter cable.
This is an elegant solution if you’re looking for zero case modifications. But if you don’t mind a few inconspicuous holes we love the serial port used on this Dockstar.
[Geordy] added a serial port to his Zipit. It uses a 3.5mm jack as the connector. He managed to include an RS232 level converter inside the case. Both components were hard to fit into the cramped quarters but he did it and he kept the hacker-friendly device looking nice too.
We use the Bus Pirate to interface a new chip without writing code or designing a PCB. Based on your feedback, and our experience using the original Bus Pirate to demonstrate various parts, we updated the design with new features and cheaper components.
There’s also a firmware update for both Bus Pirate hardware versions, with bug fixes, and a PC AT keyboard decoder. Check out the new Hack a Day Bus Pirate page, and browse the Bus Pirate source code in our Google code SVN repository.
We cover the design updates and interface a digital to analog converter below.
Continue reading “How-to: Bus Pirate v1, improved universal serial interface”
UPDATE: New firmware with JTAG and more
We’re always excited to get a new chip or SIM card to interface, but our enthusiasm is often dampened by the prototyping process. Interfacing any chip usually means breadboarding a circuit, writing code, and hauling out the programmer; maybe even a prototyping PCB.
A few years ago we built the first ‘Bus Pirate’, a universal bus interface that talks to most chips from a PC serial terminal. Several standard serial protocols are supported at 3.3-5volts, including I2C, SPI, and asynchronous serial. Additional ‘raw’ 2- and 3- wire libraries can interface almost any proprietary serial protocols. Since this has been such a useful tool for us, we cleaned up the code, documented the design, and released it here with specs, schematic, and source code.
Continue reading “How-to: The Bus Pirate, universal serial interface”