Skip to main content

Topics

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

Topics - rozling

1
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!
2
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
3
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.01482306744session_write_close ( )...(null):0
20.01512438336ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01512439112Database_MySQL->query( ).../DatabaseHandler.php:119
40.05952577840Database_MySQL->error( ).../Db-mysql.class.php:273