PCMSK simulation tiny261 grrrrrr

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Think i'm going mad or just missing something, this code is supposed to wait for a pin change on RB0 of a TINY261

;Setup pin change interupt on PCINT8 (PB0)

clr r16 ;None of these
out PCMSK0,r16
ldi r16,$01 ;Just PCINT8 of this one
out PCMSK1,r16
ldi r16,$10
out GIMSK,r16 ;enable just the Pin Change Interrupt

;start timer0
ldi r16,$0A
out TCCR0B,r16 ;reset prescaler and set source to clkio/8

sei ;enable interrupts
cbi PORTB,TX ;tell master i'm waiting

GOTO_SLEEP:

ldi r16,$20
out MCUCR,r16
sleep ;idle mode
rjmp GOTO_SLEEP ;after wakeup

------------------------------------------

the cbi PORTB,TX triggers the interrupt.

Am i doing something wrong?