Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - rozling

1
Bus Pirate Support / Re: I2C sniffing on Nintendo Wii Extensions
Sorry for the necrobump, just wondering if em ever got this working?

I'm currently trying to get talking to a DJ Hero Wii controller and am having trouble.

I have a Wii nunchuck which seems to work perfectly:

Code: [Select]
I2C>W
POWER SUPPLIES ON
I2C>[0xa4 0x40 0x00]
I2C START BIT
WRITE: 0xA4 ACK
WRITE: 0x40 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>[0xa4 0x00]
I2C START BIT
WRITE: 0xA4 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>[0xa5 r:6]
I2C START BIT
WRITE: 0xA5 ACK
READ: 0x70  ACK 0xDE  ACK 0x7F  ACK 0xDF  ACK 0xFF  ACK 0xFF
NACK
I2C STOP BIT
I2C>[0xa5 r:6]
I2C START BIT
WRITE: 0xA5 ACK
READ: 0x81  ACK 0xEE  ACK 0x3F  ACK 0xEF  ACK 0xFF  ACK 0xFF
NACK

However the DJ Hero doesn't seem so easy:

Code: [Select]
I2C>w
POWER SUPPLIES OFF
I2C>P
Pull-up resistors ON
Warning: no voltage on Vpullup pin
I2C>W
POWER SUPPLIES ON
I2C>[0x52 0x40 0x00]
I2C START BIT
WRITE: 0x52 NACK
WRITE: 0x40 NACK
WRITE: 0x00 NACK
I2C STOP BIT
I2C>[0xa5 0x00]
I2C START BIT
WRITE: 0xA5 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C>[0xa5 r:6]
Warning: *Short or no pull-up
I2C START BIT
WRITE: 0xA5 ACK
READ: 0x00  ACK 0x00  ACK 0x00  ACK 0x00  ACK 0x00  ACK 0x00
NACK
I2C STOP BIT
I2C>

As you can see it seems to go ok until I try to read the bytes and I get `Warning: *Short or no pull-up`.


Does anyone know if the DJ Hero uses 5V logic?  I don't want to power it from the BP 5V and damage it.

Voltages are as follows:
Code: [Select]
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    SCL    SDA    -
        -
P      P      P      I      I      I      I      I      I
        I
GND    3.30V  5.01V  0.00V  0.03V  L      L      L      L
        L


vOff

Pinstates:
Code: [Select]
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    SCL    SDA    -      -
P      P      P      I      I      I      I      I      I      I
GND    0.00V  0.00V  0.00V  0.00V  L      L      L      L      L

VOn:

Pinstates:
Code: [Select]
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    SCL    SDA    -      -
P      P      P      I      I      I      I      I      I      I
GND    3.30V  5.01V  0.00V  2.89V  L      H      H      H      H
2
Bus Pirate Support / Re: Sparkfun Buttonpad SPI issues
Sorry, it's actually LED 0 - I thought they were numbered 1-16.

I've been trying to put the board in configuration mode & tell it there are two connected boards - that way I can verify whether it's receiving some data.  However it's not.  I take all lines low with '[_' as Ian's tutorial says, and then with the '-^' command the board does go blank, but when I put in the '1 2' command (to say there are two boards connected) and cycle power LED 0 is still lit, so this data isn't being received (this is still at 5khz).

I tried your code with the delays too but with no joy.  I think I'll play around with that a bit more tomorrow though.  For now it's off to bed - I am going to be having nightmares about this thing!
3
Bus Pirate Support / Re: Sparkfun Buttonpad SPI issues
[quote author="Sjaak"]Does the board start ok? The manual mentions all leds red, all led green all led blue and  led0 should be white. THis will tell how many baords it thinks are connected. Writing byte when CS is low will program the number of boards. Trying sending bytes like you did could accidentically program this value.[/quote]

I should have mentioned this - yes the board self-tests like a champ every time (flashes all R, G, B then ends with one button solid white).

Quote
The datasheet states 50Khz is max, so you try a setting lower (speeding thing up is something for later ;))

