本帖最后由 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) {
-
- }
- }
|