power-safe mode

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

can USART RX interrupt wakes up the MCU in power-safe mode?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure BUT the data sheet would tell you if this is the case in the table for the wake up sources for the dufferent sleep modes.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Not sure BUT the data sheet would tell you if this is the case in the table for the wake up sources for the dufferent sleep modes.

yah! i'd just looked at it but was confused whether i classify it as other I/O or what, as it is not listed on the table!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe the RX IRQ /could/ awake it, but then, how would you ever get
to a successfully received UART frame without the UART being clocked?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
how would you ever get
to a successfully received UART frame without the UART being clocked?

what do you mean ?...the idea behind this is that we don't always receive but receive on interrupt thus all along we want to put the mcu in sleep mode.

anything i'm missing about USART clocking? please i would like to know more about it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look into the d**n datasheet, man!

Which clocks are enabled while in power-safe mode?
Is clk[IO] mentioned in this list?
Which clock drives the UART?
=> Is there any chance the UART could receive *any* data while the AVR is
in power-safe mode?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Connect the RX line additionally to one of the dedicated interrupt pins INTx or any IO with pin change interrupt capability to wake up the controller from power-save mode. Depending on baud rate you might have to send a dummy character first which will eventually be lost.

Jörg.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On some AVRs, the RX pin can generate a pin change interrupt. That's true of the megaxx9 and probably others. No need to connect anything.

Using the pin change interrupt works perfectly at speeds up to 57600 baud. No dummy character needed. At least I find that to be so. I do use a "USART friendly" oscillator frequency. Maybe other frequencies would cause problems.

By the way, it's power-save, not power-safe.

Pin change interrupts work when in power-save and power-down modes. I would be very surprised if the USART can generate any interrupts when in power-save/down because it isn't running. (clock disabled)

But as soon as the RX line goes low at the start of the first start bit coming in, the AVR is running and the USART does it's thing. Of course it's the pin change interrupt that causes the AVR to wake up.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Look into the d**n datasheet
Don't get too uptight Jörg #1. Stress might make your hair fall out...... :mrgreen:

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly