Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question about the pmw3610 cpi configuration. #2

Open
klesh opened this issue Oct 18, 2024 · 5 comments
Open

A question about the pmw3610 cpi configuration. #2

klesh opened this issue Oct 18, 2024 · 5 comments

Comments

@klesh
Copy link

klesh commented Oct 18, 2024

Hi, sorry to disturb you.

I am working on porting the PMW3610 driver to QMK based on your implementation on https://github.com/ufan/zmk/tree/ptdevice-refactor/app/drivers/sensor/pixart/pmw3610
Your code looks solid and the mouse movement is working.
However, the set_cpi doesn't work on my side, I checked and rewrote the code many times and it just doesn't seem to be working 😂.
I don't know what to do next, mainly because I don't know how to verify if the CPI was configured correctly, here were my thoughts:

  1. I suppose the cursor should move faster when the CPI is cranked up, but it didn't, the movement feels the same to me
  2. Or I can read the sensor register to verify, but I don't know how to do so, because the datasheet doesn't mention it at all...

I wonder if you could help me with the following questions:

  • Is set_cpi function working correctly for you? if so, is it moving faster when the CPI is higher?
  • Do you know how to read the CPI register?
  • I am designing a trackball using a snooker ball, when I roll the ball for a while, it would stop for few second then move again... like it needs a break or something, do you know why?

Here is my code if you would like to take a look:
klesh/vial-qmk@7ee1826#diff-42f431b4bc6fded6aa13af4f1b374fd634dd6b7b08f560230539a24f85e64224R236

I am posting the issue here because issues on your zmk repo is disabled, hope you don't mind, and feel free to close it if you don't like it.

Thanks in advance.

@klesh
Copy link
Author

klesh commented Oct 18, 2024

Ahh, I figured out what was wrong with the set_cpi code.

@ufan
Copy link
Owner

ufan commented Oct 21, 2024

Seems you've solved the problem. I did not test this function thoroughly. Did you mind posting a link to the corrected code?

@klesh
Copy link
Author

klesh commented Oct 21, 2024

Sure, here you are. It is working nicely on my side:
https://github.com/klesh/vial-qmk/blob/319a4dc4122595aa557ad234925175cfb327d24c/drivers/sensors/pmw3610.c#L238

And I fixed the "cursor stop moving randomly" problem by forcing the sensor into awake mode
https://github.com/klesh/vial-qmk/blob/319a4dc4122595aa557ad234925175cfb327d24c/drivers/sensors/pmw3610.c#L238

Now, It is working fine most of the time. However, the cursor movement still goes haywire(moving slowly and flicking) sometimes, and I have to reset the MUC for it to work again. 😂

@bullwinkle3000
Copy link

Hey there! Curious if you got the haywire thing addressed at all? Tested a bit on my side, and it seems to generally work well.

@klesh
Copy link
Author

klesh commented Dec 9, 2024

@bullwinkle3000 I am not quite sure, but it seems like the haywire was caused by the hardware damage. Maybe I overheated them during the soldering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants