Hi everyone,
I am having a problem setting the serial data bits on my mega 2560
I have two serial RS232 devices, both which work in hyperterminal. however, both do not use the standard data bits to the arduinio.
First of all, am i right in thinking that
USART0 = Serial 0: (RX) and 1 (TX) ( connected to the USB chip so best not to use)
USART1 = Serial 1: 19 (RX) and 18 (TX)
USART2 = Serial 2: 17 (RX) and 16 (TX)
USART3 = Serial 3: 15 (RX) and 14 (TX)
I have my two devices going into a max232cpe voltage converter chip and this does seem to work with one of the devices. I can read data from the mega2560>>max232>>hyperterminal. on Serial.Println("hello"), however i think hyperterminal must do some analysis and changes the data bits on the fly to get the data on screen. this does not help me.
to change the data bits, i need to change UCSRxC, correct?
(UMSEL11 UMSEL10 UPM11 UPM10 USBS1 UCSZ11 UCSZ10 UCPOL1)
so looking at Table 22-7 (pg 226)in the datasheet, I have
UCSR1C = B00000110 for 8 data bits
UCSR1C = B00000100 for 7 data bits
UCSR1C = B00110000 for Enabled, Odd Parity
UCSR1C = B00100000 for Enabled, Even Parity
Does changing these values require any other changes or power cycles to take effect? beacuse I cant get my known working device to talk ![]()
thanks in advance!
Tom