Ok I've made this change...

Quote
This should do the trick (almost the same as you did):
Code: [Select]
[ %:400 /] 0xFF:16 0x00:16 0x00:16 r:16 [
I added the recommended 400us holding CS low.

Ok I've tried this code at the lower speed and still nothing - button no.1 is still lit, and doesn't flicker or anything when I send the command.  It's also delaying by 400ms instead of 400us - should I be using '&:400' or did you mean to delay in ms?  Either value doesn't work though :(

Is it better to enter the values in hex?  I've been finding decimal easier on the eye :)
4
Bus Pirate Support / Re: Sparkfun Buttonpad SPI issues
Yeah I definitely got that from the tutorial - no I've just checked & the source/user guide files on the current product page are all still dated around January/February '09, then I think your tutorial was in March '09.  I was just looking at the USB Buttonpad page and seriously considering dropping another $45+ but a) it looks like users of that board have their own issues and b) I don't want to be beaten by this!!!

I did find this blog post which is quite recent and the author has done this with multiple boards driven by an Arduino.  Unfortunately there seems to be no way to contact them from their website.  They do mention this:

Quote
You cannot hook the boards parallel to the SPI line (using separate CS lines) since the boards don’t respect the CS. They will receive data even if the CS line is down.

Which is fine but doesn't explain why mine doesn't receive data when CS is disabled!
5
Bus Pirate Support / Re: Sparkfun Buttonpad SPI issues
Argh.  Ok that looks bad I know, but I think that was a one-off due to posting at 2am :)  I'd actually tried it a good few times before to make sure, but it's definitely not working.  Here's a full session (with pullups enabled this time ;)

Code: [Select]
(1)> 7
Set speed:
 1. ~5KHz
 2. ~50KHz
 3. ~100KHz
 4. ~400KHz

(1)> 2
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)> 1
Ready
3WIRE> L
LSB set: LEAST sig bit first
3WIRE> o
 1. HEX
 2. DEC
 3. BIN
 4. RAW

