16.6 SAM-BA Monitor

This part of the ROM code is executed when no valid code is found in any NVM during the NVM boot sequence, and if the DISABLE_MONITOR Fuse bit is not set.

The Main Oscillator is enabled and set in Bypass mode. If the MOSCSELS bit rises, an external clock is connected. If not, the Bypass mode is cleared to attempt external quartz detection. This detection is successful when the MOSCXTS and MOSCSELS bits rise, else the internal 12 MHz fast RC oscillator is used as the Main Clock.

If an external clock or crystal frequency is found, then the PLLA is configured to allow communication on the USB link for the SAM-BA Monitor, else the Main Clock is switched back to the internal 12 MHz fast RC oscillator and USB is not activated. The SAM-BA Monitor steps are:
  • Initialize UART and USB.
  • Check if USB Device enumeration occurred.
  • Check if characters are received on the UART.
Once the communication interface is identified, the application runs in an infinite loop waiting for different commands as listed in the table "Commands Available through the SAM-BA Monitor".
Figure 16-11. SAM-BA Monitor