Running the example

  1. 1.Create a new project in MPLAB® X IDE. (for ex: ATmega4808)
  2. 2.Open MCC by clicking Tools→ Embedded→ MPLAB® Code Configurator or click on the MCC icon
  3. 3.In the Device Resources panel under Libraries dropdown select CryptoAuthLibrary
  4. 4.Check below for the Notifications [MCC] tab
  5. 5.Resolve the notifications one by one. For example, in GUI select:
    • Generate Example: Tick.
    • Add UART under Foundation Services.
    • Ensure I2C Clock Frequency is 100 kHz.
  6. 6.Configure dependent Libraries.
    • For UART, enable options to Transmit. Receive and to Redirect STDIO to UART.For the rest of the settings, configure to match your preferred serial terminal settings.
  7. 7.Configure CryptoAuthLibrary GUI:
    • Device - select the type of Secure device being used.
    • 7-bit left-aligned device I2C address - provide the device I2C address as provisioned into the Secure device, meaning it is a left-aligned 7-bit hexadecimal value. Default address for ATECCx08A devices is 0xC0, while default address for ATSHA204A devices is 0xC8.
    • Wait for maximum command response time - Enable this if the preference is to wait until the Secure device is ready to respond to a command before asking for its response. Ticking this box defines the “ATCA_NO_POLL” macro in the library.
    • Print debug statements in library - Enable this if the preference is to print to a serial terminal the debug statements included in the library. Ticking this box defines the “ATCAPRINTF” macro in the library.
  8. 8.Click Generate button
  9. 9.Build and program the board.
  10. 10.Connect the Secure device of your choice.