Please login or register.

Login with username, password and session length
 

News:

Latest updates at DangerousPrototypes.com.


Author Topic: Firmware 5.2  (Read 470 times)

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 894
  • Karma: +263/-0
  • Überprutser
    • View Profile
Firmware 5.2
« on: July 04, 2010, 02:17:50 PM »
Since Ian started already releasing v5.2, I jumped also on the wagon:

I just commited r410, nothing much, but added:

- baudrate can be manually set for pcside (uart1) and protocol (uart2)
- display warning when the speed of uart2 is faster then uart1
- updated the firmware display string

here is a 'screenshot':
Code: [Select]
HiZ> i
Bus Pirate v3a
Firmware v5.2RC (r410) Bootloader v4.1
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com
HiZ> b
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value

(9)> 10
Enter raw value for BRG

(34)> 68
Adjust your terminal and press space to continue
HiZ> m 3
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value

(1)> 10
Raw value for BRG (MIDI=127)

(34)> 34
Data bits and parity:
 1. 8, NONE *default
 2. 8, EVEN
 3. 8, ODD
 4. 9, NONE
(1)>
Stop bits:
 1. 1 *default
 2. 2
(1)>
Receive polarity:
 1. Idle 1 *default
 2. Idle 0
(1)>
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>
WARNING: Possible bufferoverflow
Ready.
UART>

I haven't added a nightly or made it final since (at least) Ian also has some things to add.

I wanted to add the improved i2c sniffer posted in the forums, but there wasn't enough room for it. Prolly better to overwrite the existing one instead of using this one along with the current (dunno yet what to do)

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #1 on: July 05, 2010, 12:29:19 AM »
Here's the list of things I'm going to address after finishing the morning support rounds:
*SPI resync
*power supply short detect
*PWM/power in HiZ mode
*Unify pause/continue/reset message and function
*turn bpConfig.vregen variable to a pseudo function that reads the vregen pin state instead

In another thread someone mentioned issuing a warning in I2C if the Bus didn't match the start/stop condition (slave stuck in read, holding the bus low). That might be a good addition, I'm waiting for a little clarification though.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #2 on: July 05, 2010, 02:13:14 AM »
The latest nightly has these updates:

*Fixed text formatting after ADC and Supply in self-test
*PWM and power are forbidden in HiZ
*eliminated vpullup and vreg tracking variable, all places now test the actual pin instead of storing the state and reading it. This saved about 50 program words.

Quote
1-WIRE> w
POWER SUPPLIES OFF
1-WIRE> W
VREG failed, is there a short?
1-WIRE> W
VREG failed, is there a short?
1-WIRE>
*Power supplies are now tested 2ms after W - if they are too low (short circuit) the BP throws an error and turns them off. This might help save a circuit or two. Text should be simplified and moved to the translation file.
*moved ADC pins, self-test voltage stuff to defines in base.h (should be in hardwareprofiles)

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 894
  • Karma: +263/-0
  • Überprutser
    • View Profile
Re: Firmware 5.2
« Reply #3 on: July 05, 2010, 02:21:07 AM »
Add an 'Are you sure?' ;)

Isn't the voltage regulator protected against shortcircuit? Still 150mA could be too much for some circuits..

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #4 on: July 05, 2010, 02:29:01 AM »
Here are all the 'press to x' statements in the translation file. I'm going to try to consolidate them into a single nice function that can be reused:

BPMSG1043;1;"Press any key to exit"
BPMSG1071;1;"Sniffer, press any key to exit"
BPMSG1134;1;"Adjust your terminal and press space to continue"
BPMSG1178;1;"MODE and VREG LEDs should be on! Any key exits."
BPMSG1204;1;"UART bridge. Space continues, anything else exits."
BPMSG1206;1;"Raw UART input. Space to exit."
BPMSG1239;1;"Input monitor, any `` exits"

Another place we can save space is convert to the new LCD library. The current one uses an I2C chip and I think the new 74x595 version will be a lot simpler to code for (and faster over SPI).

--
Yes, they are protected. I guess my original thought was just to alert the user right away if there was a short. I always do Wv to power up and then check level to be sure there's no problems. adding a check at power on saves me a step, and reacts faster than I can to a problem. I changed the message slightly to "VREG too low, is there a short?", but I'm still not really happy with it.

Along the same lines I going to add a message that there's no pullup voltage. That might save us some grief :)
« Last Edit: July 05, 2010, 07:01:47 AM by ian »

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #5 on: July 05, 2010, 02:48:31 AM »
I added the vpullup check, though with the current space constraints I'm not sure it's worth it ;) We've got some thinking to do and some hard decisions to make :)

Quote
1-WIRE> ~
Self-test in HiZ mode only.1-WIRE>
1-WIRE> p
Pull-up resistors OFF
1-WIRE> P
Pull-up resistors ON
Warning: no voltage on the Vpullup pin.
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.34V   5.01V   0.00V   0.00V   L       L       L       L       L
1-WIRE>

I also corrected the line break on the self-test notice shown above.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #6 on: July 05, 2010, 03:17:17 AM »
Source cleanup. Removed lots of v0a and v2a defines (no longer supported since v3.6). Removed some v1a text warnings that are no longer needed.

