Atmega328pb USART RX Start Interrupt

Hi.

Im reading a datasheet about atmega328pb which has 2 USART pins instead of 1 like in atmega328p that i have been previously using.

I am reading about register UCSR0D that could be used to "enable RX Start Interrupt". Being a novice i dont understand few things and i would appreciate help.
Currently i am using NeoSWSerial library with device attached to digital pins that has this functionality (wake up on interrupt) but i would like to change to hardware serial with the same functionality of waking up.

  1. if i set this register correctly and put atmega328pb in sleep then when device that is attached to Serial1 (pins12 and 13) would send message to atmega it would wake it up and run loop right ?
  2. Is there any way to set that only Serial1 (not Serial on pin 0 and 1) would wake up chip on interrupt ?
  3. What should i set UCSR0D register to for this to work ?

I finally managed to solve this by setting registers

UCSR1D = (1 << RXSIE) | (1 << SFDE)

and then seting ISR

ISR(USART1_START_vect){
countWake++;
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.