need help for setup a serial comm ...
i try set serial to: 1200 bauds, 7 data bits, 1parity bit, 1 stop bit .
i try registers sketch:
void setup()
{
serial.begin(1200);
//disable interrupts while setting bits in registers
cli();
// set 7 datas bits
bitclear(ucsr0b,ucsz00);
bitset(ucsr0b,ucsz01);
bitclear(ucsr0b,ucsz02);
//set parity even
bitset(ucsr0b,upm01);
bitclear(ucsr0b,upm00);
// set 1 stop bit
bitclear(ucsr0b,usbs0);
// reenable interrupts
sei();
}
char data;
void loop()
{
while(serial.available()>0) serial.print(data);
}
that don't work ! what's wrong ? me please ...
i try registers sketch:
void setup()
{
serial.begin(1200);
//disable interrupts while setting bits in registers
cli();
// set 7 datas bits
bitclear(ucsr0b,ucsz00);
bitset(ucsr0b,ucsz01);
bitclear(ucsr0b,ucsz02);
//set parity even
bitset(ucsr0b,upm01);
bitclear(ucsr0b,upm00);
// set 1 stop bit
bitclear(ucsr0b,usbs0);
// reenable interrupts
sei();
}
char data;
void loop()
{
while(serial.available()>0) serial.print(data);
}
that don't work ! what's wrong ? me please ...
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > need help for setup a serial comm ...
arduino
Comments
Post a Comment