mrjohnk / PMW3360DM-T2QU

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

update on movements #4

Open gstoehls opened 7 years ago

gstoehls commented 7 years ago

Dear mrjohnk, I followed instructions and wired the pins on my teensy 3.2 as you say. 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

mrjohnk commented 7 years ago

Can you tell me the actual pin numbers on the Teensy 3.2 that you used per the diagram for the 3.2 version on this page: https://www.pjrc.com/teensy/pinout.html

On Wed, Oct 25, 2017 at 10:33 AM, gstoehls notifications@github.com wrote:

Dear mrjohnk, I followed instructions and wired the pins on my teensy 3.2 as you say. 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

— 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/4, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-VMohbjfUCli1TvWAKU3se5OnBZmks5sv1SwgaJpZM4QGNKB .

gstoehls commented 7 years ago

Thank you for your answer. Here's what I did:

PMW3360 --- Teensy 3.2:

RS --- not connected GD --- GND MT --- PIN(0) SS --- CS(10) SC --- SCK(13) MO --- DOUT(11) MI --- DIN(12) VI --- 3.3V

Here's a picture to illustrate the pin assignment: 31442142-b6edb65e-ae95-11e7-9bc1-5960daa80291

mrjohnk commented 7 years ago

I went over that a few times this morning, but couldn't find anything you had hooked up incorrectly. Regarding the software, did you use it without modification and did you add the SROM file as a tab inside the main sketch?

On Oct 26, 2017 3:12 AM, "gstoehls" notifications@github.com wrote:

Thank you for your answer. Here's what I did:

PMW3360 --- Teensy 3.2:

RS --- not connected GD --- GND MT --- PIN(0) SS --- CS(10) SC --- SCK(13) MO --- DOUT(11) MI --- DIN(12) VI --- 3.3V

Here's a picture to illustrate the pin assignment: [image: 31442142-b6edb65e-ae95-11e7-9bc1-5960daa80291] https://user-images.githubusercontent.com/11072395/32041185-76af7c54-ba33-11e7-955c-8bba59a8a78d.jpg

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

gstoehls commented 7 years ago

Yes, the ROM was added as a tab. The software was not modified, except for the MT pin definition. I defined it as pin 0 instead of pin 3 (as in the original file) but that didnt help, unfortunately.

Am 27.10.2017 um 01:59 schrieb mrjohnk notifications@github.com<mailto:notifications@github.com>:

I went over that a few times this morning, but couldn't find anything you had hooked up incorrectly. Regarding the software, did you use it without modification and did you add the SROM file as a tab inside the main sketch?

On Oct 26, 2017 3:12 AM, "gstoehls" notifications@github.com<mailto:notifications@github.com> wrote:

Thank you for your answer. Here's what I did:

PMW3360 --- Teensy 3.2:

RS --- not connected GD --- GND MT --- PIN(0) SS --- CS(10) SC --- SCK(13) MO --- DOUT(11) MI --- DIN(12) VI --- 3.3V

Here's a picture to illustrate the pin assignment: [image: 31442142-b6edb65e-ae95-11e7-9bc1-5960daa80291] https://user-images.githubusercontent.com/11072395/32041185-76af7c54-ba33-11e7-955c-8bba59a8a78d.jpg

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mrjohnk/PMW3360DM-T2QU/issues/4#issuecomment-339834127, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKjzi22uXXyp8e7vy2VsLm15jquBueQUks5swRz5gaJpZM4QGNKB.

jshay21 commented 5 years ago

@mrjohnk I am facing issues also trying to get x and y values. I am using Teensy 3.2, have the pins set correctly (checked 5 times), set MT to pin 0 in hardware and in code, can see red IR light, have rang and verified cables on each pin to make sure that wasn't an issue, and have tried interrupt and polling version of the example. You can see my result here with the polling version. When i move my finger over the sensor I can get some data from the y axis, and x axis does not change at all.

https://www.dropbox.com/s/5ngwazaqn4dze6q/2018-12-16_14-47-26.mp4?dl=0

Is there anything you can think of that might be wrong? I am running arduino 1.8.7 IDE

