/* * AssemblerApplication1.asm * * Created: 07.06.2012 08:11:35 * Author: Install */ .equ F_CPU = 1843200 .equ BAUD = 9600 .equ UBRR_VAL = ((F_CPU+BAUD*8)/(BAUD*16)-1) ; clever runden .equ BAUD_REAL = (F_CPU/(16*(UBRR_VAL+1))) ; Reale Baudrate .equ BAUD_ERROR = ((BAUD_REAL*1000)/BAUD-1000) ; Fehler in Promille .if ((BAUD_ERROR>10) || (BAUD_ERROR<-10)) ; max. +/-10 Promille Fehler .error "Systematischer Fehler der Baudrate grösser 1 Prozent und damit zu hoch!" .endif .def temp = R16 .def cmd = R17 .def cs = R18 // Init Stackpointer ldi temp, HIGH(RAMEND) out SPH, temp ldi temp, LOW(RAMEND) out SPL, temp // Init UART lds temp, UCSR0B sbr temp, 1<