Attiny1614 pin change wakeup will not enter ISR but wakes up chip

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



I have an Attiny1614 that uses two different pins (2,8) with pin change Sense low level interrupts enabled, both pins have pullups enabled and are set as inputs.

These intterupts are used to wake up from sleep mode as well.

PA4(pin2) uses a momentary push button to pull low to ground. This wakes up from sleep mode and enters the ISR, ISR(PORTA_PORT_VECT) just fine.


PB1(pin8) is pulled low through a mosfet in a battery charger chip (RT6524). This wakes up from sleep mode but will not enter its ISR, ISR(PORTB_PORT_vect).

However, when i program with an Atmel ICE and "start debugging and break", or just "start debugging" in atmel studio without any break points at all this will enter the PB1 sense low level interrupt ISR as expected.

ISR(PORTB_PORT_vect)//PIN 8(PB1) battery charge sense pin pulled low
    /**ISR not entering from pin change interrupt.Cant figure out why.
    Works in hardware debug mode, not when programmed regularly*/
    PORTA.OUTCLR = PIN2_bm;//blu led on

Been using an onboard led and while loop as well to show me where the code ends up.

I have no assembly experience for a deep dive, but this is an issue with C code i am having.

I have not tried to program with a generated elf file to see if there is a difference.

This is the same behavior with all optimization settings.


The interrupts are enabled befor sleep mode and i feel like iv exhausted c code testing around this issue.

PORTA.INTFLAGS = 0xff;//clear all pending pin change interrupt flags
PORTB.INTFLAGS = 0xff;//clear all pending pin change interrupt flags
PORTA.PIN4CTRL |= PORT_ISC0_bm | PORT_ISC2_bm;//*sense low level interrupt enabled for pin2(PA4) on/off button.
PORTB.PIN1CTRL |= PORT_ISC0_bm | PORT_ISC2_bm;//sense low level interrupt
    NO CHANGE PWR sense to both edges!
    IF not, default if woken up to a power pin change if manual button was not pressed...
    May be only way as the pin change interrupt has a bug.**/
sei();// global interrupts enabled, classic way
/*Must set sleep enable bit every time before sleep mode*/
sleep_mode();//Enter hardware sleep mode, info located in <avr/sleep.h>

Iv got a temporary workaround though: Only those two pin change state interrupts wake the chip up from sleep mode.

Only the PA4 low level sense interrupt will enter its ISR, the PB1 interrupt will not.

So i test a variable that is updated in the working ISR upon wakeup, and if that was not updated then i know

it was the other interrupt.

EDIT (after writing the whole thing i did this test)

My oscilloscope shows at 75ns from high to low transition on the BP1 pin without jitter, and stays low as its a pull down indicator for power to the charge chip.

*!>But get this, If i short PB1 to ground through a wire, the ISR enters fine? WTH.



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

Although it is not tiny1614, I confirmed the operation with PA1 and PB3 of tiny1616.
Both pins successfully woked up from sleep and performed interrupt processing.