The primary reason we ordered these now is to get a feel for how the pinout color scheme works in practice before we commit to it permanently.
The leads are 30cm long, which seems a bit unwieldy in real life. The next version will be a few centimeters shorter.
One end is terminated with 1 pin female “DuPont” connectors. These are easy to use with breakout boards and bread boards that have 2.54mm header pins. We’ll need to choose a nice probe hook and mating crimp eventually.
While the wire quality is fine (top), it’s a bit stiff and we’d prefer something really nice for the final cable. The Saleae Logic cable (bottom) has really amazing tangle free wire with great flexibility. We took the Saleae cable to a bunch of wire manufacturers in Shenzhen, but none of them had anything close in terms of quality and flexibility. Our search will continue.
In addition to the 2 inch IPS LCD we’re been using with the Bus Pirate prototype “Ultra”, we’re also sending off a PCB for a larger 2.8 inch display. Both panels are 240*320 pixels, so the larger version probably won’t look quite as stunning as the smaller display with high pixel density. If it does pass muster, a capacitive touch screen controller option is available that might be an interesting addition.
Uses 10 pin 0.5mm flexible PCB connector, wired to the main board with a 1:N connection. This connector is much smaller and thinner than the 1.25mm connector on v1b, it reduces the space needed between the display board and the main board.
Flipped LCD orientation 180 degrees so font data can be written into bounding boxes in a more natural “left-to-right” orientation, eliminating the need to precalculate the text end point and write characters in reverse sequence
Nudged the display towards the IO header. We’ll experiment with some buttons in the remaining available space
Decoupling capacitors on LCD power pins
The 2 inch 240*320 IPS LCD display we’re been testing has a very pleasing pixel density, but we’re also itching to try the bigger 2.8 inch version. Next week we’ll send out a prototype carrier board for the bigger display, as well as some Bus Plug breakout boards.
We chose ADS7041/ADS7042 10/12 bit ADCs capable of 1MSPS with an SPI interface. The 12 bit version is $1.75 in 100s, the 10 bit version is slightly cheaper ($1.06). The 10 and 12 bit versions are pin-compatible. We’ll try both and decide later what works best.
There are much cheaper SPI ADCs, but for around a dollar this chip does 1 MSPS with a simple 3 wire interface. That’s the same top speed as the DSO Nano v3, so we can record samples in the two SRAMs and have a very minimal oscilloscope function on any IO pin.
The interface is read-only and doesn’t have any registers to configure, that’ll keep it simple to work with from the FPGA. Each conversion begins with two clock ticks, then the 10 or 12 bit reading follows. The maximum clock speed is 14MHz to achieve 1MSPS, easy to do with the FPGA.
As much as possible, we’d like to move control of all the Bus Pirate peripheral hardware to the FPGA. Then everything can be controlled through the state machine command pipeline. In Ultra v1c we moved analog voltage measurement to the FPGA by adding an SPI ADC. In a future revision it would make sense to move a few other things to the FPGA:
Pull-up resistor control
Programmable output power supply enable
Programmable output power supply margining (using a DAC)
v1d stuff not yet announced
For debugging and self-testing we need to keep some redundant connections to the MCU as well, but primary control should be through the FPGA.
We had a look at a few chips that could replace the Digital to Analog Converter in the MCU, here’s a few inexpensive options we considered:
MCP4902 8bit dual DAC TSSOP14
MCP4902 seems to be a classic Microchip part, available at Mouser for $0.99 in 100s. However, the smallest package size is TSSOP14 and a quick check of SZLCSC shows they only have the SOIC version with 17 pieces in stock. That’s not a great sign.
Each update of a DAC channel uses a 16bit command, maximum speed is 20MHz.
MCP48FVB02 8bit dual DAC MSOP10
MCP48FVB02 appears to be a part Microchip acquired when they bought Micrel. It comes in an MSOP10 package which is an improvement over the MCP4902. It’s a bit cheaper at $0.90 for 100pcs at Mouser. It’s not stocked at SZLCSZ, which is a huge warning sign. Microchip Direct is really good about delivering parts in China if need be, but they can only deliver 1200 today and new stock won’t be available until February (three and a half months away).
MCP48FVB02 uses a 24bit command to update each DAC, which is a full byte longer than the MCP4092. Both the MCP4092 and MCP48FVB02 operate at maximum write speeds of 20MHz, so the MCP48FVB02 will have a significantly slower maximum update rate.
Here’s where it gets a bit interesting. DAC082S085CIMM is a dual 8 bit DAC from Texas Instruments, available for $1.24 in 100s at Mouser. SZLCSC only has 8 in stock for around $2 in 100s (13.20RMB). Low stock is bad news, and a higher RMB price than USD price that points to a limited stock or specialty chip to avoid (i.e. not something with high demand in China).
However, the DAC084S085CIMM is similar but has 4 DACs. We could use the extra DACs to add more programmable output power supplies, or add a simple analog signal generator on a few of the IO pins. It’s available at Mouser for $1.58 in 100s, and at SZLCSC for $1.15 (8.68RMB) with 1700 available and 1300 shipped in the last month. That’s several good signs: it’s cheaper than the 2 DAC version ($2 vs $1.15), RMB price is cheaper than USD price, and there is a fair amount of stock and turnover at SZLCSC which means it’s probably being used in production somewhere. This seems like a good candidate.
Just to further verify, there are 50K in stock at the TI store, and 20K in stock at Digikey for a slightly higher price.
Commands are 16bits, but where it really shines is the 40MHz maximum update speed. Twice as many DACs, and twice twice as fast as the Microchip DACs.
This is by no accounts an exhaustive list, but after looking at stock on Mouser, Digikey, and SZLCSC these were the best options close to $1. Did we miss your favorite DAC?
Bus Pirate prototype Ultra v1b uses an FPGA to process commands sent through a FIFO buffer to a state machine. Pipelined commands can be loaded into the FIFO and executed by the state machine with per-clock repeatability. Non-pipelined commands halt the state machine while the MCU takes over to perform the command, the delay is unpredictable and depends on many factors such as USB operations the MCU may be servicing.
These commands are currently pipelined and handled in the FPGA by the state machine:
Delays (ms, us)
These commands can be pipelined, but are currently handled in registers:
These commands will be pipelined in v1c and later:
ADC reads (on any pin, Vout)
These commands could be pipelined with some hardware updates:
Pull-up resistors toggle
Power supply enable
Power supply margining (by adding an external DAC)
These commands cannot be pipelined because they happen outside the FPGA:
Mode change (reloads the FPGA)
Jump to bootloader
Self-test (involves tests on the MCU and FPGA)
There are also mode macros to consider, which probably need to be a combination of pipelined commands and non-pipelined commands. This week we’ll choose an external DAC and add it to the board.
Bus Pirate prototype “Ultra” v1b successfully wrote to and read back from a 25LC020A SPI EEPROM chip. The image shows the Bus Pirate reading 8 bytes of 0x02 from the EEPROM at address 0x00, and the bus activity can be verified on the logic analyzer graph. Still a long way to go, but it’s nice to have everything working.
Tomorrow we’ll finish the major SPI commands and general purpose mode features like analog measurement and manipulation of the auxiliary pins. As always, you can follow our latest progress in the forum.
Unfortunately we run more or less into the same issues as we had with the Microchip controller: USB need regularly attention, which interferes with our interaction on the protocols, so we end up with stalls. Another big issue was that the peripherals were designed with moving data efficiently around and not in an educational way (as the BusPirate is ment to be). For example the I2C is nicely designed for reading memories or writing displays fast, but we need to know beforehand which byte is last. As we only can send a stop byte one or two bytes in advance of the stop bit. The design of the BusPirate menu system doesn’t cope with this properly (without major redesign).
As always, you can join Sjaak and Ian for development fun in the forum.
Bus Pirate prototype “Ultra” version 1c is technically done, but we came up with some hot last minute additions this weekend. We’ll skip this board and send out the updated version 1d with the additional features at the end of the week.
Version 1c changes:
4 layer PCB
1MHz 12 bit SPI ADC connected directly to the FPGA
Vout/Vref is also measured through the analog multiplexer, which is changed to to the bigger 16bit version (74HCT4067). This will probably change to two 74HCT4051s instead because supplies of the 4067 are skimpy! We can have one “divide by two” 4051 for 5volt measurements on the IO pins, and one 3.3volt 4051 tied directly to the ADC for measuring lower voltage analog stuff
Beefier 3.3volt supply
The 1.2volt supply is now monitored by the MCU for self testing
0.5mm flex cable connector for the display board opens up a bit of board space
Additional ADC measurement point before the back-current shut down protection on the power supply. This gives us a way to include it in the self test and detect when it activates
The Bus Pirate pinout was supposed to
be intuitive, except for one Arduino-like mistake.
Each protocol uses the same pin for
similar functions, and the pins used are supposed to “walk” up
the row. 1-Wire uses Master Out Slave In (MOSI, pin number 1). I2C
uses MOSI (1) and CLOCK (2). UART uses MOSI (1) and Master In Slave
Out (MISO, 3). SPI uses MOSI (1), CLOCK (2), MISO(3), and Chip Select
It should have been a nice intuitive progression, except for the unfortunate use of a hideous 2x5pin IDC connector. It’s hard to recall why we used this connector. Probably to keep the board small, provide a keyed connector, and likely because it was in our parts box.
The IDC connector was a poor choice. Not only is it ugly, probes end up using crappy ribbon cable that makes it look even worse. The connector was added without regard for the proper pin order, and used something hard to remember – MISO, CS, MOSI, CLK. Once it was loose in the wild we were stuck with that convention, and that’s how Bus Pirates have been produced for over 10 years!
Bus Pirate Ultra uses a 1x10pin connector called TJC8 2.54mm or 2543 by Chinese suppliers. It’s keyed, but also fits common 2.54mm “DuPont” connectors laying around most workshops. The pinout is DIO1 to DIO8, Vout, and Ground. Each protocol mode is in charge of naming the DIO pins, and the labels are displayed on the LCD above the connector.
We also want to give some thought to the color codes used on the pinout display and probe cables. Typically cable manufacturers stock wire in ten colors: red, orange, yellow, green, blue, purple, gray, white, black, and brown.
Goal one is to make the power and
ground pins an intuitive color pair. Black and red, white and black,
maybe even red and green. A color pair that a beginner in electronics
has probably seen somewhere before.
Goal two is to follow the rainbow. Most people are probably familiar with ROY G BIV, the acronym for the order of colors in a rainbow. We want to start with red and progress downwards in a logical order so that pin one is instantly obvious, and the pins can be identified in a tangled messy probe cable without tracing them back to the source. Indigo and violet colored cable isn’t standard and the colors are hard to tell apart, so they’re usually substituted with purple and brown.
Pin 1 (DIO1) is assigned red. DIO2 to
DIO7 are assigned orange, yellow, green, blue, purple and brown. With
three colors remaining (gray, black, white), white and black are the
obvious choice for the power/ground pin pair. Grey is assigned to
Eventually we’ll need to choose good quality wire and some decent probe hooks for the cable. Sigrok, the open source logic analyzer software project, has a good overview of probe hook options. The rest of this week we’ll work on getting the firmware cleaned up and Ultra v1c board routed. As always, you can follow our latest progress in the forum.