打印
[Atmel]

用ASF跑SAMD21程序(26)BOD33

[复制链接]
1055|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 ddllxxrr 于 2015-1-31 15:42 编辑

BOD33是用来监视,3.3伏电压,若低于电压就重新启动。

首选建立ASF工程,添加BOD33模块,



然后打开,ASF EXPLORER点开快速指导。然后根据提示形成程序




以下是程序编译通过的截图:




由于开发板供电充足所以没有办法实测,只是等着以后开发时看看通否用到该功能吧。


程序清单:
/**
* \file
*
* \brief Empty user application template
*
*/

/**
* \mainpage User Application template doxygen documentation
*
* \par Empty user application template
*
* This is a bare minimum user application template.
*
* For documentation of the board, go \ref group_common_boards "here" for a link
* to the board-specific documentation.
*
* \par Content
*
* -# Include the ASF header files (through asf.h)
* -# Minimal main function that starts with a call to system_init()
* -# Basic usage of on-board LED and button
* -# "Insert application code here" comment
*
*/

/*
* Include header files for all drivers that have been imported from
* Atmel Software Framework (ASF).
*/

void configure_bod33(void);
#include <asf.h>

void configure_bod33(void)
{
        struct bod_config config_bod33;
        bod_get_config_defaults(&config_bod33);
        bod_set_config(BOD_BOD33, &config_bod33);
        bod_enable(BOD_BOD33);
}

int main (void)
{
        system_init();
    configure_bod33();
        // Insert application code here, after the board has been initialized.

        // This skeleton code simply sets the LED to the state of the button.
        while (1) {
               
        }
}


相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:http://shop34182318.taobao.com/ http://shop562064536.taobao.com

2398

主题

6950

帖子

67

粉丝