Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MAC Symbol Counter Example 1 for ATmega256RFR2 on Xplained Pro Documentation

Introduction

This simple example shows how to use the MAC Symbol Counter Driver(MACSC) to use the MAC symbol counter as a timer/counter.

Main files:

MACSC Driver

The MACSC driver can be found here.

Device Info

All megaRF devices with an MACSC can be used.

Description of the example

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.

  • OVF_INT_CHK_PIN: Toggles on MACSC overflow interrupt
  • CMP1_INT_CHK_PIN: Toggle on Compare 1 interrupt
  • CMP2_INT_CHK_PIN: Toggle on Compare 2 interrupt
  • CMP3_INT_CHK_PIN: Toggle on Compare 3 interrupt
  • BACKOFF_INT_CHK_PIN: Toggle on backoff slot counter interrupt

Compilation Info

This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.

Contact Information

For further information, visit Microchip.