jamesbowman / spidriver

SPI driver public repo
https://spidriver.com/
BSD 3-Clause "New" or "Revised" License
181 stars 56 forks source link

Command-line should have a 't' command for bidirectional transfer #8

Open jamesbowman opened 6 years ago

jamesbowman commented 6 years ago

't' should act like 'w', but print out the received bytes.

Suggested in this thread: http://gameduino2.proboards.com/thread/852/spidriver-running-gameduino3?page=1&scrollTo=2221

maxnil commented 5 years ago

Any progress on this?

0xStuart commented 3 years ago

Is that why I cant seem to get anything out of the Atmel M90E26? You have to write 8 bits, and it immediately returns 16 bits. Except I see nothing.

This is from the manual.

image

On the spidriver, I see the clock being interrupted, between flipping between write and read.

jamesbowman commented 3 years ago

This diagram looks half-duplex, so the right sequence should be:

spicl <device> s w 0x40 r 2 u
0xStuart commented 3 years ago

It operates like it's half-duplex, but the manual says full-duplex. The SCK doesn't look the same as the diagram, don't know if that's relevant.

image

jamesbowman commented 3 years ago

This looks fine - the gaps on SCK are just the inter-byte pauses.

image

Hmm, one idea... datasheet does say that it expects a '1' bit before the 7-bit register address. So changing 0x49 there to 0xc9 might work?

0xStuart commented 3 years ago

Good call. That wasn't quite it, but I got it working. I discovered I have a different chip variation to the manual. Thanks.

benner commented 1 year ago

I have same issue - I need to receive same time I'm transmitting (full duplex).