Arduboy with removable flash cart

A homebrew Arduboy with removale flash cart from Facelesstech:

I’ll start with the Arduboy its self. I wanted to make a small Arduboy that anyone with basic soldering skills could make. I don’t think its the easies of boards to solder but its the only way I could make it small enough and have all the features I wanted. I just went with the standard SSH1106 0.96″ screen that most people use in their homemade builds. The buttons I went with are the ones I’ve been using on my other RetroPie builds in the past. They are soft touch but they are not mushy like some are and have a small foot print.

More details on Facelesstech homepage.

Check out the video after the break.

BUS PIRATE: Love the USB C connector!

Bus Pirate prototype Ultra v1b uses a common, cheap USB C connector and we are in love!

Micro B connectors are a nightmare. Very inconsistent footprints, poor materials and build quality, and very weak mounting supports. Often the leads are hidden under the housing and conceal pesky shorts. Almost every Micro B connector we hand soldered eventually broke off the board and usually took some traces with it.

USB C solved all these issues! Soldering it is an absolute breeze. Leads are easily accessible and friendly to solder. It’s made of decent materials, and the footprint seems to be pretty standardized across the market. The mounting posts are solid and strong, this connector isn’t going anywhere.

Here’s how we connected it on the v1b hardware. The footprint was made by Sjaak at SMDprutser and is in our git repo.

App note: FPGA power supply considerations

App note from Vishay Siliconix, giving us tips on powering FPGAs. Link here (PDF)

An FPGA is a device that offers many logic elements – up to 1 million gates in a single device at this writing – as well as other functionality such as transceivers, PLLs, and MAC units for complex processing. FPGAs are becoming very powerful, and the need to power the devices effectively is a key, if often underestimated, part of the design. A straightforward power supply design process can significantly reduce the number of required design iterations for the OEM designer.

PROTOTYPE: Bus Pirate “Ultra” v1b

Today we finished stuffing the first Bus Pirate “Ultra” v1b board. This includes the updates we posted this week, and a few other improvements from v1a:

The new power supply and voltage measurement concept are both tested and working on the new hardware. The new USB C connector is extremely solid and is a dream to solder, we’ll never look back.

Next we’ll work on getting the display going. So far it powers up and no smoke escapes.

Eagle files for v1b are in the git repo. Follow development of v1c in the forum.

Bus Pirate: Reclaiming the Vpullup pin

The Bus Pirate Vpullup pin supplies a voltage to the on-board pull-up resistors. In the “Ultra” hardware it also powers the external half of the bi-directional IO buffer.

  1. MOSI
  2. CLOCK
  3. MISO
  4. CS
  5. AUX
  6. AUX2 (formerly ADC)
  7. Vpullup
  8. AUX4 (formerly 3.3Volts)
  9. 0.8-5.0Vout (formerly 5.0Volts)
  10. GND

So far we’ve added voltage measurement to every IO pin and removed the dedicated ADC pin. We also replaced the fixed 3.3volt and 5volt power supplies with a single programmable output power supply (Vout) capable of 0.8-5.0volts output at 300mA. Today we’re going to reclaim the Vpullup pin and dig into the on-board pull-up resistor system.

On-board pull-up resistors

Many common buses like I2C and 1-Wire won’t work at all without pull-up resistors. Pull-up resistors are also commonly used in voltage level translation. The Bus Pirate can only directly interface at 3.3volts, but using open drain outputs with pull-up resistors it can interface with devices running at 2-5.5volts.

The Bus Pirate has on-board pull-up resistors on the four main bus pins (MOSI, CLOCK, MISO, CS) of the IO header. The pull-ups are toggled in the terminal with the P/p commands.

MOSI is used in the 1-Wire protocol. Several 1-Wire devices are parasitically powered from the pull-up resistor and require no additional power supply. These devices typically require a lower value pull-up resistor than other buses. The Bus Pirate has a 2K pull-up resistor on MOSI to properly power 1-Wire devices, while the other pins have 10K pull-up resistors.

74HCT4066 analog switch applies Vpullup voltage to a resistor attached to MISO pin.

