mrjohnk / PMW3360DM-T2QU

https://www.tindie.com/products/jkicklighter/pmw3360dm-t2qu-motion-sensor/
75 stars 21 forks source link

Problem with teensy #1

Open robthepaper opened 7 years ago

robthepaper commented 7 years ago

Hi, I bought the sensor on tindie and I succeeded to get the sensor to work with arduino uno but couldn't make it work with teensy 3.2. The led doesn't even lit.

The serial monitor shows : Uploading firmware... Optical Chip Initialized

Product_ID 0 11111111 FF

Inverse_Product_ID 3F 11111111 FF

SROM_Version 2A 11111111 FF

Motion 2 11111111 FF

and movement is not updated.

Can someone please help me with that?

Thanks

mrjohnk commented 7 years ago

It looks like the wiring or settings are not quite right since the output is indicating that there is no valid SPI communication taking place. I too use the Teensy to test all boards with, so it will work once the settings and wiring are right.

On the Teensy 3.2, these pins should be wired

DIN to MISO (12) DOUT to MOSI (11) CS to SS (10) SCK to SCK (13) 0 to MOT (0) 3.3V to VIN GND to GND

On Jul 6, 2017 9:59 AM, "robotpapier" notifications@github.com wrote:

Hi, I bought the sensor on tindie and I succeeded to get the sensor to work with arduino uno but couldn't make it work with teensy 3.2. The led doesn't even lit. The serial monitor shows : Uploading firmware... Optical Chip Initialized Product_ID 0 11111111 FF Inverse_Product_ID 3F 11111111 FF SROM_Version 2A 11111111 FF

Motion 2 11111111 FF

and movement is not updated.

Can someone please help me with that?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrjohnk/PMW3360DM-T2QU/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-Rs3qnb1QU9a_P88x7pJWVyR_G4Yks5sLPZfgaJpZM4OPwv1 .

gstoehls commented 6 years ago

Dear mrjohnk, I followed instructions and wired the pins on my teensy 3.2 as you say (attached picture). I receive this output on the arduino serial monitor:

Uploading firmware... Optical Chip Initialized


Product_ID 0 11010111 D7


Inverse_Product_ID 3F 11010111 D7


SROM_Version 2A 11010111 D7


Motion 2 10000000 80

But no update on movements either...

Can you help?

Regards gstoehls

image1

gagkhan commented 6 years ago

Hi gstoehls,

Did you get this working ? I am currently facing exactly the same issue. Would be great if you could share your solution.

mrjohnk commented 6 years ago

Can you provide details about what platform you are using and what pins you connected on both sides?

On Wed, Oct 11, 2017, 7:40 AM gstoehls notifications@github.com wrote:

Dear mrjohnk, I followed instructions and wired as you say. I receive this output on the arduino serial monitor: Uploading firmware... Optical Chip Initialized Product_ID 0 10100010 A2 Inverse_Product_ID 3F 10100010 A2 SROM_Version 2A 10100010 A2

Motion 2 10000000 80

No update on movements either...

Can you help?

Regards gstoehls

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mrjohnk/PMW3360DM-T2QU/issues/1#issuecomment-335796303, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-erWeWN2gJDjcbCIaGxM5sF6nFarks5srLdUgaJpZM4OPwv1 .

gagkhan commented 6 years ago

Hi mrjohnk,

I am using Teensy 3.2, and I found the issue. The set functions SPI.setBitOrder() SPI.setDataMode(mode), SPI.setClockDivider(divider) are deprecated in Arduino 1.8.5. See Teensy SPI Library . I modified the code to work with SPI.beginTransaction() and SPI.endTransaction().

gstoehls commented 6 years ago

Hi gagankhandate,

Can you share your working code?

Regards gstoehls

mrjohnk commented 6 years ago

The code that is shared is compatible with Teensy. You probably need to set the two options in the code to properly indicate which pins on your Teesy your sensor is connected to. These are:

//Set this to what pin your "INT0" hardware interrupt feature is on

define Motion_Interrupt_Pin 3 // (MOT pin)

//This is the SPI "slave select" pin that the sensor is hooked up to const int ncs = 10; // (SS pin)

If you continue to have troubles, please indicate which Teensy you are using and what pins are connected between the sensor and Teensy

On Tue, Apr 3, 2018, 6:27 AM gstoehls notifications@github.com wrote:

Hi gagankhandate,

Can you share your working code?

Regards gstoehls

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mrjohnk/PMW3360DM-T2QU/issues/1#issuecomment-378217271, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-Sh2ZV3ITSXaMTeZgFxP0fh5GXvVks5tk1yKgaJpZM4OPwv1 .

jshay21 commented 5 years ago

Hi mrjohnk,

I am using Teensy 3.2, and I found the issue. The set functions SPI.setBitOrder() SPI.setDataMode(mode), SPI.setClockDivider(divider) are deprecated in Arduino 1.8.5. See Teensy SPI Library . I modified the code to work with SPI.beginTransaction() and SPI.endTransaction().

Hi is this the solution? Did this work for you? I am facing same issues as others