Commit 10bf504f authored by medlem's avatar medlem

Working uart

parent 55bcbee3
Pipeline #241 canceled with stages
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
SHELL := cmd.exe
RM := rm -rf
USER_OBJS :=
LIBS :=
PROJ :=
O_SRCS :=
C_SRCS :=
S_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
PREPROCESSING_SRCS :=
OBJS :=
OBJS_AS_ARGS :=
C_DEPS :=
C_DEPS_AS_ARGS :=
EXECUTABLES :=
OUTPUT_FILE_PATH :=
OUTPUT_FILE_PATH_AS_ARGS :=
AVR_APP_PATH :=$$$AVR_APP_PATH$$$
QUOTE := "
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:=
LIB_DEP:=
LINKER_SCRIPT_DEP:=
# Every subdirectory with source files must be described here
SUBDIRS :=
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../UART-LF.c
PREPROCESSING_SRCS +=
ASM_SRCS +=
OBJS += \
UART-LF.o
OBJS_AS_ARGS += \
UART-LF.o
C_DEPS += \
UART-LF.d
C_DEPS_AS_ARGS += \
UART-LF.d
OUTPUT_FILE_PATH +=UART.elf
OUTPUT_FILE_PATH_AS_ARGS +=UART.elf
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:= ./makedep.mk
LIB_DEP+=
LINKER_SCRIPT_DEP+=
# AVR32/GNU C Compiler
./%.o: .././%.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega4809 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\gcc\dev\atmega4809" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
# AVR32/GNU Preprocessing Assembler
# AVR32/GNU Assembler
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)
$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)
@echo Building target: $@
@echo Invoking: AVR/GNU Linker : 5.4.0
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="UART.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega4809 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\gcc\dev\atmega4809"
@echo Finished building target: $@
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "UART.elf" "UART.hex"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "UART.elf" "UART.eep" || exit 0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "UART.elf" > "UART.lss"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "UART.elf" "UART.srec"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "UART.elf"
# Other Targets
clean:
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "UART.elf" "UART.a" "UART.hex" "UART.lss" "UART.eep" "UART.map" "UART.srec" "UART.usersignatures"
\ No newline at end of file
UART-LF.d UART-LF.o: .././UART-LF.c \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\5.4.0\include\stdint.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h \
C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\include/avr/iom4809.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\xmega.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\5.4.0\include\stdint.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h:
C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\include/avr/iom4809.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\xmega.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h:
:100000000C9450000C945A000C945A000C945A0012
:100010000C945A000C945A000C945A000C945A00F8
:100020000C945A000C945A000C945A000C945A00E8
:100030000C945A000C945A000C945A000C945A00D8
:100040000C945A000C945A000C945A000C945A00C8
:100050000C945A000C945A000C945A000C945A00B8
:100060000C945A000C945A000C945A000C945A00A8
:100070000C945A000C945A000C945A000C945A0098
:100080000C945A000C945A000C945A000C945A0088
:100090000C945A000C945A000C945A000C945A0078
:1000A00011241FBECFEFCDBFDFE3DEBF0E9476007D
:1000B0000C9488000C940000E0E2F4E021E0258339
:1000C0002183E0E6F8E06087BB27A92F982F872FD0
:1000D000818783E0878380EC86830895E0E6F8E0FB
:1000E000948195FFFDCF8093620808956CE675E0DA
:1000F00080E090E00E945C00789488E60E946E00A8
:1001000025ED88E092E0215080409040E1F7F5CF66
:04011000F894FFCF91
:00000001FF
UART.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00802800 00802800 00000168 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 00000114 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 00000030 00000000 00000000 00000168 2**0
CONTENTS, READONLY
3 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 00000198 2**2
CONTENTS, READONLY
4 .debug_aranges 00000030 00000000 00000000 000001d8 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 000027ba 00000000 00000000 00000208 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_abbrev 0000226c 00000000 00000000 000029c2 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 0000036a 00000000 00000000 00004c2e 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_frame 00000044 00000000 00000000 00004f98 2**2
CONTENTS, READONLY, DEBUGGING
9 .debug_str 000011f0 00000000 00000000 00004fdc 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000020 00000000 00000000 000061cc 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 50 00 jmp 0xa0 ; 0xa0 <__ctors_end>
4: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
8: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
10: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
14: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
18: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
1c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
20: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
24: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
28: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
2c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
30: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
34: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
38: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
3c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
40: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
44: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
48: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
4c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
50: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
54: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
58: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
5c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
60: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
64: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
68: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
6c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
70: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
74: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
78: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
7c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
80: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
84: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
88: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
8c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
90: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
94: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
98: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
9c: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <__bad_interrupt>
000000a0 <__ctors_end>:
a0: 11 24 eor r1, r1
a2: 1f be out 0x3f, r1 ; 63
a4: cf ef ldi r28, 0xFF ; 255
a6: cd bf out 0x3d, r28 ; 61
a8: df e3 ldi r29, 0x3F ; 63
aa: de bf out 0x3e, r29 ; 62
ac: 0e 94 76 00 call 0xec ; 0xec <main>
b0: 0c 94 88 00 jmp 0x110 ; 0x110 <_exit>
000000b4 <__bad_interrupt>:
b4: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
000000b8 <uart_init>:
void uart_init(unsigned long baud){
//From chapter 24.3 in datasheet
PORTB.OUTSET = (1 << 0); //Setting up TX pin as output
b8: e0 e2 ldi r30, 0x20 ; 32
ba: f4 e0 ldi r31, 0x04 ; 4
bc: 21 e0 ldi r18, 0x01 ; 1
be: 25 83 std Z+5, r18 ; 0x05
PORTB.DIRSET = (1 << 0); //Setting up TX pin as output
c0: 21 83 std Z+1, r18 ; 0x01
//USART3.BAUDH = (baud >> 8); //Shift register right by 8 bits to get the 8 high bits
//USART3.BAUDL = baud; //Set baud rate without shifting to get the 8 low bits
//It turns out the compiler can handle this automatically, meaning this works just as well:
USART3.BAUDL = (uint8_t)baud;
c2: e0 e6 ldi r30, 0x60 ; 96
c4: f8 e0 ldi r31, 0x08 ; 8
c6: 60 87 std Z+8, r22 ; 0x08
USART3.BAUDH = (uint8_t)(baud >> 8);
c8: bb 27 eor r27, r27
ca: a9 2f mov r26, r25
cc: 98 2f mov r25, r24
ce: 87 2f mov r24, r23
d0: 81 87 std Z+9, r24 ; 0x09
//USART.CTRLC CMODE bits default to async, 1 stop bit, 8 bit character size
USART3.CTRLC = (0x3 << 0);
d2: 83 e0 ldi r24, 0x03 ; 3
d4: 87 83 std Z+7, r24 ; 0x07
USART3.CTRLB = (1 << USART_RXEN_bp) | (1 << USART_TXEN_bp); //Enable RX and TX
d6: 80 ec ldi r24, 0xC0 ; 192
d8: 86 83 std Z+6, r24 ; 0x06
da: 08 95 ret
000000dc <uart_transmit>:
//In this function we will be send data.
//First we should check that there isn't already data being sent
// if there is, we should probably wait for it to finish first
while (!(USART3.STATUS & (1 << USART_DREIF_bp))){
dc: e0 e6 ldi r30, 0x60 ; 96
de: f8 e0 ldi r31, 0x08 ; 8
e0: 94 81 ldd r25, Z+4 ; 0x04
e2: 95 ff sbrs r25, 5
e4: fd cf rjmp .-6 ; 0xe0 <uart_transmit+0x4>
//wait for previous transmit to finish
};
//Put our new data into se sending register
USART3.TXDATAL = data;
e6: 80 93 62 08 sts 0x0862, r24 ; 0x800862 <__TEXT_REGION_LENGTH__+0x700862>
ea: 08 95 ret
000000ec <main>:
int main(void)
{
//Initialize the UART with our function.
//We will be using a baudrate of 9600 (defined as BAUD_9600 at the top of the file)
uart_init(BAUD_9600);
ec: 6c e6 ldi r22, 0x6C ; 108
ee: 75 e0 ldi r23, 0x05 ; 5
f0: 80 e0 ldi r24, 0x00 ; 0
f2: 90 e0 ldi r25, 0x00 ; 0
f4: 0e 94 5c 00 call 0xb8 ; 0xb8 <uart_init>
sei(); //Enable inerrupt, important for anything here to work
f8: 78 94 sei
while (1)
{
//We don't really need to do anything here.
//the ISR will handle receiving.
uart_transmit('h');
fa: 88 e6 ldi r24, 0x68 ; 104
fc: 0e 94 6e 00 call 0xdc ; 0xdc <uart_transmit>
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
__builtin_avr_delay_cycles(__ticks_dc);
100: 25 ed ldi r18, 0xD5 ; 213
102: 88 e0 ldi r24, 0x08 ; 8
104: 92 e0 ldi r25, 0x02 ; 2
106: 21 50 subi r18, 0x01 ; 1
108: 80 40 sbci r24, 0x00 ; 0
10a: 90 40 sbci r25, 0x00 ; 0
10c: e1 f7 brne .-8 ; 0x106 <main+0x1a>
10e: f5 cf rjmp .-22 ; 0xfa <main+0xe>
00000110 <_exit>:
110: f8 94 cli
00000112 <__stop_program>:
112: ff cf rjmp .-2 ; 0x112 <__stop_program>
This diff is collapsed.
S00C0000554152542E73726563DC
S11300000C9450000C945A000C945A000C945A000E
S11300100C945A000C945A000C945A000C945A00F4
S11300200C945A000C945A000C945A000C945A00E4
S11300300C945A000C945A000C945A000C945A00D4
S11300400C945A000C945A000C945A000C945A00C4
S11300500C945A000C945A000C945A000C945A00B4
S11300600C945A000C945A000C945A000C945A00A4
S11300700C945A000C945A000C945A000C945A0094
S11300800C945A000C945A000C945A000C945A0084
S11300900C945A000C945A000C945A000C945A0074
S11300A011241FBECFEFCDBFDFE3DEBF0E94760079
S11300B00C9488000C940000E0E2F4E021E0258335
S11300C02183E0E6F8E06087BB27A92F982F872FCC
S11300D0818783E0878380EC86830895E0E6F8E0F7
S11300E0948195FFFDCF8093620808956CE675E0D6
S11300F080E090E00E945C00789488E60E946E00A4
S113010025ED88E092E0215080409040E1F7F5CF62
S1070110F894FFCF8D
S9030000FC
################################################################################
# Automatically-generated file. Do not edit or delete the file
################################################################################
UART-LF.c
/*
* UART-LF.c
*
* Created: 29.01.2017 23:43:39
* Author : Petter
*/
#define F_CPU 3333333
#define BAUD_9600 4*F_CPU/9600
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
/*
In this exercise we will set up and use UART communication.
The embedded debugger has a virtual com port that we will use to communicate with the computer.
*/
void uart_init(unsigned long baud){
//From chapter 24.3 in datasheet
PORTB.OUTSET = (1 << 0); //Setting up TX pin as output
PORTB.DIRSET = (1 << 0); //Setting up TX pin as output
//USART3.BAUDH = (baud >> 8); //Shift register right by 8 bits to get the 8 high bits
//USART3.BAUDL = baud; //Set baud rate without shifting to get the 8 low bits
//It turns out the compiler can handle this automatically, meaning this works just as well:
USART3.BAUDL = (uint8_t)baud;
USART3.BAUDH = (uint8_t)(baud >> 8);
//USART.CTRLC CMODE bits default to async, 1 stop bit, 8 bit character size
USART3.CTRLC = (0x3 << 0);
USART3.CTRLB = (1 << USART_RXEN_bp) | (1 << USART_TXEN_bp); //Enable RX and TX
//USART3.CTRLA |= (1 << USART_RXCIE_bp); //Enable interrupts on incoming data
}
// function to transmit data
void uart_transmit(char data){
//In this function we will be send data.
//First we should check that there isn't already data being sent
// if there is, we should probably wait for it to finish first
while (!(USART3.STATUS & (1 << USART_DREIF_bp))){
//wait for previous transmit to finish
};
//Put our new data into se sending register
USART3.TXDATAL = data;
}
int main(void)
{
//Initialize the UART with our function.
//We will be using a baudrate of 9600 (defined as BAUD_9600 at the top of the file)
uart_init(BAUD_9600);
sei(); //Enable inerrupt, important for anything here to work
while (1)
{
//We don't really need to do anything here.
//the ISR will handle receiving.
uart_transmit('h');
_delay_ms(200);
}
}
//Interrupt service routine for the receiver.

Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "UART", "UART.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|AVR = Debug|AVR
Release|AVR = Release|AVR
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
<ProjectComponents>
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
<CApiVersion></CApiVersion>
<CBundle></CBundle>
<CClass>Device</CClass>
<CGroup>Startup</CGroup>
<CSub></CSub>
<CVariant></CVariant>
<CVendor>Atmel</CVendor>
<CVersion>1.2.0</CVersion>
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<Description></Description>
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\include</AbsolutePath>
<Attribute></Attribute>
<Category>include</Category>
<Condition>C</Condition>
<FileContentHash i:nil="true" />
<FileVersion></FileVersion>
<Name>include</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\include\avr\iom4809.h</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>C</Condition>
<FileContentHash>ewcOfoIqWpXTyYZqjqI28w==</FileContentHash>
<FileVersion></FileVersion>
<Name>include/avr/iom4809.h</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\templates\main.c</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>xBn1Yj5JbEuNiKX0+XP9Ew==</FileContentHash>
<FileVersion></FileVersion>
<Name>templates/main.c</Name>
<SelectString>Main file (.c)</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>YXFphlh0CtZJU+ebktABgQ==</FileContentHash>
<FileVersion></FileVersion>
<Name>templates/main.cpp</Name>
<SelectString>Main file (.cpp)</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.150\gcc\dev\atmega4809</AbsolutePath>
<Attribute></Attribute>
<Category>libraryPrefix</Category>
<Condition>GCC</Condition>
<FileContentHash i:nil="true" />
<FileVersion></FileVersion>
<Name>gcc/dev/atmega4809</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
</Files>
<PackName>ATmega_DFP</PackName>
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.2.150/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.2.150</PackVersion>
<PresentInProject>true</PresentInProject>
<ReferenceConditionId>ATmega4809</ReferenceConditionId>
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string></d4p1:string>
</RteComponents>
<Status>Resolved</Status>
<VersionMode>Fixed</VersionMode>
<IsComponentInAtProject>true</IsComponentInAtProject>
</ProjectComponent>
</ProjectComponents>
</Store>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>7.0</ProjectVersion>
<ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
<ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
<avrdevice>ATmega4809</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<Language>C</Language>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<AssemblyName>UART</AssemblyName>
<Name>UART</Name>
<RootNamespace>UART</RootNamespace>
<ToolchainFlavour>Native</ToolchainFlavour>
<KeepTimersRunning>true</KeepTimersRunning>
<OverrideVtor>false</OverrideVtor>
<CacheFlash>true</CacheFlash>
<ProgFlashFromRam>true</ProgFlashFromRam>
<RamSnippetAddress />
<UncachedRange />
<preserveEEPROM>true</preserveEEPROM>
<OverrideVtorValue />
<BootSegment>2</BootSegment>
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.35.1" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega4809 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.2.150\gcc\dev\atmega4809"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>NDEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.150\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.150\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega4809 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.2.150\gcc\dev\atmega4809"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>DEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.150\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>