/* * uart.asm * */ ;Simple program to send "Hello! World" using AVR Butteryfly @ default 8Mhz ;runs 4800 buad with 2 stop bits and no partiy .def TEMP=r16 .def TEMP0=r17 .def TEMP1=r18 ; Initialize Stack Pointer to end of RAM LDI TEMP, HIGH(RAMEND) ; Upper byte OUT SPH,TEMP ; to stack pointer LDI TEMP, LOW(RAMEND) ; Lower byte OUT SPL,TEMP; to stack pointer USART_Init: ;Load UBRRH with 0 and UBRRL with 103 ;in other words FOSC/16/BAUD-1 ;to set a baud rate of about 4800 at 8MHz ldi TEMP,00 //mov UBRRH, TEMP ; can't do this since UBRRH is in the _extended_ i/o sts UBRRH,TEMP ldi TEMP,103 sts UBRRL,TEMP ;Clear all error flags ldi TEMP,00 sts UCSRA,TEMP ;Enable Transmission and Reception ldi TEMP,(1<