Internal I2C bus, DACs, individual pull-up/downs, other wishlist items

Now that we’re finally over the Bus Pirate 6 incident, I’ve been thinking a bit about the update wishlist we started over in a different thread.

If you missed that discussion, the gist is that I don’t plan to make any more Bus Pirate 6 using the RPi beta program. That gives us a bit of time to play around with some design modifications until the chips are released to the public.

This is not a replacement for Bus Pirate 6, as it simply doesn’t exists. When will this hardware be available? Never, or whenever, it’s just for fun, get a Bus Pirate 5 or 6 (while they last) for now.

  • New (or no) LED arrangement
  • Memory mapped PSRAM on QSPI bus
  • Swap RGB_DO and FLASH_CS so all 3 PIOs are in reach of the main buffer driver pins (gpio0…15)
  • Front end cleanup: rerouting, add protection to GND on the front end op-amps. Add TVS diodes to all IO pins.
  • joystick or enhanced button
  • 2gbit nand
  • TCA/PCA6416 for individually addressable pull-X in multiple values
  • Further lower the IO pin series resistors (currently 120, maybe 70ish?)
  • Move RN400 and RN401 to improve manufacturability

We currently have: 1 free pin

Memory mapped PSRAM

I think this an easy update, and the chips are cheap. It will consume 1 GPIO pin for CS.

We currently have: 0 free pins

Internal I2C bus

There is already an internal SPI bus. With an additional I2C bus we can add some simple slow speed peripherals.

Individual per-pin pull-X

image

As suggested by @electronic_eel, we can use a 16 pin PCA6416 I2C IO expander to have individually configurable pull-up and downs. These would replace the PFETs, and they’re a tiny 4x4QFN so there is space.

It makes sense from a routing perspective to use two, one on each side of the IO connector. Each pin will have 4 possible pull-X values. What should those be? I have no idea :slight_smile:

  • 1M pull-down (to replace the current fixed pin “termination” resistor)
  • 10K pull-down
  • 2K pull-up
  • 10K pull-up
  • 470K pull-up

Maybe the 1M termination resistor should stay fixed? But that would make the 470K less appealing.

It may need a shared RESET pin for reliable performance.

We now have: 1 free pin (pull-up enable), need 2 or 3

I2C DACs for power supply

Currently the adjustable power supply is driven by 2 RP GPIO PWMs. These could be replaced by a simple DAC like the MCP4725 (12 bit). That would free two IO pins, and remove an op-amp and a couple passives. It also makes me happy because I don’t like running those PWM signals across the PCB.

The trade off is these are comparatively expensive, but I need to call the scalper and see what they actually cost in the market. There are 8/10/12 bit versions, the 12 bit may add 1-2 USD to the BOM cost.

We now have: 3 free GPIOs, we need 2 or 3 (yeah!)

Prototypes

Our CAD guy seems super busy right now, so I don’t think any of this will happen soon. With your feedback though, I’d like to get the changes made to the schematic so we have something to make notes on.

2 Likes

Maybe you misunderstood me, but the resistor would go in series to the pin of the PCA6416 io-expander. So when you set the pin to output-low, you get a pulldown with the respective resistance. If you set the pin to output-high, you get a pullup with the respective resistance. So you don’t have to choose between pullup or pulldown, they go both ways.

Regarding values, how about:

  • 4.7k (this is a very common value for fast I2C busses)
  • 10k
  • 100k
  • 1M

You can enable all channels at once to parallel the resistors. This would give about 3.08k. I think this is quite good as a lower-value pull. But the values can be further optimized of course when you have a specific usecase in mind.

2 Likes

I literally just finished some code, walked the dog, realized this and immediately came here to correct that :slight_smile:

Paracidic powered 1wire devices need 2K or 1K. The ver3.x bus pirate had a 2K resistor on the OWD pin for that reason.

good idea

Maybe the TI DAC5571 is available cheaper.

