Hi -
I need some help
What I'm trying to do is talk to a serial device
I have to keep flipping the 9th bit from 0 to 1
Hi -
I need some help
What I'm trying to do is talk to a serial device
I have to keep flipping the 9th bit from 0 to 1
You need to figure out what TXSTA.0 does and how to do that on an ATmega processor. Looks like a processor register to me.
If you don't care what it does:
unsigned int TXSTA;
TXSTA |= 0x0200; // Set bit 9
TXSTA &= ~ 0x0200; // Clear bit 9
My whole project hinges on the ability to send a 9 bit serial transmission
I really hope there is a way to do this on the arduino
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.write(80); // send a byte with the value 80
delay(10);
Serial.write(81); // send a byte with the value 81
}
9-bit mode can be set by writing into the UCSRxx register.
UCSR0A = (3 << UCSZ00);
Is right I think but look at section 19.10.4 of the data sheet to see what other bits need to be preserved
Rob