The Vpullup voltage is switched onto the pull-up resistors through a 74HCT4066 analog switch. This is an effective solution, but there’s an annoying waste of pins when the 4066 is used this way.

Merge the Vpullup functions into the Vout pin

Pull-up source select on v5 prototype.

In the past it made sense to have a dedicated Vpullup pin so the user can connect it to one of the two on-board power supplies (3.3volts, 5volts), or the supply of an external circuit. We tried to automate this from the terminal in various prototypes using FETs, analog switches and other methods.

Since we’ve combined the on-board supplies into a single Vout pin, let’s also power the pull-up resistors and bi-directional IO buffer the Vout pin. The Vout/Vref pin now has two uses:

  1. Programmable power supply output from 0.8-5.0volts that powers the IO buffers and pull-up resistors (when enabled)
  2. Voltage reference input that powers the IO buffers and pull-up resistors (when enabled) from an external supply (e.g. self-powered breakout board)

We lose the ability to run the pull-up resistors and the programmable output power supply at different voltages. This could matter when Vout is used as the external supply for a board with its own voltage regulator.

Adjustable pull-up/down resistors?

MCP44X2 I2C digital quad rheostat. Source: MCP44X2 datasheet page 1.

This is definitely overkill, but let’s go “Ultra” for a moment. MCP4442-10K is an I2C controlled digital rheostat with 4 10K resistors. Each resistor can be disabled or connected to 127 taps between 10K and 0R.

Unfortunately we run into pesky bandwidth issues again, the same reason we couldn’t use this chip in the programmable output power supply. The 10K version of the MCP4442 only has 1MHz of bandwidth, which means the maximum speed the internal circuit can adjust to changes in signals. A lot of common buses support speeds above 1MHz. Linear Devices has several precision digital pots with much higher bandwidth, but they’re far too expensive to justify replacing the current cheap and dirty setup.

Updated pinout

  1. MOSI
  2. CLOCK
  3. MISO
  4. CS
  5. AUX
  6. AUX2 (formerly ADC)
  7. AUX3 (formerly Vpullup)
  8. AUX4 (formerly 3.3Volts)
  9. 0.8-5.0Vout/Vref (formerly 5.0Volts)
  10. GND

With the Vpullup pin features safely tucked into the Vout pin, we can add an eighth general purpose IO pin to the header (AUX3). Vout is renamed Vout/Vref to identify its dual power output and reference input functions.

The final thing to do is add a second 4066 so all 8 IO pins have a pull-up resistor.

Next time we’ll try to find a better way to label the IO header pinout. If you want to skip the wait, our latest work is in the forum.

BUS PIRATE: 0.8-5.0volt programmable output power supply

  1. MOSI
  2. CLOCK
  3. MISO
  4. CS
  5. AUX
  6. AUX2 (formerly ADC)
  7. Vpu
  8. 3.3V
  9. 5.0V
  10. GND

After adding buffered voltage measurements to every IO pin, we eliminated the dedicated ADC pin and turned it into a general purpose IO (AUX2). Now we’re going to take a hatchet to the on-board voltage regulators (3.3V, 5.0V) and replace them with a robust programmable output power supply.

Power supplies background

On-board power supplies are toggled with w and W.

The Bus Pirate has two on-board voltage regulators that can power a board or chip. The supplies are enabled with the W and w commands. The Bus Pirate supplies the two most common voltages through two dedicated pins because it was the simplest approach and it “just works”.

3.3volt and 5.0volt on-board power supplies.

The Bus Pirate has always had a 5volt regulator because so much hobby electronics stuff like the Arduino runs at 5volts. 3.3volts is very popular in more modern systems, such as the Bus Pirate itself. However, there’s no reason you couldn’t swap those regulators with a compatible part with output in the 0-5volt range.

Common SOT-23-5 LDO regulator with shutdown pin. Source: MCP1801 datasheet page 1.

There are tons of manufacturers of SOT-23-5 low drop out voltage regulators with a shutdown pin that use the same footprint and have somewhat similar specs. We specify the Microchip MCP1801 in new designs.

Programmable output power supply

5volts and 3.3volts are useful voltage nodes for everyday hacking. A more useful power supply would be programmable from the terminal, and cover as wide a range as possible ( 0.8, 1.2, 1.8, 2.5, 3.0, 3.3, 5.0volts).

