SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By liziyuanhaha
#180911
I am trying to use SparkFun SPI Shortcut 9235 to talk to an Optical Flow Sensor board, which could be found at
http://store.3drobotics.com/products/op ... low-sensor

I did connect all the pins, and changed the mode to 4 as needed in the document for the sensor, which could be found at
http://people.ece.cornell.edu/land/cour ... s_3080.pdf

However, I just do not know how to use this shortcut to talk to the sensor.

The Product_ID register address is 0x00, whose default value is 0x17; and I never got that value from the shortcut.

Here is the command string I tried:
CH CL RR 00 RR DY RR CH
CL 00 RR CL DY DY RR CH
CL 00 RR 00 RR DY DY 00 RR 00 DY CH
...

And whatever methods I tried, I can only receive 0x00 as results.

Could anyone tell me, how could I get the Product_ID default value 0x17 from the optical-flow-sensor?

Thank you!
By ktoneread
#181217
Have you tried to run its example with the audio decoder or pressure sensor or something simple? It may be possible your SPI shortcut is defective. From the datasheet, it seems easier to send commands given the user interface out of the box.
By liziyuanhaha
#181240
ktoneread wrote:Have you tried to run its example with the audio decoder or pressure sensor or something simple? It may be possible your SPI shortcut is defective. From the datasheet, it seems easier to send commands given the user interface out of the box.
Sorry, I did not try its example:
1. I don't have its product.
2. Seems there is no example teaching us how to read value of a register of certain address.
By n1ist
#181303
SPI itself doesn't have any concept of "reading a register of a certain address". It only shifts bytes out and in. According to the sensor data sheet, to read register 0, you need to clock out the 8 bit address, and then clock out 8 more times, reading in the data. It also says you need to wait 50µs (75µs for register 2) between the address and data part.

I would try
CL 00 DY RR CH

/mike
By liziyuanhaha
#181367
n1ist wrote:SPI itself doesn't have any concept of "reading a register of a certain address". It only shifts bytes out and in. According to the sensor data sheet, to read register 0, you need to clock out the 8 bit address, and then clock out 8 more times, reading in the data. It also says you need to wait 50µs (75µs for register 2) between the address and data part.

I would try
CL 00 DY RR CH

/mike
Thank you for thinking about this problem!

Actually I tried your recommendation, and also a lot of times like
CL 00 DY DY RR CH
CL 00 DY DY RR RR CH
CL 00 DY RR 00 DY RR CH
.....

however all I can get is just Rx=0x00