djphazer / O_C-Phazerville

The kitchen sink of O_C firmware - do all the things!
http://firmware.phazerville.com/
243 stars 37 forks source link

Add FreqMeasure driver for Teensy 4.1 #87

Closed PaulStoffregen closed 3 months ago

PaulStoffregen commented 4 months ago

Can support 4 instances. Tuner applet still uses only 1.

image

image

PaulStoffregen commented 4 months ago

Opps, I left a few Serial.print() in the code. Please delete or comment them out.

djphazer commented 3 months ago

This has been merged in for v1.8 - https://github.com/djphazer/O_C-Phazerville/commit/1dd4b17381866aaf856237a565068720353bb1d5

Along with some follow-up commits: https://github.com/djphazer/O_C-Phazerville/commit/208ae72250c6bc8a982c20e69c26a0ebd751abdd https://github.com/djphazer/O_C-Phazerville/commit/3b4389876d0ec8f5741d80dadc64f9d5415a1207

T4.0 works fine for TR1/TR2 (pin 0/1) but not for TR3/TR4 (pin 2/3)
It will work for pin 23/22 but those are connected to the encoders on
original hardware. I imagine the driver code needs different parameters
for FlexPWM to work on pins 2/3 instead (or maybe QuadTimer will also
work on pins 2/3), but I can't swim through the data sheets to figure it out!

Basically, Teensy 4.0 might need more attention if we want TR3/TR4 to work, but this is more than satisfactory!