Skip to main content
Topic: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :) (Read 1614 times) previous topic - next topic

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #15
Nice. It simulates for me :)

I believe we need to split the protocol handing in the MCU into separate "compiling" and "result" functions, then we can start hooking up all the protocols.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #16
Thank you for posting. I noticed the notification email doesn't include the reply text. I'll fix that.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #17
I uploaded basic UART to the HDL repo earlier this week: https://github.com/DangerousPrototypes/BusPirateUltraHDL/tree/master/components/uart

There are OpenCore versions of these, maybe you guys can use some of these?
https://opencores.org/projects?expanded=Communication%20controller

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #18
X

I stuffed as much of the new board as I could. I don't have 2 of the chips, or any of the 0402 components.

Here's a list of changes and bugs I noticed:
  • I think it was a mistake to use the r array for the adc stuff, it's only 5% tolerance. These should be individual 1% resistors
  • r27 should change to 100k
  • R32 is 10K
  • R31 should be 99.22K, assigned 100K. Should this adjust?
  • R30 should be 77.96K, assigned 78.7K, substituted 75K (didnt have 78.7K). Should adjust?
  • R26 = 0R
  • C24=Do not populate
  • r36=0R
  • r33=0r
  • add 1uF to U14
  • D1=1n4148
  • r34=65K (I had to substitute 62K, should we adjust?)
  • r35=100K
  • Connect OE and DIR of 245 to FPGA
  • I used PFET PMV65XP as Q2
  • Vimarks "Ian solderable" SC70 footprints are amazing :) We can probably use the proper footprint on the next revision and save a lot of space
  • Need to renumber all the components. Consolidate IC/U and any other similar but different prefixes
  • C23/C29 = 4.7uF
  • I need to verify from each datasheet proper input and output caps for the three different vregs when we confirm final part numbers (All MCPxxxx?)
  • we don't have input caps on the vregs that are more than 1cm from the main input cap (3.3v, 1.2v)
  • We need to consider our power budget. MCP1801 is good for 150ma only.

@tayken you're right, we're gonna raid that so hard :) Also the icotools from icestorm developer have some really solid peripherals.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #19
  • I need to verify from each datasheet proper input and output caps for the three different vregs when we confirm final part numbers (All MCPxxxx?)
  • we don't have input caps on the vregs that are more than 1cm from the main input cap (3.3v, 1.2v)
  • We need to consider our power budget. MCP1801 is good for 150ma only.

Currently we are using MCP1824 adjustable as the Vout. Confirmed in datasheet the test conditions are 4.7uf ceramic. As low as 1uF would work, but let's go with 4.7uF on input and output.

We are using MCP1801 for the 3.3volt and 1.2volt supplies. This is a 150ma LDO with enable. We really don't need the enable, but I like the SOT-23-5 package because it gives almost twice as much contact for thermal dissipation to the PCB. It will take some before we have a realistic power budget, but I believe we should target 200-250ma on both rails for development. The other issue is the display and LEDs, that's gonna eat up a bunch (60-80mA).


MCP1700
is cheap, no enable, 250mA. The three pin sot-23 package is limiting, but there is a SOT-89 between the SOT223 and SOT23 in size. The datasheet suggests 1uF on in and out, but more on input is possible. How about 1uF on output and 4.7uF on input to keep the BOM smaller?

  • VR1 to MCP1700-33 SOT-89? 4.7uF input capacitor, 1uF output cap (C28)
  • VR2 to MCP1700-12 SOT-89? 4.7uF input capacitor, 1uF output cap (C39)
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #20
There are OpenCore versions of these, maybe you guys can use some of these?
https://opencores.org/projects?expanded=Communication%20controller

It is also an exercise for me to understand VHDL/Verilog. I also have the idea that I'm in control in making the peripheral the way I want and not optimized for a specific architecture or to emulate an existing chip. the fun stuff is flexibility of fpga (also the hard part :D)

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #21
X
The display carrier boards arrived. Fit is pretty good.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #22
Display board updates:
  • Transistor part number MMBF170

v1.0b updates:
  • Add decoupling cap to open drain buffer

Soldering 0402 is fun! Even easier than 0603! Why did I avoid it for so long?
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #23
Updated v1c PCBs are in git with most of the fixes above. Here's what we came up with in review:

