Go Down  Topic: Possible Arduino Uno USART Bug (Read 4618 times)
previous topic - next topic    After hours of trying to figure
out why my serial comms dont work on the Uno, but did on the
Duemilanove, myself and Tricia from #sparkfun have discovered
something most odd.  It seems the Uno has the USART baud doubler
ON by default where as the Duemilanove does not.  Test case:
Code: [Select]  #include <avr/io.h> #include <util/delay.h>
#define BAUD 9600 //#include <util/setbaud.h>  void
serial_init()        uint16_t                        ubbr;     
  /* set the baud, the traditional way */        ubbr = 103;   
   UBRR0H = ubbr >> 8;        UBRR0L = ubbr & 0xff;         /*
Set the baud rate - the setbaud.h way */ #if 0         /* set
the framing to 8N1 */        UCSR0C = (3 << UCSZ00);        /*
Engage! */         /* doubler off  - Only needed on Uno XXX */ 
     //UCSR0A &= ~(1 << U2X0);   void serial_write(unsigned char
c)        UDR0 = c;  int main (void)        char i = 0;      
 char *str = "the quick