(1)> 2
Display format set
3WIRE> P
Pull-up resistors ON
Warning: no voltage on Vpullup pin
3WIRE> W
Power supplies ON
3WIRE> i
Bus Pirate v3a
Firmware v5.3RC (r433) Bootloader v4.1
DEVID:0x0447 REVID:0x3042 (B4)
http://dangerousprototypes.com
CFG1:0xF9DF CFG2:0x3F7F
*----------*
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     CLK     MOSI    CS      MISO
P       P       P       I       I       I       O       O       I       I
GND     3.31V   4.92V   0.00V   4.88V   L       L       L       H       H
Power supplies ON
a/A/@ controls AUX pin
Open drain outputs (H=Hi-Z, L=GND)
Pull-up resistors ON
LSB set: LEAST sig bit first
*----------*
3WIRE> [_
CS ENABLED
CLOCK, 0
DATA OUTPUT, 0
3WIRE> /]255:16 0:16 0:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
READ: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CS ENABLED
3WIRE> <------- no reaction from buttonpad :(

So frustrating!  I try throwing the same commands at it several times in a row just in case, but no joy.  Interestingly disabling CS and then sending the data like so:

Code: [Select]
3WIRE> /[255:16 0:16 0:16 r:16]
CLOCK, 1
CS ENABLED
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
READ: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CS DISABLED
3WIRE>

will cycle through columns all-on, and occasionally all buttons all-on with a slightly reduced brightness.  Actually this has the same effect no matter what value the Red, Green or Blue part of the set have, e.g.

Code: [Select]
/[0:16 255:16 0:16 r:16]

edit - just to mention I did have a read through those two articles last night (before my 2nd post) and think I know what the two output modes/pullup resistors are about now.  Thanks for your patience!
6
Bus Pirate Support / Re: Sparkfun Buttonpad SPI issues
Ok, I've been doing some reading and I think I can safely say the answer to my own ^ questions are yes.  And I'm embarrassed to say I've only just noticed this line in your tutorial Ian:

Quote
The board runs at 5volts, so we powered it from the Bus Pirate’s on-board 5volt power supply. The SPI interface operates at 5volt logic levels, so we connected the Bus Pirate’s pull-up resistors to the 5volt power supply and enabled them on all signal lines.

I think at first I wasn't sure what it meant so had just glazed over it with the intention of coming back - I think when I saw the output type option the terminal I presumed it the voltage was provided for you or something.

So now I have:

Code: [Select]
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     CLK     MOSI    CS      MISO
P       P       P       I       I       I       O       O       I       I
GND     3.31V   4.95V   0.00V   4.92V   L       L       L       H       H
Power supplies ON
a/A/@ controls AUX pin
Open drain outputs (H=Hi-Z, L=GND)
Pull-up resistors OFF
LSB set: LEAST sig bit first
*----------*
3WIRE> o
 1. HEX
 2. DEC
 3. BIN
 4. RAW

(1)> 2
Display format set
3WIRE> [_
CS ENABLED
CLOCK, 0
DATA OUTPUT, 0
3WIRE> /]255:16 0:16 0:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
READ: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CS ENABLED
3WIRE> /]255:16 255:16 0:16
CLOCK, 1
CS DISABLED
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3WIRE> r:16[
READ: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CS ENABLED


But this still has no effect - not even a flicker, and the first button is still lit.  Check this out though:

Code: [Select]
3WIRE> /[255:16 0:16 0:16 r:16]
CLOCK, 1
CS ENABLED
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
READ: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CS DISABLED
3WIRE>
Makes my lit button a bit brighter.  Surely this board shouldn't be reading at all if CS is low?
Then more wierdness:

Code: [Select]
/]255:16 0:16 0:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
WRITE: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
READ: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CS ENABLED
3WIRE>

This gives an all-white board when AFAIK it should be all-red.   Just so confused.

[quote author="Sjaak"]answer 2: if you take a look at the waveforms (which I guess should be in the manual) you'll see what is ment. I tried to draw it in ascii. The ^ indicates when data is read. You're right about pulling sck high; it needs to be done for pulling CS high ( /[ )
[/quote]

Just so you know I'm doing '/]' here as this board has some wierdness that CS 'enables' the board at 5V, apart from when I'm messing around trying to get something to work ;)
7
Bus Pirate Support / Re: Sparkfun Buttonpad SPI issues
Thanks very much for the replies :)

Ian I should ask, when you say connect Vpu to a 5v power supply, is the BP's internal 5V supply ok or is this a no-no (this is probably a stupid question).

So the pullup resistors are there so the BP can create its own internal '1' to GND's '0'.  Does this mean if the board I was interfacing with operated at some other voltage (apart from 3.3 which I can use with the Normal output type?). I would have to send that voltage to the Vpu pin also?
8
Bus Pirate Support / Sparkfun Buttonpad SPI issues
So I bought my BP to learn how to interface with my Sparkfun Buttonpad SPI board as instructed in Ian's Hackaday tutorial, with the hopes of then handwriting an SPI for my Arduino Mega and hopefully to learn a bit more about this kind of thing in general.  Well I'm definitely learning anyway!

I've been following the tutorial very closely but I can't get jack out of the board apart from sometimes getting all buttons all-on, and sometimes a column all-on if I enter random crap like '1's or '255's or 'r:16's straight onto the 3-wire> prompt without first toggling clocks & what have you. 

Here's a typical session:

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

(1)> 7
Set speed:
 1. ~5KHz
 2. ~50KHz
 3. ~100KHz
 4. ~400KHz

(1)> 2
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)> 1
Ready

