comp.arch.embedded programming atmega48
The code below is intended to detect a rising transition on the external interput pin by sampling the flag register but it doesn't work on an atmega48. With the ei-mask bit set (no sei), the code didn't detect a transition either. On an atmega162 this does work, however, and the documentation describes the functioning of the flags in the same manner. Perhaps the 48 requires setting something I missed. Any suggestions?
Hul
ldi areg, 0xc ; set external irpt 1 for rising edge sts EICRA, areg sbi EIFR, 1 ; clear flag in ext irpt 1 - number 1 bit
; stalling untill meas device is connected & running exirst1: in areg, EIFR andi areg, 2 ; check flags existence brz exirst1 ; & wait if not there