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.
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
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
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
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!
[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):
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
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!
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
(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:
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.
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!
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.
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
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
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?
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.