X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Flib%2Fatmega168.c;h=d8705ba40735dbd56fc15ae13b3a62608d6af40d;hp=c6516ead01bc4b3a941d4502ed27be8d94f0c18d;hb=f244df1b2d3010548ed2cceabdde44f36089a29a;hpb=7254ebd4731d5c3ce94bbe4e16a5928a5089e6c4 diff --git a/firmware/lib/atmega168.c b/firmware/lib/atmega168.c index c6516ea..d8705ba 100644 --- a/firmware/lib/atmega168.c +++ b/firmware/lib/atmega168.c @@ -51,8 +51,9 @@ void setbaud0(unsigned char rate){ break; } -#define F_CPU 16000000L -#define BAUD 230400L +#define F_CPU 8000000L + //#define BAUD 115200L +#define BAUD 9600L #include UBRR0H = UBRRH_VALUE; UBRR0L = UBRRL_VALUE; @@ -88,7 +89,9 @@ void setbaud1(unsigned char rate){ void avr_init_uart0(){ + PORTD = _BV(PD2); setbaud0(0); + _delay_ms(500); //takes a bit to stabilize }