Going to look at SPI resync now.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #7 on: July 05, 2010, 04:49:56 AM »
SPI sniffer now verifies start with edge interrupt (untested).  Will probably need a little more work. My changes should be about here:
http://code.google.com/p/the-bus-pirate/source/browse/trunk/source/SPI.c#317

I've got some other bloggy things to do now, so I will stop here and leave the unified pause statement open.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #8 on: July 05, 2010, 07:29:27 AM »
I didn't make a custom pause/continue/ext function. Instead, I swapped things around a bit.

I moved the agree() fuction to the base so everyone can use it, then used it with the UART bridge warning so it didn't need a custom message. Then I added a general any key to exit message and removed the individual ones from other text.

Code: [Select]
UART> (0)
 0.Macro menu
 1.Transparent UART bridge
 2. Live UART monitor
 3.UART bridge with flow control
UART> (1)
UART bridge
Reset to exit
Are you sure? n

UART> (2)
Raw UART input
Any key to exit

UART>


Quote
MODE and VREG LEDs should be on!
Any key to exit
Found 6 errors.


Code: [Select]
I2C> (2)
Sniffer
Any key to exit


I2C>


Code: [Select]
(1)>
Sniffer
Any key to exit
[

SPI>

Code: [Select]
KEYB> (1)
Input monitor
Any key to exit


KEYB>


Code: [Select]
KEYB> D
VOLTMETER MODE
Any key to exit
VOLTAGE PROBE: 0.00V
KEYB>

I messed this up the first time, but it is corrected in the current translation file (needs to be converted and inserted)

Code: [Select]
HiZ> b
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value

(9)>
Adjust your terminal and press space to continue
Space to continue
HiZ>

Any key works here, but it says space. Whatever.
Code: [Select]
HiZ> ~
Disconnect any devices
Connect (Vpu to +5V) and (ADC to +3.3V)
Space to continue

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 894
  • Karma: +263/-0
  • Überprutser
    • View Profile
Re: Firmware 5.2
« Reply #9 on: July 05, 2010, 08:36:38 AM »
I think you need to keep the 'press space' (or a particular key) in the baudrate adjustment. It is used to check if the baudrate is ok.

Quote
MODE and VREG LEDs should be on!
Any key to exit
Found 6 errors.

Could you please move this to the support forum? :P :P

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #10 on: July 05, 2010, 08:54:31 AM »
Quote
(9)>
Adjust your terminal
Space to continue
HiZ>

It will look like this.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #11 on: July 05, 2010, 10:00:13 AM »
A little more cleanup and minor feature updates.

Code: [Select]
I2C> (1)
Searching I2C address space. Found devices at:


I2C> p
Pull-up resistors OFF
I2C> (1)
Searching I2C address space. Found devices at:
Warning: *Short or no pull-up

I2C>

A slightly more compact format for the I2C address search. And if the bus starts out low it gives a warning and aborts instead of showing 256 addresses.

Code: [Select]
I2C> [
Warning: *Short or no pull-up
I2C START BIT
I2C> PW
Pull-up resistors ON
Warning: no voltage on Vpullup pin
POWER SUPPLIES ON
I2C> [
I2C START BIT
I2C>

If the bus is low (no pullups or contention) at the start of I2C start bit, then we report the error. You can also see the 'no pullup' warning in use. That should be stored as 'no volta....' and recycle the other 'warning'...

Sjaak

  • Fellow
  • Hero Member
  • *****
  • Posts: 894
  • Karma: +263/-0
  • Überprutser
    • View Profile
Re: Firmware 5.2
« Reply #12 on: July 05, 2010, 10:48:13 AM »
Quote
(9)>
Adjust your terminal
Space to continue
HiZ>

It will look like this.

I meant this message can't be a 'Press any key' You'll need to check for a particular character to be sure.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2936
  • Karma: +61/-0
    • View Profile
Re: Firmware 5.2
« Reply #13 on: July 05, 2010, 11:51:40 AM »
Yup, it does a loop looking for space currently. I thought about changing it so it looked for 'U' to be auto-baud compatible, but then I would have had to add another entry to the text file :p

Randy

  • Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Firmware 5.2
« Reply #14 on: July 05, 2010, 12:21:34 PM »
A little more cleanup and minor feature updates.

Code: [Select]
I2C> (1)
Searching I2C address space. Found devices at:


I2C> p
Pull-up resistors OFF
I2C> (1)
Searching I2C address space. Found devices at:
Warning: *Short or no pull-up

I2C>

A slightly more compact format for the I2C address search. And if the bus starts out low it gives a warning and aborts instead of showing 256 addresses.

Code: [Select]
I2C> [
Warning: *Short or no pull-up
I2C START BIT
I2C> PW
Pull-up resistors ON
Warning: no voltage on Vpullup pin
POWER SUPPLIES ON
I2C> [
I2C START BIT
I2C>

If the bus is low (no pullups or contention) at the start of I2C start bit, then we report the error. You can also see the 'no pullup' warning in use. That should be stored as 'no volta....' and recycle the other 'warning'...

Ian,

I tried 5.2r418 this morning and the I2C changes are great.  Thanks!

Randy