*C73 should be 1uF
*VR1 to MCP1700-33 SOT-89? 4.7uF input capacitor, 1uF output cap (C28) (not VR2 for now...)
*VR2 needs the 4.7uF input cap
X
*Replace MCU ADC1 with ADS7041 connected to FPGA. Add C+R filter (C=1.5nF NPO/COG, R=25R)
*all of the chip Ux including the VRs
*logical part numbering. like e.g. in the buffer part of BPU we can name them in group like R1xx, C1xx, U1xx
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #24
We're going to handle IO pin voltage measurements with a small SPI ADC running constantly at 1MSPS.

The only other ADC measurements we have are Vusb and Vout/Vref. Vout/Vref will need to be shown on the display, so it would make sense to keep that in the FPGA too.

How about we swap the 4051 with a 4067? It's 16bits mux and only needs one additional control line. Then connect Vout and Vusb measurement to the mux? That eliminates 4 2 resistors (and 2 constant loads to ground).

@Sjaak pointed out that we are not measuring 1.2v for the self test. This should be measured from the MCU because if it is defective we wouldn't be able to measure it from the FPGA.

Also noted that there is a SC-70 version of the op-amps, and all 0.1uF caps can become 0402 at this point to save space.

*Switch 74HCT4051 with 74HCT4067
*Connect Vusb and Vout to 4067, remove connections to MCU ADC pins leave the redundant connections
*Connect MCU ADC pin directly to 1.2volt rail for measurement (no R divider needed)
*0.1uF can become 0402 as needed
*Consider sc-70 op-amps
*R805 and R806 to 50K
*Move or duplicate D200 on pin Z of the 4067

*Edit: it doesn't make sense to measure Vusb this way. It's even questionable to measure anything that might be >Vusb this way... At minimum we should clamp the input to the 4067 with a diode. Maybe move the diode protecting the op-amp to before the 4067?
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #25
X
LM4040 is a 3.0V shunt reference. We could use this for the ADC AVDD. That would give us a max of 6.0volts instead of 6.6volts. If we take 8 bit measurements from the ADC then we would have a resolution of 0.0234volts/bit vs 0.0257volts/bit. Don't know if it's worth it, but it might be "proper" :)

I assume we'll take 8 bit measurements because the 10bit ADC only has 9.x bits or real resolution, and if we have 10 things to measure (DIO1-8, Vout, Vusb) that will consume 5 of our 16bit read registers.

X

The ADC uses max 200uA AVDD at full speed, the shunt can supply 100uA (minimum) to 15mA.

Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #26
X

MCP1253 could be used to get a really solid 5v supply from Vusb, even if Vusb is above or below 5volts (4.4v-5.25 allowed by USB spec). Currently we power the 4066 (pull-ups), 4051 (4067) (analog mux), and the 2 op-amps from Vusb. I guess my concern would be ripple from the charge pump on the op-amps and analog mux.

U301 (adjustable power supply op-amp used for margining) could be powered by 3.3volts instead. We'd need to check for linearity issues close to the rails.

U201 (op-amp buffering voltage measurements) needs to be as close to 5V as possible, but powering this op-amp from either Vusb or a rippling charge pump sounds like an awful idea :) I'll think this through a little more.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #27
X

The programmable output power supply works great! 0.8 to 5.0v output with 12bits of resolution!

Code: [Select]
                        temp=askint("value", 1, 0xFFFFFFFF, 1000);
rcc_periph_clock_enable(RCC_DAC);
                        gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO4);
                        dac_disable(CHANNEL_1);
                        dac_buffer_disable(CHANNEL_1);
                        dac_disable_waveform_generation(CHANNEL_1);
                        dac_enable(CHANNEL_1);
                        dac_set_trigger_source(DAC_CR_TSEL1_SW);

                        dac_load_data_buffer_single(temp, RIGHT12, CHANNEL_1);
                        dac_software_trigger(CHANNEL_1);

                        //enable the VREG
                        gpio_set(BP_PSUEN_PORT, BP_PSUEN_PIN);
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #28
X

Voltage measurements on all pins through the multiplexer is working :) The multiplexer is controlled by the FPGA, but the MCU is still doing the analog measurement. In the next revision this will all be folded into the FPGA using the ADS7042.
Got a question? Please ask in the forum for the fastest answers.

 

Re: Bus Pirate "Ultra" v1a & v1b with ICE40 and Icestorm :)

Reply #29
I'd be interested in seeing this act as a frequency counter, for signals on the analog input.