This simple example shows how to use the MAC Symbol Counter Driver(MACSC) to use the MAC symbol counter as a timer/counter.
The MACSC driver can be found here.
All megaRF devices with an MACSC can be used.
The example will configure the MACSC module and back-off slot counter It will use all three MACSC compare interrupts,overflow, and back-off slot counter interrupts.
The MACSC and backoff slot counter is setup to generate overflow interrupt(every 19 hours) and back-off slot interrupt every 320 microseconds. Compare channel 3 interrupt is set to occur every one second(CONFIG_MACSC_TIMEOUT_TICK_HZ). Compare Channels 1 and 2 will be setup at 1/4 and 1/2 of the CONFIG_MACSC_TIMEOUT_TICK_HZ period.
Each callback interrupts functions are setup to toggle a IO pin.
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.