Free PCB Sunday: USB RGB color changer

We go through a lot of prototype PCBs, and end up with lots of extras that we’ll never use. Every Sunday we give away a few professionally-made PCBs from one of our past or future projects, or a related prototype.

This is a USB controlled RGB color changing light. Someone made some minor modifications to the design and had a bunch of boards produced, we ended up with a pile of the extras. We’re giving away two PCBs this week, just ask for one in the comments.

Continue reading “Free PCB Sunday: USB RGB color changer”

Bus Pirate availability

Seeed is currently out of stock of the Bus Pirate v3. The next batch should start shipping in a week or two. In the mean time, you can should soon be able to place a back order with Seeed, or pick up a Bus Pirate (and probe cable) at Adafruit.

The next batch of Bus Pirates from Seeed may will be the v3b revision. This is still up in the air, we sent the files but don’t have confirmation they were actually used. V3b is exactly the same size and has the same capabilities as the v3a, we just made a few tweaks to improve manufacturing reliability. We’ll cover the update in an upcoming article, or you can read a bit about the major updates in the forum.

Open Programmer v0.7.x

Alberto Maccioni designed this multi-chip opensource programmer based on a PIC18F2550. Currently it supports PIC, I2C-SPI-MicroWire EEPROMs, some ATMEL AVRs, and (soon) other devices. It even supports some PIC 24Fs, like the 24Fj64GA002 used on the Bus Pirate.

In the last few years, as serial and parallel interfaces have almost disappeared, electronics enthusiasts find even more difficult to program microcontrollers; old time programmers don’t work any more; common solutions include using USB to serial adapters (which can’t accept direct access but only slow API calls), or add-on interface chips, like FTDIxxxx, which appear substantially as serial interfaces and require custom or proprietary drivers.
So why not use PIC controllers and their native USB interface?
After searching a while I couldn’t find an USB programmer which was at the same time functional, free, and open source, so I decided to design one.
Open source means that all sources and schematics are given free of charge with the rights to modify and release them.

Check out the impressive design documentation. It includes a good overview of PIC programming, and a detailed look at the booster circuit used to get the 13volt PIC programming voltage. The programmer is compatible with Linux and Windows, and is released under the GPL.

PICkit I2C and SPI demo boards

Darren pointed out two IC demonstration boards from Microchip.

The PICKit Serial I2C demo board has five unique devices with I2C interfaces. It includes a 2Kbit serial EEPROM, high accuracy temperature sensor, 12-bit ADC, 10-bit DAC, and an 8-bit IO expander – all great chips for a new hardware hacker. Debugging is possible through test points on the I2C bus and most of the devices.

The PICKit Serial SPI demo board contains seven unique devices with SPI interfaces including a 2Kbit serial EEPROM, high accuracy temperature sensor, 12-bit ADC, 12-bit DAC, digital potentiometer, a single ended low gain PGA, and an 8-bit IO expander. As with the I2C demo board, it has test points on the SPI bus and most of the attached devices. The only drawback  is that all seven devices share the same CS pin, Chip Select just became select all chips! A jumper near each chip selects the slave that’s connected to the bus.

Both demo boards are designed to be used with a PICKit2, however the Bus Pirate can easily interface either of the demo boards. At $25 and $35 these boards are the same price as the Bus Pirate itself – could be a good rebuild candidate if you have the SMD soldering skills.

You can get a Bus Pirate for $30, including worldwide shipping.

Bus Pirate: CAN Pirate

Unlike simple serial protocols, Controller Area Network (CAN) transmits data in frames with error detection capabilities. The Bus Pirate wasn’t designed to handle frame-based data transmissions, but have no fear the CAN Pirate adapter is here!

In order to send and sniff CAN data for debugging an application, Stefano came up with the CAN Pirate. It uses a stand-alone CAN controller with SPI interface (MCP2515) and a high speed CAN transceiver (MCP2551). Schematics for the board are available in the forum.

Currently, the MCP2515 is setup and accessed manually from the Bus Pirate SPI mode. Stefano is offering a few extra PCBs to developers who help write a new Bus Pirate mode that supports the CAN Pirate directly.

You can get a Bus Pirate for $30, including worldwide shipping.

Experience with the Bus Pirate

Dom shares his impressions of the Bus Pirate as a prototyping and test tool:

