Well that sure does look clean! For your rough and ready approach, how about a simple count command like this:
COUNT PORTB.1,100,W1
That will count pulses during a 100ms period. Other way to do it for more accuracy is interrupts. But as you say, you just are going to do a lookup table.
Edit:
For the accuracy you need between D and D# etc, you would need to sample for 1 second using this method. If that's too long, you would have to go with interrupts, and measure time between pulses. Another quick and dirty try might be pulsin? Not sure how well that would work on an analog signal though. Maybe you could average a few...




Bookmarks