EmbDev.net

Forum: µC & Digital Electronics Problem when building Brownout Detector


von Xiangyu C. (xchen)


Rate this post
0 useful
not useful
Dear all,

here I have some questions about the brownout detector. I haven't any 
experience of interrupt, maybe I've done it with some dummy thought.

I have an ATMEL SAMC21XPLAINED Board in hand, and i want to try the 
brownout detection interrupt. First I configure the VDDBOD in the eFuse 
(Enable, Hysteresis, Level). From the generated atmel start project 
source code, I found a system_handler, as said in commends, which is for 
the interrupt of Power manager, Main clock, osc controller, protection 
access controller and SUPC(supply controller). The SUCP is theoretically 
what i need for the brownout detection.

Then I built a System_handler function, aiming to store the test data 
into EEPROM and see a short blink of LED, as below:

void SYSTEM_Handler()
{
  RWW_FLASH_BOD();
        gpio_toggle_pin_level(LED0);

}

The current situation is, every time when I cut off the supply, and want 
to turn it on again to check its EEPROM. Then I found the LED blinks 
after the power on, that means the SYSTEM_Handler detect in the 
meanwhile the restart. My assumption is that the mentioned interrupt 
source above have the same priority. In this case how can I set that the 
Handler just about the Brownout, not others? Or if I understand it 
totally wrong, how should I configure and call the Brownout Function?

Everyone who interested in this

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig