From 27321e05de35b494c2b282652e1c40a18435b68b Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 4 Jun 2021 19:09:07 +0200 Subject: implement uart --- src/main.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index c0f35d7..a73e7ef 100644 --- a/src/main.c +++ b/src/main.c @@ -2,24 +2,62 @@ #include #include +#include "uart.h" + +uint8_t t0_ovf_cnt = 0; + +uint8_t pb0_thresh = 128; + ISR(TIMER0_OVF_vect) { cli(); + /*TCNT0 = (1<<7);*/ /* Hack-increase Interrupt trigger freq */ + + t0_ovf_cnt ++; + + if ( t0_ovf_cnt >= pb0_thresh ) + PORTB &= ~(1<