Microchip® Advanced Software Framework

Quick Start Guide for BOD - Basic

In this use case, the BODVDD will be configured with the following settings:

  • Continuous sampling mode
  • Prescaler setting of 2
  • Reset action on low voltage detect

Quick Start

Prerequisites

There are no special setup requirements for this use-case.

Code

Copy-paste the following setup code to your user application:

static void configure_bodvdd(void)
{
struct bodvdd_config config_bodvdd;
bodvdd_get_config_defaults(&config_bodvdd);
bodvdd_set_config(&config_bodvdd);
}

Add to user application initialization (typically the start of main()):

Workflow

  1. Create a BODVDD module configuration struct, which can be filled out to adjust the configuration of a physical BOD peripheral.
    struct bodvdd_config config_bodvdd;
  2. Initialize the BODVDD configuration struct with the module's default values.
    bodvdd_get_config_defaults(&config_bodvdd);
    Note
    This should always be performed before using the configuration struct to ensure that all values are initialized to known default settings.
  3. Configure the BODVDD module with the desired settings.
    bodvdd_set_config(&config_bodvdd);
  4. Enable the BODVDD module so that it will monitor the power supply voltage.

Use Case

Code

Copy-paste the following code to your user application:

while (true) {
/* Infinite loop */
}

Workflow

  1. Enter an infinite loop so that the BOD can continue to monitor the supply voltage level.
    while (true) {
    /* Infinite loop */
    }