I’m tring to use nano-every board to make a small frequency meter and pulse meter. For this I’m using TCBn counters and EventSys to route input signal.
After some test I have some results, but tere is something I’m not able to understand, and I think it will be very uncomfortable if I try to make more complex program:
- If I route PORTC pin 4 (4 and 6 works too), using CHANNEL3, I can use the signal on TCBn as USER 2
EVSYS_CHANNEL3 = 0x44;//EVSYS_GENERATOR_PORT0_PIN4_gc; //0x44-46 portC 4-6 ; 0x4D-E port D 5-6 EVSYS_USERTCB0 = 1 << 2;
- I’tried to route it in other channels and I’ve never been able to have something working. I think I’ve tried all combination CHANNEL/USER and the only one working is CHANNEL3/USER2
I’ve attached full code as .zip. It needs pulse generator to work (in my case it’s a RPi). I also use I2c to change EVSYS routes without reload program, but it’s not needed to make some tests, just change variable values at init and reload program.
TCB_EVSYS.zip (3.16 KB)