From 42b3c6be1ea2895401e83596567e939144c1120d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20W=C3=BCnscher?= Date: Mon, 14 Aug 2017 14:39:47 +0200 Subject: [PATCH] modified initailization code for use with ATMEGA8 (#3) * modified initailization code for use with ATMEGA8 * added #define BAUD and automatic calculation of UBRR value --- yaMBSiavr.c | 15 +++++++++------ yaMBSiavr.h | 31 +++++++++---------------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/yaMBSiavr.c b/yaMBSiavr.c index a62ae16..9422034 100644 --- a/yaMBSiavr.c +++ b/yaMBSiavr.c @@ -214,12 +214,15 @@ ISR(UART_TRANSMIT_COMPLETE_INTERRUPT) void modbusInit(void) { - UBRRH = (unsigned char)(Baud>>8); - UBRRL = (unsigned char)Baud; - UART_CONTROL = (1<>8); + UBRRL = (unsigned char)UBRR; + UART_STATUS = (1<