Hello!
I have been using this marvelous little hardware - Bus Pirate for some days now. First of all thanks for such an awesome tool!
I had a quick question that I can't seem to answer myself.
1. How do I do a 16-bit word size SPI read? I have tried [0xFF 0xFF], but that causes a gap between the clocks.
2. Then, I tried the 3-Wire Raw option. That seems to work, BUT, whatever command I give it, it does it *twice*. I am using the Open Logic Analyzer to probe it.
For example, if I give it [0xAA55] then on the logic analyzer I see:
CS LOW
16-bit data
CS HIGH
-- some delay --
CS LOW
Same 16-bit data
CS HIGH
To give some perspective, I am interfacing with a 12-bit ADC (AD7266). It needs CS pulled low, and then 16 clock cycles to get the data out. 12-bit data is padded with 0s on wither side of MSB and LSB to make it 16-bit.
Any help is appreciated.
Thank you!
SG
16 bit isn't supported (yet), but I wanted to implement it some day. I'm surprised you get 16 bits on the bus, you did set it manually with the ';'?
For now you can use the bitread command: http://dangerousprototypes.com/docs/Bus ... with_clock (http://dangerousprototypes.com/docs/Bus_Pirate_menu_options_guide#.21_Read_one_bit_with_clock)
[!:16]
Yes I used [0xAAAA;16]. That generated 16 bits but still reads in 8.
3WIRE> [0x5533]
/CS ENABLED
WRITE: 0x33;16
/CS DISABLED
I think it is a problem with the what is displayed. For example if I do:
3WIRE> [r]
/CS ENABLED
READ: 0x00;16
/CS DISABLED
On the Logic analyzer I see that it generates 16 clocks and MOSI data as 0x00FF, but chooses to display only the 2nd byte read.
only 1-8 bits is supported. I think I forgot to sanity check the input properly.
As said before I wanted to add 16 bits read/write to raw2/3wire. I put it on my list for firmware 5.7 (if space tolerates it ;))
I ran into this problem a few days ago trying to interface an 8 input microchip 13bit ADC. It requires CS to be held low for 24 clock cycles, 4 bits of 0 are transmittted, then 5 bits for the start of conversion and input selection, then on the last 13 clock cycles the result is outputted from the chip. So I need to output 24bits while reading 24 bits.
What is the functional difference between the 16bit read and 'rr' or 'r:2' ?
@garak - I think you can enable read&write mode and send {0b0000xxxx 0bx0000000 r}, maybe also {0;4 xx;5 r;7 r} (where XX is the command). It's not super elegant, but neither is the protocol Microchip choose :)