3WIRE> L
LSB set: LEAST sig bit first
3WIRE>  W
Power supplies ON <---- works fine, board self-tests & we are left with button one fully RGB lit
3WIRE>[_
CS ENABLED
CLOCK, 0
DATA OUTPUT, 0
3WIRE> /]255:16 255:16 255:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED <------ has no effect
3WIRE> /]0:16 0:16 128:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
WRITE: 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED<------ has no effect
3WIRE> r:16
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF <---- makes the single lit button considerably brighter
3WIRE> 3WIRE> r:16
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
3WIRE> 64:64
WRITE: 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02 0x40 0x02
3WIRE> .]
DATA STATE: 1CS DISABLED
3WIRE> /]255:16 255:16 255:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED <----- all LEDs lit full
3WIRE> /]0:16 0:16 128:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
WRITE: 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED <----- no effect
3WIRE> /]255:16 0:16 0:16 r:16[
CLOCK, 1
CS DISABLED
WRITE: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED <------ no effect
3WIRE> /]:16 128:16 0:16 r:16[
CLOCK, 1
CS DISABLED
CLOCK, 0
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
WRITE: 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01 0x80 0x01
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED <---- no effect
3WIRE> /]0:48 r:16[   <---- with button 2 held
CLOCK, 1
CS DISABLED
WRITE: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
READ: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
CS ENABLED <---- no effect
3WIRE>

I was trying various combinations of the above for about four hours straight yesterday :'( I have loads of questions, hope these aren't too annoying.

[hr:][/hr:]
Question 1:

[quote author="The Hackaday Tutorial"]The datasheet recommends a 400us delay between writing the color frames and reading the button data, but the Bus Pirate is slow enough that we won’t worry about that[/quote]

However:
 [quote author="The Buttonpad Manual"]The CS signal should remain high for the duration of the data set, at which point it should be brought low for a minimum of 400 μs before sending the next set of data. [/quote]

First of all wouldn't the fact that we're operating at 50khz mean that we're almost at the limit of what the Buttonpad can do?  Or should I be running at 5khz?  Regarding the bolded text, I would interpret that as meaning a delay after the entire set, including the r:16?

[hr:][/hr:]
Question 2:

[quote author="The Buttonpad Manual"]The data on the MOSI line should be read while the SCK signal is high;  [/quote]

We don't seem to be doing this explicitly in the tutorial however.  Shouldn't there be an / just before the r:16?

[hr:][/hr:]
Question 3:

I'm also wondering about this line from the tutorial:

[quote author="The Hackaday Tutorial"]The hardware SPI library only allows full byte operations which aren’t granular enough to interface the board.[/quote]

What about the newer Raw SPI mode? Would I be better off using this now?  I don't see a way to toggle the clock manually so I'm thinking not.  Is this mode mainly for scripting?  The buttonpad when it resides in my finished project will be interfacing with Ableton Live through either Live's Python API or more likely Max4Live

[hr:][/hr:]
Question 4:

My final question (maybe this should have been my first): am I crazy to want to try to eventually port this to an Arduino?  I know that's gonna entail trying to work out clock speed divisions etc, but I'm hoping the BP can at least tell me whether the Arduino is spitting out well-formatted data.

[hr:][/hr:]

Halp!
10
Bus Pirate Support / CS Enable not showing up in terminal text [fixed]
So although I've had my BP for a while just now starting to use it properly, and I've been pleased enough with my progress.

I managed to communicate in a limited way with my Sparkfun SPI buttonpad as instructed in this Hackaday tutorial.  I was able to send a single 'frame' of data to turn all of the RGB LEDs on and read the status of the switches (the 16 button status bytes were returned but aren't picking up buttonpresses at the moment).

However subsequent frames wouldn't send.  I checked my firmware version and was on (I think) a version 2.x.  Thinking this might have been the issue I successfully upgraded to 5.2

However now running the same 'initialise' code:

Code: [Select]
3WIRE> [_
CS [b]DISABLED[/b]
CLOCK, 0
DATA OUTPUT, 0
3WIRE>

produces different results. Further investigation produced:

Code: [Select]
3WIRE> [
CS DISABLED
3WIRE> ]
CS DISABLED

So where '[' would enable CS it's now disabling, so both '[' and ']' disable - this was definitely working before I upgraded. Has the syntax here changed or am I missing something really obvious?

Here's the result of a self-test:
Code: [Select]
ADC and supply
5V(5.02) OK
VPU(0.00) FAIL
3.3V(3.31) OK
ADC(0.00) FAIL
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 FAIL
CLK FAIL
MISO FAIL
CS FAIL
11
Open Bench Logic Sniffer / Re: [n00b alert] Differences between Logic Sniffer & Bus Pirate?
Maybe not the best board for me to learn about SPI on then - oh well, a challenge is always good :)

Thanks for clarifying the twiddling - I need to make sure I have the right terminology when speaking in hacking circles :D  I'll definitely be keeping an eye on the Logic Sniffer progress, to be honest as it stands both bits of hardware look like great value for the price.

Appreciate the help!
12
Open Bench Logic Sniffer / Re: [n00b alert] Differences between Logic Sniffer & Bus Pirate?
Thank you very much for the reply Ian - that definitely clears things up.  One or two things I'm still wondering:

[quote author="ian"]
You might read my parts demo of the button pad SPI, it has a funky start error that threw me off. You can find the link under the part demos on the Bus Pirate manual at dangerousprototypes.com.[/quote]I've seen that tutorial and found it very helpful in figuring out how the board works.  Is this the start error you mean:
Quote
The protocol is simple enough, but there’s one major catch. The clock line must be high before raising CS, or the bytestream will be off by 1 bit. For this reason, many hardware SPI modules won’t work with the board.  This isn’t a problem if your microcontroller lets you twiddle pins that are controlled by a hardware module, but the micros we’ve worked with don’t allow this.

[quote author="ian"]You can enter commands into a terminal interface and the Bus Pirate twiddles the pins and displays what comes back. [/quote]Actually I was confused by the 'twiddling' terminology in the buttonpad SPI article - does this just mean control a pin's output from going between logical 1 and 0?

Quote
The Bus Pirate is very useful for getting to know an unknown chip without setting up a microcotroller, implementing a protocol library, all the base stuff you have to do before you can even try to read or write a byte from a new device. The goal is to have a simple, known-working protocol implementation. Learn how it works, then try to implement it with your own microcontroller code (or steal the code from the Bus Pirate, it's public domain).
From this description it sounds like the Bus Pirate is more what I need at the moment :)

Quote
The Logic Sniffer is useful for debugging electronics by seeing what's going on between two devices.
Just wondering then, could the Logic Sniffer somehow be used as an audio oscilloscope?
13
Open Bench Logic Sniffer / [n00b alert] Differences between Logic Sniffer & Bus Pirate?
Hi, I'm just wondering if someone could tell me the main differences between the Open Logic Sniffer and the Bus Pirate?  Is it mainly resolution/speed?  I'm getting started with speaking to chips with Arduinos and am currently working with SPI, but I want something which can interface with a chip which is already in-place.

Specifically I'm trying to get my Arduino Mega to speak to a Sparkfun buttonpad SPI, and I'm finding it difficult to do without visibility at the bit level - the Hackaday article on the buttonpad was a big help but I'd like to be able to see what the authors (and the microcontrollers) are seeing.

I'm also interested in MIDI which the Bus Pirate mentions but the Logic Analyzer looks like it might be a more open-ended/powerful tool?

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.02032472432session_write_close ( )...(null):0
20.02062604024ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.02072604800Database_MySQL->query( ).../DatabaseHandler.php:119
40.06532743536Database_MySQL->error( ).../Db-mysql.class.php:273