interrupt scheint zu kommen, led geht aus...
;-------------------------
.include "m168def.inc" ;| Definitionen der Adressen
;-------------------------
;
.def data = r17
.def temp = R16
.equ CLOCK = 7372800
.equ BAUD = 9600
.equ UBRRVAL = CLOCK/(BAUD*16)-1
.org 0x00
rjmp main
.org URXCaddr ; Interruptvektor für
UART-Empfang
rjmp int_rxc
; Hauptprogramm
main:
ldi temp, LOW(RAMEND)
out SPL, temp
ldi temp, HIGH(RAMEND)
out SPH, temp
ldi temp, 0x01
out DDRB,temp
out PORTB,temp
; Baudrate einstellen
ldi temp, LOW(UBRRVAL)
sts UBRR0L, temp
ldi temp, HIGH(UBRRVAL)
sts UBRR0H, temp
; Frame-Format: 8 Bit
ldi temp, 0x06
sts UCSR0C, temp
ldi temp, 0x98
sts UCSR0B, temp ; Interrupt bei Empfang
; RX (Empfang) aktivieren
sei ; Interrupts global aktivieren
loop: rjmp loop ; Endlosschleife
; Interruptroutine: wird ausgeführt sobald ein Byte über das UART
empfangen wurde
int_rxc:
push temp ; temp auf dem Stack sichern
ldi temp,0x00
out PORTB, temp
pop temp
; temp wiederherstellen
reti ; Interrupt beenden