Forum: Mikrocontroller und Digitale Elektronik 2 uart in codevision


von mbuchman (Gast)


Lesenswert?

Hallo!

Ich habe folgendes vor: einen atmega128 als schnittstelle zwischen ienem 
anderen controller und einem pc zu verwenden. Bisher hab ich ihn immer 
nur mit uart0 betrieben (in codevision avr).
Nun meine Frage: es gibt die funktion printf in cvavr. aber wie weis 
ich, bzw. wie teile ich dem Programm mit, für welche der beiden uarts 
diese funktion nun gilt?

Danke!

von Sven (Gast)


Lesenswert?

siehe Hilfe:


For devices with 2 UARTs, respectively 2 USARTs, there will be two tabs 
present: UART0 and UART1, respectively USART0 and USART1.

The functions of configuration check and list boxes will be the same as 
described above.

The UART0 (USART0) will use the normal putchar and getchar functions.

In case of interrupt driven buffered communication, UART0 (USART0) will 
use the following variables:

rx_buffer0, rx_wr_index0, rx_rd_index0, rx_counter0, 
rx_buffer_overflow0,

tx_buffer0, tx_wr_index0, tx_rd_index0, tx_counter0.

The UART1 (USART1) will use the putchar1 and getchar1 functions.

In case of interrupt driven buffered communication, UART1 (USART1) will 
use the following variables:

rx_buffer1, rx_wr_index1, rx_rd_index1, rx_counter1, 
rx_buffer_overflow1,

tx_buffer1, tx_wr_index1, tx_rd_index1, tx_counter1.

All serial I/O using functions declared in stdio.h, will be done using 
UART0 (USART0).

von mbuchman (Gast)


Lesenswert?

danke!

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.