BUS PIRATE: three inexpensive SPI Digital to Analog Converters

Source: Microchip MCP4902 datasheet

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

Source: Microchip MCP4902 datasheet

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.

X
Source: Microchip MCP4902 datasheet

Each update of a DAC channel uses a 16bit command, maximum speed is 20MHz.

MCP48FVB02 8bit dual DAC MSOP10

Source: Microchip MCP48FVB02 datasheet

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).

Source: Microchip MCP48FVB02 datasheet

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.

DAC082S085CIMM/DAC084S085CIMM 8bit dual/quad DAC MSOP10

Source: DAC082S085 datasheet

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.

Source: DAC082S085 datasheet

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?

App note: Core independent voltage window signal detection using a single comparator

an_microchip_TB3221

Presenting the usage of Core independent paripheral of PICs in this app note from Microchip. Link here (PDF)

It is possible to find out whether a measured signal is below or above a certain value/reference using a single comparator. But, what if the desired interval is between two values, the undervoltage and overvoltage protection?

The most convenient and fastest solution is to use two comparators and two references. The results are analyzed to decide which of the three intervals houses the measured signal. Using an Analog-to-Digital Converter (ADC) and core post-processing will yield the same result, but the process is slower and dependent on core availability.

App note: Power supply rejection ratio of low dropout voltage regulators

an_microchip_AN3018

Here’s an app note about PSRR of LDO from Microchip. Link here (PDF)

The Power Supply Rejection Ratio is the ability of a device, such as a Low Dropout Voltage regulator, to reject the various perturbations that can be found in its input supply rail by providing a greatly attenuated signal at the output. Generally, the main source of the perturbation will be the output ripple of the DC/DC converters that typically power LDOs.

High PSRR LDOs are recommended for powering line ripple sensitive devices such as: RF applications, ADCs/DACs, FPGAs, MPUs, and audio applications.

One important clarification must be made: PSRR is NOT the same with output noise. PSRR is a measure of rejection. It shows what the part will output based on the given input.

App note: Passive entry door system with proximity sensor

an_microchip_at12649

A full implementation of a keyless entry from Microchip. Link here (PDF)

The door access systems have evolved from simple physical keys to more sophisticated keyless entry systems. Now, we have a system that automatically unlocks the door when user carrying an access key approaches the door handle. As it does not require any user action this system is referred to as Passive Entry

App note: Low Power POE Flyback Converter

an_microchip_an50-APID

App note from Microchip about their MIC2145 boost switching regulator to do POE Flayback conversion. Link here (PDF)

The MIC2145 skip mode controller is used to implement a flyback converter that is intended for use in nonisolated, low power, POE applications. The circuit has a nominal 48V input and supports the POE voltage range of 36V to 57V. The output voltage is 2.5V at 350mA.

App note: Adding flexibility by using multiple footprints for I2C™ serial EEPROMs

an_microchip_an1418

Save PCB space by utilizing EEPROM SOIC-8 area, here’s an application note from Microchip. Link here (PDF)

For many years, the 8-lead SOIC package has been the most popular package for serial EEPROMs, but now smaller packages are becoming more commonplace. This offers a number of benefits; the reductions in footprint size and component height are some of the more obvious ones. Smaller packages also generally offer a cost advantage over their larger counterparts.

App note: Writing to flash and EEPROM on the tinyAVR 1-series

an_microchip_an1983

Update your tinyAVR code to access memories when using 1-series tinyAVRs. Link here (PDF)

On tinyAVR® 1-series devices, access to Flash memory and EEPROM has been changed from that on previous tinyAVR devices. This means that existing code for writing to Flash and EEPROM on older devices must be modified in order to function properly on tinyAVR 1-series devices. This application note describes what has changed and how to adapt code to these changes.

App note: Grid-connected solar microinverter reference design

an_microchip_an1444a

A good read from Microchip on the theory behind inverter design connected to grip power. Link here (PDF)

There are two main requirements for solar inverter systems: harvest available energy from the PV panel and inject a sinusoidal current into the grid in phase with the grid voltage. In order to harvest the energy out of the PV panel, a Maximum Power Point Tracking (MPPT) algorithm is required. This algorithm determines the maximum amount of power available from the PV module at any given time. Interfacing to the grid requires solar inverter systems to abide by certain standards given by utility companies. These standards, such as EN61000-3-2, IEEE1547 and the U.S. National Electrical Code (NEC) 690, deal with power quality, safety, grounding and detection of islanding conditions.

App note: Multiple Capture/Compare/PWM (MCCP): Extending the functionality for low-cost motor control applications

ap_microchip_tb3152

Microchip’s MCCP module on PIC32 devices demonstrate the built-in majority detection filter for simpler motor control drives. Link here (PDF)

The motor control industry has been focusing on designing low-cost motor control drives for various applications. The consumer demand for low-cost motor control applications is driving this trend.

Microchip has recently introduced the PIC32MM family of microcontrollers, which is capable of addressing the low-cost motor control requirements. The low-cost solution benefits from the capability of the Multiple Capture/Compare/PWM (MCCP) module available in Microchip’s PIC32MM controllers. This document
illustrates the usage of the MCCP module in the PIC32MM0064GPL036 controller, from Microchip Technology, to deliver a development platform for motor drive applications.

MCCP implementation, similar to the motor control solution discussed in this document, can also be extended to Microchip’s PIC24 and dsPIC33 family of devices which feature MCCP.

App note: IR remote control transmitter

application

IR remote control transmitter application note (PDF!) from Microchip:

This application note illustrates the use of the PIC10F206 to implement a two-button infrared remote controller. The PIC10F2XX family of microcontrollers is currently the smallest in the world, and their compact sizes and low cost make them preferable for small applications such as this one.
Two example protocols are shown. The first is Philips® RC5, and the second is Sony™ SIRC. These two protocols were chosen because they are fairly common and their formats are well documented on professional and hobbyists’ web sites. They also demonstrate two differing schemes for formatting the transmission.