OK I don’t say it often but the Bus Pirate is a superb piece of kit. The vast bulk of my work is design work with a wide range of IC’s and embedded devices, for this I spend a large amount of time using logic analysers which are superb; I even own a Zeroplus LAP-C myself at home.  However my current personal project Skylifter uses the ADXL345, this is well known as a dog of a sensor to interface with and I was recommended by a friend at the London Hackspace to get a Bus Pirate… so I did!

I can say without hesitation this is one of the most useful tools to a hobbyist around, it does 75% of the work I use a LA for in a smaller package, it’s not tied to bulky software and far far more convenient to boot!  Want to read back an EEPROM? Perfect!

Thanks for the feedback. It’s always great to read about your experience with the Bus Pirate, good or bad. We’ve had so much fun designing it, and it’s awesome when other people find it useful too.

The current design grew from our frustrations with earlier Bus Pirate versions, so if you hate it we’d like to know too. We’ll try to address the limitations and improve the firmware and/or hardware.

You can get a Bus Pirate today for $30, including worldwide shipping.

USB IR Toy: Calculate transmitter carrier frequency

See the latest version in the documentation wiki.

The USB IR Toy raw IO mode samples and replays infrared waveforms.  IRIO mode starts with a default 36kHz infrared transmit modulation frequency. The rate can be changed with the setup modulation command (0×02), followed by a byte that sets the pulse-width modulator match value (PR2), and a don’t care byte.

Odje asked how to change the modulation frequency to 38.4Khz. To do this we  need to calculate the timer PR2 value that gives the closest frequency. The best online tool we’ve found is this PWM Calculator.

Setup the PWM calculator with the US IR Toy constants (the clock (fosc) is 48Mhz, duty cycle is always 50%, the prescaler is fixed at 4x). Enter you desired frequency in hz (38400), and click calculate. A table similar to this one will be generated.

Choose the closest frequency from the table, the closest match to 384000Hz is 38461.54Hz. The values won’t match exactly, but IR receivers usually work over a range of modulations, from roughly 20kHz to 60kHz. The USB IR Toy currently uses a fixed 4x prescaler, so choose a value with a 4x timer2 prescaler. Here, the closest value uses a 4x prescaler anyways. The USB IR Toy prescaler could be made adjustable in a future firmware if more flexibility is needed.

The value to send is PR2. for 38.4kHz the PR2 value is 0b01001101, or 77 (0x4D). The complete command to send to the IR Toy is 0x02 0x4d 0x00:

  • 0x02 is the setup TX command
  • 0x4d is the PR2 value from the table
  • 0x00 is a don’t care byte (doesn’t matter)

Connect to the IR Toy virtual serial port with a terminal program that can send byte values, we like Hercules and realterm. Send the PWM setup command (0×02), the PR2 value, and a don’t car byte (0x00). New settings take effect immediately. Here is where the settings are processed in the code.

Pirateship Bus Pirate GUI

Ronan writes about a new Bus Pirate GUI he’s working on:

Hi. I’m reading about your “One Bus Pirate programs another” idea. Curiously enough, I had a pretty close idea to that.

Instead of just programming another PIC, I wrote a frontend to Bus Pirate’s basic commands. Right now, I’m working on implementing a plugin system to allow one to create interfaces for specific tasks, including that of programming another MCU. You can see and download it here. Help on ideas would be greatly appreciated.

Ronan says the code is unlicensed at the moment, but it will be hybrid/GPL once it’s ‘cleaned up’.

Free PCB Sunday: USB RGB color changer

We go through a lot of prototype PCBs, and end up with lots of extras that we’ll never use. Every Sunday we give away a few professionally-made PCBs from one of our past or future projects, or a related prototype.

This is a USB controlled RGB color changing light. Someone made some minor modifications to the design and had a bunch of boards produced, we ended up with a pile of the extras. We’re giving away two PCBs this week, just ask for one in the comments.

Continue reading “Free PCB Sunday: USB RGB color changer”

Logic Sniffer probes available next week

Openbench Logic Sniffer is an open source logic analyzer. It’s designed to support the SUMP logic analyzer software at the lowest possible cost. This project is a collaboration between the Gadget Factory and Dangerous Prototypes.

We’ve got a long-awaited update on probe cables for the Open Logic Sniffer. Word from Seeed is that they should come back from the assembler and be available next week for $6 each. We’re not involved with the cable, it’s an accessory Seeed came up with to make the OLS easier to use.

