Skip to main content
Topic: Bus Pirate v4 hardware test firmware (Read 14090 times) previous topic - next topic

Bus Pirate v4 hardware test firmware

Bus Pirate firmware v5.9 running on the new Bus Pirate v4 hardware with direct PIC USB connection. (image attached)

It's crazy slow because USB support is hacked into replacements for the existing serial port functions.

Nothing is tested yet, lots of things won't work because of the USB connection.

This shouldn't interfere with the v3 source, so I'll check it in to the trunk in SVN.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #1
More sourcy goodness in SVN.

*Moved to interrupt-based USB service routines
*Fixed all display garbage
*Updated source for v4 with new defines
*All prompts work, no more hanging USB

Next:
*Decrease timer1 to make the display faster
*double check pin and ADC connections (self-test fails)

I'll try to have a 'working' v4 alpha by the v5.9 release :)
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #2
Great!!

Re: Bus Pirate v4 hardware test firmware

Reply #3
Congratulations, your next post will be 1000! Biertje!
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #4
Well let me post my 1000th post it in this memorable topic!

Cheers All! ;)

Re: Bus Pirate v4 hardware test firmware

Reply #5
Code: [Select]
HiZ> ~
Disconnect any devices
Connect (Vpu to +3.3V) and (ADC to +5V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP H OK
VREG OK
ADC and supply
Vusb(4.89) OK
5V(5.01) OK
ADC(4.92) OK
3.3V(3.28) OK
VPU(3.28) OK
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE, VREG, and USB LEDs should be on!
Any key to exit
Found 0 errors.
HiZ>

v4 passes self test :)

Next:
1. Add new pin defines and init functions
2. Add commands for new features
3. inward-facing I2C mode to check out that the on-board eeprom is working.

Any ideas for #2? We need commands for:
3.3volt pullup source
5volt pullup source
Aux 2 and 3?

I noticed that the USB LED is connected like it was on the FTDI chip (to power, grounded by PIC). We should fix that before the final version.

Want to send back your v4? I'll solder it for you :)
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #6
If you want ;) I don't seem to have the time for it (too many other DP projects ;))

I would add a simular options like c/C. for selecting AUX2/3 otherwise it would break lots of existing demosntrations.

For pullup selection P0, P1 and P2 ? where P is the same as P0?

The following menuoptions are still available: e, j, k, n, q, t, x, y, z (I looked quickly at the source)

Re: Bus Pirate v4 hardware test firmware

Reply #7
Code: [Select]
HiZ> m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)

(1)> 4
I2C mode:
 1. Software
 2. Hardware

(1)> 2
Set speed:
 1. 100KHz
 2. 400KHz
 3. 1MHz
(1)>
Ready
I2C> (3)
Now using on-board EEPROM I2C interface

I2C> (1)
Searching I2C address space. Found devices at:
0xA0(0x50 W) 0xA1(0x50 R) 0xA2(0x51 W) 0xA3(0x51 R) 0xA4(0x52 W) 0xA5(0x52 R) 0x
A6(0x53 W) 0xA7(0x53 R) 0xA8(0x54 W) 0xA9(0x54 R) 0xAA(0x55 W) 0xAB(0x55 R) 0xAC
(0x56 W) 0xAD(0x56 R) 0xAE(0x57 W) 0xAF(0x57 R)

I2C> (4)
On-board EEPROM write protect disabled

I2C> [0xa0 0 0 1 2 3 4 5 6 7]
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
WRITE: 0x00 ACK
WRITE: 0x01 ACK
WRITE: 0x02 ACK
WRITE: 0x03 ACK
WRITE: 0x04 ACK
WRITE: 0x05 ACK
WRITE: 0x06 ACK
WRITE: 0x07 ACK
I2C STOP BIT
I2C> [0xa0 0 0 ]
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C> [0xa1 r:8]
I2C START BIT
WRITE: 0xA1 ACK
READ: 0x01  ACK 0x02  ACK 0x03  ACK 0x04  ACK 0x05  ACK 0x06  ACK 0x07  ACK 0xFF

NACK
I2C STOP BIT
I2C>

On-board EEPROM is working, as is hardware I2C (both for EEPROM and external).

Added macros (3) that makes the I2C mode point to the on-board EEPROM.
Added macro (4) that disabled EEPROM write protect