(yes, I have added the SROM and get this result

Optical Chip Initialized

Product_ID 0 10011000 98

Inverse_Product_ID 3F 10011000 98

SROM_Version 2A 10011000 98

Motion 2 10000000 80 0 )

jshay21 commented 5 years ago

I have this working on Leonardo. Everything reports fine on x and y so the issue is just with Teensy 3.2

r4dr3fr4d commented 5 years ago

I just received a Teensy 3.2 and can also confirm the exact same hookup and firmware (only changing the MOT PIn to 0 in the code) produces the same issue - initialization output looks good, but no movement reported.

r4dr3fr4d commented 5 years ago

Can also confirm that I see the -128's on the serial monitor, which can't be right. Did you ever get it working on the Teensy?

levihilton commented 5 years ago

I seem to be having a similar issue. I am working with a Teensy 3.6. The monitor shows this a the beginning

Optical Chip Initialized
---
Product_ID
0
10000000
80
---
Inverse_Product_ID
3F
10000000
80
---
SROM_Version
2A
10000000
80
---
Motion
2
10000000
80

then continues to show x = -128 | y = -128 over and over again.

My pin orientation is

VI = 3.3V between pins 12 and 24
MI = MISO0 pin 12
MO = MOSI0 pin 11
SC = SCK0 pin 13
SS = CS0 pin 10
MT = Pin 0
GD = GND

There is no light on on the sensor that I can see either. Any suggestions?

mrjohnk commented 5 years ago

Try to slow down the SPI clock. I recently had some luck with this on a Teensy LC. Here is what the SPI init would look like for that:

SPI.begin(); SPI.setDataMode(SPI_MODE3); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV128); //SPI.setClockDivider(4);

On Thu, Mar 7, 2019, 8:31 PM Levi Hilton notifications@github.com wrote:

I seem to be having a similar issue. I am working with a Teensy 3.6. The monitor shows this a the beginning

Optical Chip Initialized

Product_ID 0 10000000 80

Inverse_Product_ID 3F 10000000 80

SROM_Version 2A 10000000 80

Motion 2 10000000 80

then continues to show x = -128 | y = -128 over and over again.

My pin orientation is

VI = 3.3V between pins 12 and 24 MI = MISO0 pin 12 MO = MOSI0 pin 11 SC = SCK0 pin 13 SS = CS0 pin 10 MT = Pin 0 GD = GND

There is no light on on the sensor that I can see either. Any suggestions?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mrjohnk/PMW3360DM-T2QU/issues/4#issuecomment-470781238, or mute the thread https://github.com/notifications/unsubscribe-auth/ABG0-fG61EKGsxZfcMpBxs2-ShHBZo1Eks5vUcuHgaJpZM4QGNKB .

levihilton commented 5 years ago

That is what it is currently set at. Would increasing any of the delays in perform startup make a difference?

mrjohnk commented 5 years ago

I doubt changing those will help. You may have a wiring issue since all of the data retrieved is the same in the various start-up banner troubleshooting items. I don't see evidence of a working SPI bus. Please email me details about what MCU you are using and how you have wired up the connections between it and the sensor. Additionally, what have you set the ncs variable to, which is the slave select pin. Send a picture if you want as well. Support@MrJohnk-dot-Com

On Thu, Mar 7, 2019, 8:46 PM Levi Hilton notifications@github.com wrote:

That is what it is currently set at. Would increasing any of the delays in perform startup make a difference?

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

levihilton commented 5 years ago

I believe I have found a solution. Rather than using the following:

SPI.setDataMode(SPI_MODE3);
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(SPI_CLOCK_DIV128);

Use something like: SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE3)); I believe this slows down the clock to 2MHz, which is the max serial port clock frequency for this particular sensor according to the datasheets. I have yet to do extensive testing, but this may be a solution for those having difficulties.

r4dr3fr4d commented 5 years ago

@levihilton that seems to help with the teensy. Could you confirm or deny the behavior I describe in https://github.com/mrjohnk/PMW3360DM-T2QU/issues/22?

r4dr3fr4d commented 5 years ago

Thanks for replying btw.