It is just 8 bit, but I’d say that should suffice for the power supply. Maybe someone may want to misuse the power supply as a DAC, but it won’t perform well there because it powers a voltage regulator that can just source current, not sink it. So I’d say you are better off using one of the regular pins with PWM or PDM and a small R/C filter afterwards for all your DAC needs.

Ok, maybe you could want to do a programmed voltage sweep for something like a component tester. But even for this I’m not convinced that more than 8 bit is really worth the extra cost.

1 Like

yes, that is a good point.

So how about

  • 2.2k
  • 4.7k
  • 10k
  • 1M

Paralleling them all results in 1.3k. Paralleling just the 4.7k and 10k gives 3.2k.

This would give you a very fine granularity at the lower end and just the switchable 1M at the higher end.

1 Like

BP5 rev 0 to 7 had a TI/Microchip SPI dual DAC in msop10 that was only 8 bits. I found it to be more than enough, but 10 bits would be much be a lot more cozy. This chip is still not available again last time i checked.

Tomorrow we’ll contact gainsil who makes the opamps on the board. They have a DAC section on their website, but it’s basically the shovel and construction gif. I’d be thrilled if they have something weird we can use :slight_smile:

1 Like

I wouldn’t be surprised if they have something that fits and is even on LCSC - but you don’t find it there unless you already know the product number because their parametric search is notoriously bad for their Chinese ICs.

1 Like
  • New (or no) LED arrangement
  • Swap RGB_DO and FLASH_CS so all 3 PIOs are in reach of the main buffer driver pins (gpio0…15)

100% supporting a move to using fully side-emitting pixels. Screen readability is improved by having them all face sideways, and diffusion via the case is great. The pin change also makes sense.

If the pixels are removed … OK. They are flashy, but with the beautiful screen, and the pixels’ cost … but reserve a spot on the screen for at least one “virtual pixel” for basic status updates. :slight_smile:

  • TCA/PCA6416 for individually addressable pull-X in multiple values

I always thought it a somewhat uncomfortable restriction that this was an all-or-nothing choice. Definitely support this.

All the other items also make sense to me.

2 Likes

On slashdot or hack a day I saw SZLCSC called a purveyor of ewaste, and I can’t really disagree. They seem to take in one reel of everything a company has, sell it, and never have more.

I don’t use the English site but on the Chinese site there is a whole universe of “professionalized” websites for the various manufacturers with similar templates and parametric part searches. It’s all the same site with some CSS customizations. That gives you a good idea what they CAN make, but not really what they actually stock.

I get the impression SZLCSC is like a show room, and they have a rotating highlight of local producers who undergo this professionalization process.

There was a “maker cafe” or something connected by sky bridge to SEG building in huaqiangbei that was similar. A show room for small local manufacturers with oddball products. Limited inventory for sale, always rotating. Maybe there’s a name for it.

Then we’ll lose our customer of the month spot on the LED suppliers wall! :rofl:

It doesn’t matter the batch size, every time we run boards Bing has to take a cart and load up multiple reels of LEDs. It’s kind of ridiculous

1 Like

BTW, a component tester function would become possible with the planned new pull configuration.

If you aren’t familiar with the various hobby component testers that are sold & built, this is the documentation of the original project that sparked this from the German mikrocontroller.net forum: transistortester/Doku/trunk/pdftex/english/ttester.pdf at master · Mikrocontroller-net/transistortester · GitHub

Since the pulls on the future BP would be controlled through I2C, timing accuracy would suffer a bit. Also the BP doesn’t have a analog comparator input. But on the other hand the processor and ADC are way faster. Also there is the option to sweep the input voltage. So the measurement methods used would have to be tweaked a bit to get optimal results.

But the series resistors on the pins would have to be reduced for sure to make this work. But other than that I think it could be possible to make this work just with the BP and no external components or planks.

2 Likes

image

Pimoroni uses this 8 megabyte PSRAM. It is about half size of our flash chip, so there is actually a chance it will fit on the PCB. We’ll also reclaim a bit of keepout space on the corners with the new case.

