Hacker News new | ask | show | jobs
by 8note 3363 days ago
You can still miss things -- you can only have so many interrupts fire at once. if all the pins change at the same time, you'll miss a few of em, especially if you're sending a serial message in the interrupt.

you're also more likely to get more than you want, and have to debounce on the processor side.

I'd go for a small fpga->ftdi usb controller. do a low pass filter on each pin, and when it goes above your threshold, throw it in a fifo that feeds the USB chip. your latency goes up with the number of changes that happen at once, but you're still using raw USB and not miss events that you're interested in.

2 comments

Don't send serial messages in an interrupt, that is crazy. Just set a flag indicating what happened (or use a queue). Then in your main loop check the flag. If the loop is not able to clear it fast enough, report it as an error. You can handle signals at 100kHz+ with such a technique.

But yes, might very well want some configurable low-pass/debouncing logic.

> I'd go for a small fpga->ftdi usb controller

Is there any specific product you can recommend for a hobbyist's project?