There are a few ways to concoct a programmable supply. A simple buck converter driven by a PWM pin with feedback through an ADC is a very cheap solution, but it has no safety features whatsoever. A dedicated buck converter chip is a better option, but still has the potential to be a big source of noise on the board.

MCP1824 adjustable output LDO. Output set by R1 and R2. Source: MCP1824 datasheet page 3

Ideally, we’d like to abuse an adjustable low drop out regulator because they have very clean output with built-in current protection, short circuit protection and thermal protection. MCP1824 is adjustable from 5volts all the way down to 0.8volts, the output voltage is set by feedback resistors R1 and R2. One way to make the output programmable is an array of different resistor values selected (grounded) by an IO expander or MCU pin. This would give steps, but not the full range.

Another option is a digital potentiometer or rheostat. In our experience it’s difficult to satisfy the feedback/adjust requirements of most LDOs while also getting a usable range of output voltages using a digital pot. Additionally, digital pots have very low bandwidth and inexpensive chips like the MCP444x are unsuitable for this purpose.

Output from U14 margins the adjustment voltage of IC12 through R30, R31, R32.

Texas Instruments has a video and tutorial explaining how to offset (or margin) the feedback voltage of an LDO using an op-amp driven by a Digital to Analog Converter or Pulse Width Modulator. It just so happens our STM32F103 has two DACs. The DACs have an optional internal buffer, but the internet suggests it’s not really rail to rail.

The output of the DAC is applied to the non-inverting input of an op-amp. The op-amp output margins the feedback voltage on the MCP1824 ADJ pin through R30, R31, R32. The values for the resistors were calculated to give 0.8-5.0volt output range with 0-3.3volt DAC output.

Always use protection

PFET Q2 acts as a diode to protect the power supply.

The output of the adjustable regulator goes into a nifty little circuit (Q1, Q1B, Q2, R34, R35) that acts like a diode but has negligible voltage drop. A PFET (Q2) is used as an ideal diode to stop current backflow if an external power supply is present.

Updated pinout

  1. MOSI
  2. CLOCK
  3. MISO
  4. CS
  5. AUX
  6. AUX2 (formerly ADC)
  7. Vpullup
  8. AUX4 (formerly 3.0Volts)
  9. 0.8-5.0Vout (formerly 5.0Volts)
  10. GND

Both on-board regulators (3.3, 5volts) could be swapped with programmable output power supplies, but that seems like overkill. Pin 9 becomes a 0.8-5.0volt power supply named Vout, while pin 8 is now available for general purpose IO and is renamed AUX4.

We have very nearly reached our goal of 8 IO pins! Next we’ll rethink the Vpullup pin and the on-board pull-up resistors. If you want to skip the wait, our latest work is in the forum.

BUS PIRATE: Voltage measurement on every pin

Bus Pirate Ultra v1a follows the same pinout as previous versions. 5 I/O pins (MOSI, CLOCK, MISO, CS, AUX), a voltage probe (ADC), a voltage source for the on-board pull-up resistors (Vpu), two power supplies (3.3, 5.0volts) and ground. While we were building the prototype it became obvious that a few tweaks could make a much more useful tool.

  1. MOSI
  2. CLOCK
  3. MISO
  4. CS
  5. AUX
  6. ADC
  7. Vpu
  8. 3.3V
  9. 5.0V
  10. GND

This is the starting pinout. In this post we’ll update the voltage/ADC probe to measure voltage on every IO pin, and free up a pin for general purpose use.

Measuring voltage with the Bus Pirate ADC pin.

The voltage probe (ADC pin) is useful for checking the output of a digital to analog converter (DAC), verifying a supply voltage, or almost anything you’d do with a multimeter. The d command takes a single voltage measurement, while the D command takes continuous measurements.

Problems with the resistor voltage divider approach

The Bus Pirate runs at 3.3volts, but we still want to measure within the most common 0-5.0volt range used in hobby electronics. To bring the voltage into range, the Bus Pirate uses two 10K resistors to divide the measured voltage in half. Now we can safely measure a voltage in the range of 0-6.6volts using an analog digital converter with a maximum input of 3.3volts.