Seems like an important note: CS should be GP0/8/19/47.

1 Like

There is a new KiCad project in the hardware repo/pcb folder for 7rev0.

Added a “Pull-X advanced resistor system” sheet with the TCA6416. This will add a little over $1USD to the raw BOM cost.

image

  • Removed the PWM buffer op-amp
  • Removed PWM low pass filter
  • Added MCP4725

This change adds about $1.50USD to the raw BOM cost.

In the past I’ve avoided such expensive components. However, we now have a low/medium/high end version so I feel a bit better about it.

image

Added the PSRAM.

image

Removed unused pins and made some notes for new pin connections.

There is another pin, current_detect, that is a digital signal currently measured through the analog mux. It is connected directly to the RP2350B, there weren’t enough pins in previous versions, but I haven’t bothered to update the code to use a system interrupt on that pin as was intended. That could be an emergency source of one more pin.

1 Like

I cloned it and have taken a look. It looks like you haven’t removed the old pullups and the fixed 1M pulldowns on each pin.

May I suggest one thing: when adding a I2C bus, there is the danger of missing a I2C bus address conflict. So I always note the I2C address of each bus member as text in the schematics. Otherwise I find it too easy to miss.

If you are still suffering from gpio pin scarcity, you could always add another TCA6416 tied to 3V3 and then hook up slow(-ish) signals to it. You could for example hook the interrupt pin to the MCU and then go crazy with buttons and/or 4-way joysticks, also all the voltage regulator enable, current limit sense/reset stuff could go there.

One thing I’ve seen not directly related to the recent changes discussed here: you run the analog mux at 5V, requiring a 74HCT245 for voltage level conversion of the control signals. But you (now) have opamps on each input channel. Wouldn’t it be easier to have the voltage dividers before the mux and use a 3V3 mux? This would remove the need for the 74HCT245 at the cost of a few more resistor-packs.

2 Likes

Thank you so much for having a look and as always, good suggestions.

I did forget to remove the 1M from the buffer, good catch. The pull ups should be removed from the schematic but I didn’t update the PCB. KiCad did crash at one point so maybe I didn’t redo that part, will check.

Yeah great point on the CD4067. We can toss the 245 which is about 1.20usd (dfn is not cheap in less than a reel, and a reel is still an investment grade reel). Eliminate the post-mux opamp maybe? And then current sense can be moved to the mux without losing resolution, freeing a pin.

The currently unbuffered signals into the amux (Vreg output, current detect, vusb) probably don’t mind the capatance of the mux and can just go through voltage dividers. Half the resistors we need are already there because of the series protection resistors for the mux that prevent back powering.

Nice. I’ll make an update. Thank you again.

1 Like

Noting that RGB_CDO still needs to be level shifted but one wuXi icore 74lvc1t45 is fraction of the cost of the name brand DFN 245.

The CD4067 is quite large on the pcb and is also not a very common IC anymore. The 74HC4051 is much more common, cheaper, also available in QFN and so on. But it is just an x8 mux.

How about using two 74HC4051 instead, with the same control signals? You’d need one more ADC pin on the MCU though, but one less control signal.

Or alternative idea: go the route of the additional TCA6416 that I mentioned above. Use one 74HC4051 for the 8 io-pins. Then free some ADC pins on the MCU and directly connect the 4 other analog signals (vusb, current_detec, vreg_out, mux_vref_vout) to ADC pins of the MCU.

1 Like

I’ll have a look. Were using a WuXi Icore cd4067 which is actually an improved hc4067 under the hood. It is bonkers cheap and we get it straight from the factory. They don’t yet make a QFN version, but they will soon. The DFN 74LVC8T45 on the 6 is their first leadless part. Also bonkers cheap compared to a nexperia part.

1 Like

But does it use the “old-school” CMOS structure that goes up to like 15 or 20V, and thus is much slower and higher resistance at the low end? “Modern” 74HC4051 are 5V max and are better suited to 3.3V than the older designs.

Ok, this doesn’t make this change a big cost saver.