The cables have a 1×9 connector and 9 leads with tweezer-style test clips. These are the same tweezer-clips used on two leads of the Bus Pirate probe cable, they’re a little delicate but it’s hard to beat the price. Each cable connects 8 of the 16 buffered input channels, plus ground. Two are needed for all 16 buffered channels.

Bus Pirate OpenOCD walk-through

Jrt posted some notes about using the Bus Pirate with OpenOCD:

It does work – but it’s not slick or fast. If you want a cheap JTAG adapter for remote debugging or big flash writes, get an FTDI-2232 based one. But, it’ll be fine for fiddling with bootloaders or just interrogating hardware.

We agree that the Bus Pirate is good for JTAG and flash tinkering, but once you get a taste you’ll want something built specifically for bandwidth-intensive tasks. We’re working on our own FTDI-2232 JTAG programmer, the Bus Blaster. You can read more about it, and contribute to development, in the forum.

Bus Pirates are shipping now for $30, including worldwide shipping.

USB IR Toy: Calculate sampling rates

See the latest version on the documentation wiki.

The USB IR Toy raw IO mode samples and replays infrared waveforms.  IRIO mode starts with a default 10kHz sample and playback timer. The rate can be changed with the setup timer command (0x01), followed by two bytes that set the sample timer offset. The first byte is the high 8bits of the offset, the second byte is the low 8bits.

An easy way to find the values to send is a utility such as PIC Timer Calculator V4. Enter the key constants (timer 1, 1:1 prescaler, 48MHz fosc), and adjust the slider to find an offset that gives the desired frequency. The picture shows the settings for 10kHz.

To use the offset value (64331 in the example), first convert the number to HEX (64331=0xfb4b). Next, break it into a high (0xfb) and low (0x4b) byte.

0x01 0xfb 0x4b

Connect to the IR Toy virtual serial port with a terminal program that can send byte values, we like Hercules and realterm. Send the sample timer setup command (0x01) and the two bytes of the timer offset (0xfb 0x4b). New settings take effect immediately.

There is maximum limit to the sample speed, but it’s undetermined at this time. At some point the samples are so frequent that the PIC can’t service the interrupt before another fires, or it won’t have time to service the USB peripheral.

A screenshot of Hercules settings are shown below the break.

Continue reading “USB IR Toy: Calculate sampling rates”

Open Logic Sniffer shipping

Seeed has started sending shipment notifications for the Open Logic Sniffer. Now the hard part, waiting for the mail. Let us know how your OLS unboxing goes, share your experience in the forum.

There are a few OLS units left from the first batch. You can pick one up at Seeed for $45, including worldwide shipping. New orders should ship in the next few days.

Feet for Ril3y’s Bus Pirate case

RatRanch found a good accessory for Ril3y’s laser-cut Bus Pirate case:

I made some very effective non-slip “feet” for the bottom using tine covers left over from a dishwasher repair kit that I obtained from an Amazon seller for about US $5 with shipping.   I’d imagine that similar parts could be found in any well stocked hardware store.

Thanks for the tip! We’ll post our case unboxing and build documentation next week. Don’t forget you can get a case for free by helping program one Bus Pirate with another.

Arduino implemented on FPGA

The Gadget Factory, our partner on the Open Logic Sniffer, implemented the Arduino using an FPGA. It’s based on the AVR8 soft processor Jack developed previously for the Butterfly Platform. The Butterfly Platform is a rapid prototyping board that gets you going on FPGA projects in no time, and now you can implement things in a FPGA using simple Arduino Sketches. This project should be compatible with existing Arduino sketches that don’t need analog inputs.

via Hackaday

Pinguino: a PIC Arduino

Pinguino is an Arduino-like board based on PIC microcontroller. The hardware is based on a PIC 18F2550, which has an integrated USB module. This is the same chip we used in the USB IR Toy.

The IDE is built with Python. An integrated preprocessor translates Arduino specific instructions directly to C. It uses SDCC as its C compiler and GPUTILS as the assembler.

Free PCB Sunday: USB RGB color changer

We go through a lot of prototype PCBs, and end up with lots of extras that we’ll never use. Every Sunday we give away a few professionally-made PCBs from one of our past or future projects, or a related prototype.

This is a USB controlled RGB color changing light. Someone made some minor modifications to the design and had a bunch of boards produced, we ended up with a pile of the extras. We’re giving away two PCBs this week, just ask for one in the comments.

Continue reading “Free PCB Sunday: USB RGB color changer”