This is a super effective and simple approach, but it adds a 20K resistive load to the pin at all times. This load makes the pin less useful for digital IO, so the ADC has always been a dedicated pin without any other functions.

Adding a unity gain op-amp buffer

Input from IO_PIN is buffered by the op-amp and then divided in half for ADC1.

One obvious way to eliminate the load on the ADC pin is to buffer the voltage divider with an op-amp. The op-amp input is extremely low impedance and has negligible impact on the signal we’re measuring.

An MCP6001 is a cheap general purpose op-amp (U15) with common mode voltage that extends 0.25volts beyond the power and ground rails. Using it in a unity gain configuration buffers the input voltage (IO_PIN), which then goes through the voltage divider (RN3D, RN3C) to be measured by the ADC (ADC1). A few current limiting resistors and protection diodes suggested in the datasheet help ruggadize the op-amp for abuse during hacking.

Voltage measurement on every IO pin

A 74HCT4051 analog multiplexer selects which IO pin connects to the op-amp.

Without that nasty 20K load the ADC pin can be a general purpose digital IO. While we could dedicate an op-amp and ADC to measure each IO pin, that’s a lot of routing and resources. Instead, each IO pin connects to a 74HCT4051 8:1 analog multiplexer that selects which IO pin to measure with a single op-amp and ADC.

Three FPGA pins select one of the 8 analog inputs to measure. The FPGA is in control, rather than the MCU, so that we are ready to add an external high-speed ADC in the future.

Updated pinout

  1. MOSI
  2. CLOCK
  3. MISO
  4. CS
  5. AUX
  6. AUX2 (formerly ADC)
  7. Vpullup
  8. 3.3volts
  9. 5.0volts
  10. GND

Using a single analog mux and op-amp we can measure the voltage on every Bus Pirate IO pin. The dedicated ADC pin is cast into the dustbin of history, and we gain a new digital pin that we’ll call AUX2 for now.

Taking it further

1 x 10P connector on v1a (1)

6 IO pins is definitely better than 5. Wouldn’t it be great to have even more? Our goal is to get to 8 digital IO pins. That’s enough to interface nearly any serial bus, and it’s the logical number of channels for a proper logic analyzer.

At the same time, we’d like to stick with the 2.54mm 10 pin IO header (1) we’ve been using in recent prototypes. It fits common jumper cables we have in the parts box, but could also accept a nice keyed custom cable.

Next we’ll rethink the function of the on-board power supplies and pull-up resistors. To skip the wait, see our most recent progress in the forum.

DIY wireless temp/humid/pressure sensors for measuring vacuum sealed 3D printed filament containers

Scott M. Baker writes:

I made some wireless sensors, using BME280 temperature, humidity, and pressure sensors, together with SYN115 transmitter modules. I used these to verify the storage of vacuum sealed “PrintDry” 3D filament storage containers.

See the full post on his Scott M. Baker blog.

Check out the video after the break.

App note: Inductive switching for dual 24 and 36 V High-side switch families (XS4200 and XSD200)

Another app note from NXP describing the behavior of the SMARTMOS Dual 24 – 36 V high-side switch devices, at switch OFF when driving inductive loads. Link here (PDF)

These intelligent high-side switches are designed to be used in 24 V systems such as trucks and busses (XS4200). They can be used in industrial (XSD200) and 12 V applications as well. The low RDS(on) channels can control incandescent lamps, LEDs, solenoids, or DC motors. Control, device configuration, and diagnostics are performed through a 16-bit SPI interface, allowing easy
integration into existing applications.

App note: Repetitive short-circuit performances of the MC12XS6 IC’s family

App note from NXP about the short-citcuit protection strategies of their MC12XS6 centralized automotive lighting drivers family IC. Link here (PDF)

The MC12XS6 devices include up to five self-protected high-side switches, with its extended protection and diagnostics, to detect bulb outage and short-circuit fault conditions. Additionally, this device incorporates a pulse width modulation control module, to improve lamp lifetime with bulb power regulation at no less than 25 Hz, and address the dimming application (daytime running light).