Forum: Mikrocontroller und Digitale Elektronik UART Konstanten aendern


von IchBin's (Gast)


Lesenswert?

Ich habe hier aus einer uart.c einige Zeilen die fuer mein Problem 
verantwortlich sind.
1
/* Enable USART receiver and transmitter and receive complete interrupt */
2
UART0_CONTROL = _BV(RXCIE0)|(1<<RXEN0)|(1<<TXEN0);
3
4
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
5
#ifdef URSEL0
6
UCSR0C = (1<<URSEL0)|(3<<UCSZ00);
7
#else
8
UCSR0C = (3<<UCSZ00);
9
#endif

Das Problem ist, dass ich das ich "Even" Parity benoetige. Weiter ist 
das Problem, dass ich mich mit C ueberhaupt nicht auskenne. Vielleicht 
koennte mir bitte trotzdem jemand helfen.

von hdd (Gast)


Lesenswert?

Welcher Controller.
Vermutlich: UCSR0C = (1<<URSEL0)|(3<<UCSZ00)|(1<<UPM01);

von Purzel H. (hacky)


Lesenswert?

Schon mal das Datenblatt angeschaut ? Kapitel UART.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.