HI
I'm working on a 2560 serial ports and using the simulator in AS7 to just check things as I go.
Anyway, I cannot seem to get TXENn to be anything other than 1.
UCSRnB - bit 3 is permanently shown as a one no matter how I try to change it be it the mouse or code. The display value also corroborates this by displaying 0x08.
is it me ?
Slightly tweaked code from Pg 206 of the datasheet
#include <avr/io.h> #define MYUBRR 0x67 void USART_Init(uint8_t); void main(void) { USART_Init (MYUBRR); } // main void USART_Init(uint8_t ubrr) { UBRR1H = (unsigned char)(ubrr>>8); UBRR1L = (unsigned char)ubrr; UCSR1B = (1<<RXEN1)|(0<<TXEN1); UCSR1C = (0<<USBS1)|(3<<UCSZ11); return; }
thanks