pimoroni-pico icon indicating copy to clipboard operation
pimoroni-pico copied to clipboard

Trackball interrupt usage not clear

Open Nashenas88 opened this issue 2 years ago • 4 comments

I'm writing a port of the PIM447 trackball to rust (https://github.com/nashenas88/pimoroni-trackball-driver), and while using it I'm running into an issue with interrupts. I can get the interrupts to fire, but then after about 30 seconds or so of usage, the interrupt gets stuck triggered low. I've followed the interrupt code in the C++ code closely so I imagine it has similar behavior.

While reviewing I also noticed a possible bug since get_interrupt in the trackball driver here always returns false. It's not clear to me how change_address works since the first while loop would always hit a timeout. Are interrupts supposed to work for the trackball? If so, how do I ensure they get cleared consistently?

Nashenas88 avatar May 13 '22 17:05 Nashenas88

I believe we found a bug in the trackball firmware that affects interrupts. I'll confirm this next week and see if a fix is on the way out there.

It's nontrivial to update trackball breakouts in the field (you'd need a nuvoton programmer) so we might need to send a replacement.

Gadgetoid avatar May 14 '22 08:05 Gadgetoid

Hi, any update on this? If I do need a replacement, what process would I follow?

Nashenas88 avatar Jun 10 '22 17:06 Nashenas88

I had a firmware to test, but no way to flash it, and then a lot of Pico W happened. I'll see if we got anywhere with this.

Gadgetoid avatar Jul 22 '22 15:07 Gadgetoid

did you try the enable_interupt from here first : void Trackball::enable_interrupt(bool use_interrupt) {

alexmaloteaux avatar Sep 14 '22 06:09 alexmaloteaux

@alexmaloteaux I did the equivalent in rust here https://github.com/Nashenas88/pimoroni-trackball-driver/blob/main/src/lib.rs#L339 But the issue I see is that it gets stuck low after a while. I noticed that in the code to check in interrupt near where you link (see https://github.com/pimoroni/pimoroni-pico/blob/main/drivers/trackball/trackball.cpp#L108) the code always returns false, regardless of what the value is. I wasn't sure if this meant the code wasn't expected to work.

Nashenas88 avatar Oct 07 '22 02:10 Nashenas88

@Gadgetoid any update on this ? can you release the bin firmware for those who are ok to reprogram it ?

alexmaloteaux avatar Oct 13 '22 17:10 alexmaloteaux

I've chased this and been advised that the current stock all has the new firmware with the fix, I'll see if we can release the bin file we use. If you drop us an email to support that will help, even if it's just to give me the reminder :)

PimoroniMatt avatar Oct 20 '22 15:10 PimoroniMatt

i received a trackball with new firmware and it looks like the interrupt pin is fixed, i posted some capture on the pimoroni forum here : https://forums.pimoroni.com/t/pim447-trackball-how-to-get-a-clean-int-signal/17968/9?u=amalo

alexmaloteaux avatar Nov 06 '22 18:11 alexmaloteaux

@PimoroniMatt is there any option to swap out old hardware with new hardware?

Nashenas88 avatar Nov 06 '22 19:11 Nashenas88

@Nashenas88 Yep, we should be able to help with that - please drop an email to [email protected] !

helgibbons avatar Nov 07 '22 17:11 helgibbons

Would anyone happen to know which batch they were fixed in? I emailed support and got a replacement back in November (super cool of you BTW), but they seem to exhibit the same behavior of chatty interrupts.

image

DelusionalLogic avatar Jul 07 '23 20:07 DelusionalLogic