Connect with us

Brown out detection for Arduino mega 2560

Discussion in 'Microcontrollers, Programming and IoT' started by Jeroen Humasol, May 18, 2016.

Scroll to continue with content
  1. Jeroen Humasol

    Jeroen Humasol

    68
    4
    Nov 8, 2015
    Hi everyone,

    I read in the datasheet that the arduino mega has a brown out detection. (datasheet: http://www.atmel.com/images/atmel-2...r-atmega640-1280-1281-2560-2561_datasheet.pdf)

    But i was wondering, can i also use the brown out to trigger an interrupt? What i would like to do is just safe 1 variable to eeprom before the arduino dies. So it would call an interrupt routine that just stores this variable.

    Anyone knows if this is possible?

    Thanks!
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,836
    2,443
    Nov 17, 2011
    According to chapters 8.3.2 and 12.2.3 the built-in brown out detector, when enabled, activates RESET, not an interrupt.
    You could supervise Vcc externally and issue an interrupt. Set the threshold of the external supervising circuit higher than the level of the internal brown out detector. Provide enough bufffer capacity to allow the AVR to do some useful stuff when triggered by the external interrupt before the internal brown out detector is triggered by the falling voltage on Vcc.
     
    Jeroen Humasol likes this.
  3. Jeroen Humasol

    Jeroen Humasol

    68
    4
    Nov 8, 2015
    Hi Harald,

    Thanks for the reply! I guess i could do this but it's probably a bit to complex i was hoping on a simple line of code but it seems that that ain't possible.

    Thanks for your help
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-