Usart (Atxmega)

UsartC0, UsartC1, UsartD0, UsartD1, UsartE0, UsartE1, UsartF0, UsartF1

UartX are the Interfaces to the Uart-serial Ports of the Atxmega-Controller (RS232, RS485, ..).

Legacy Mode Methods and Properties similar to the Tiny/Mega Uart-Interfaces.

Usart always referrs to the Standard-Serial Port. Default is UsartC0. This also applies to Print and InpStr. As of Version 2013.R4 you can globally set the standard port's properties globally once at program start:

Additional Property for „Usart“ (write only)
Name Description Values
Usart.Interface = Port Define standard port when using „Usart“ (port number is omitted). UsartC0, UsartC1, UsartD0, UsartD1, UsartE0, UsartE1, UsartF0, UsartF1
' Simple Terminal with Echo
'the txd pin of uartc0 must be set to output
#define txdc0  as portc.3
txdc0.mode = output,high
'configure/enable the standard usart (usartc0)
usart.baud = 19200
usart.rxd.enable
usart.txd.enable
 
dim chars as string
do
  print " prompt > ";
  chars = Usart.InpStr()
  print "Input: ";34;chars;34
loop

See also: Idle-EndIdle