Need to add EEPROM and pull-up check to the self-test (auto pullup select too, no need for Vpu jumper in self test any more).
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #8
Code: [Select]
HiZ> ~
Disconnect any devices
Connect (ADC to +5V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP H OK
VREG OK
EEPROM
SCL OK
SDA OK
WP OK
ACK OK
ADC and supply
Vusb(4.88) OK
5V(4.99) OK
ADC(4.92) OK
3.3V(3.28) OK
VPU(3.28) OK
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE, VREG, and USB LEDs should be on!
Any key to exit
Found 0 errors.
HiZ>
Added functions and self-check for on board EEPROM

Going to add pullup voltage select next, then will use that as part of the self-test, eliminating the Vpu jumper :)
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #9
Must be resistor tolerance, but I don't understand why VUSB is lower than 5volts :0
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #10
Code: [Select]
HiZ> ~
Disconnect any devices
Connect (ADC to +5V)
Space to continue
Ctrl
AUX OK
MODE LED OK
PULLUP H OK
PULLUP H OK
VREG OK
EEPROM <<<EEPROM check
SCL OK  <<<pins
SDA OK
WP OK
ACK OK <<test reply to address
ADC and supply
Vusb(4.88) OK <<<USB supply
5V(4.98) OK
ADC(4.93) OK
5V0 VPU(0.00) FAIL <<<5v pullup select broken on this prototype
3.3V(3.28) OK
3V3 VPU(3.28) OK <<<3.3volt pullup works though
Bus high
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1
MOSI OK
CLK OK
MISO OK
CS OK
MODE, VREG, and USB LEDs should be on!
Any key to exit
Found 1 errors.

Added test for on-board pullup voltage select. Now uses the on-board pullup voltage selector to test the vpu too (eliminate that jumper during self-test).

Next I'm going to add the P/P0/P1 (P3/P5?) command, then it's 'done'.

Some future features will be:
*saving settings in the EEPROM
*entering modes automatically using EEPROM settings (including STK500v2 programmer mode)
*Direct LCD interfacing
*extra AUX pin controls (A1/a2/@2?)
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #11
On-board pullup resistor voltage select in action
Code: [Select]
1-WIRE> W
Power supplies ON
1-WIRE> E3
3.3volt on-board pullup votlage enabled
1-WIRE> E5
5.0volt on-board pullup voltage enabled
1-WIRE> e
On-board pullup voltage off
1-WIRE> v
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     -       OWD     -       -
P       P       P       I       I       I       I       I       I       I
GND     3.28V   5.01V   0.00V   0.00V   L       L       L       L       L
1-WIRE> E3
3.3volt on-board pullup votlage enabled
1-WIRE> v
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     -       OWD     -       -
P       P       P       I       I       I       I       I       I       I
GND     3.28V   5.02V   0.00V   3.28V   L       L       L       L       L
1-WIRE> P
Pull-up resistors ON
1-WIRE> v
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     -       OWD     -       -
P       P       P       I       I       I       I       I       I       I
GND     3.28V   5.00V   0.00V   3.28V   L       H       H       H       H
1-WIRE>
Turning on one always disables the other.

I used E3/E5 for 3.3 adn 5.0, and e to disable (though any error option also disabled).
Code: [Select]
1-WIRE> E3
Warning: already a voltage on Vpullup pin
3.3volt on-board pullup votlage enabled
1-WIRE>
It checks if there is already a pullup voltage on the Vpu pin and warns if there is.
Got a question? Please ask in the forum for the fastest answers.

Re: Bus Pirate v4 hardware test firmware

Reply #12
Good work!!

I'm still a bit afraid if we don't break some compatibility with older releases, when we implement a2 as AUX2. the old version will pull a low and send 2 on the bus.

I think (but it is cumbersome!!) a 'c'-like command is better fro backwardcompatibility:

Code: [Select]
> j2 a
AUX2 selected
AUX low

Re: Bus Pirate v4 hardware test firmware

Reply #13
Here's the first BPv4 firmware :) r529 has lots of fixes to the hardware profile of v3 and v1a to keep everything compiling well.

It reads (and recognizes) the DEVID and REV ID

reading config words causes a reset, so it's only reading a lower page for now.

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

Re: Bus Pirate v4 hardware test firmware

Reply #14
I noticed the power is behaving odd in UART and SPI mode. In UART mode it is always on and in SPI it think there is a short.

I made the 'e' command more in line with the other menu:

Code: [Select]
1-WIRE> e
Select Vpu source
 1) None or external
 2) Onboard 3V3 Vreg
 3) Onboard 5V Vreg

(1)> 1
on-board pullup voltage disabled
1-WIRE> e 2
3V3 on-board pullup voltage enabled
1-WIRE> e 3
5V on-board pullup voltage enabled
1-WIRE> e 1
on-board pullup voltage disabled
1-WIRE>

and showed the VPu state in the 'i' menu:

Code: [Select]
Bus Pirate v4
Firmware v5.9 (r528)
DEVID:0x1009 REVID:0x0003 (24FJ128GB106 A5)
http://dangerousprototypes.com
CFG1:0x7D62 CFG2:0x3F73
*----------*
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     -       OWD     -       -
P       P       P       I       I       I       I       I       I       I
GND     0.00V   0.00V   0.00V   0.00V   L       L       L       L       L
Power supplies OFF, Pull-up resistors OFF, Vpu=3V3, Open drain outputs (H=Hi-Z, L=GND)
MSB set: MOST sig bit first, Number of bits read/write: 8
a/A/@ controls AUX pin

*----------*
1-WIRE>

I haven't editted the textes yet, but some textes can be shortened to make it nice, and others needs to be added into the textsystem;) But he?! space isn't an issue anymore :P

Changes are in the svn.