TXD(x)
 
Syntax

TXD(channel) = character    ' built-in keyword
Description

The data is transmitted on the SOUT pin on the ARMexpress, ARMexpressLITE.  It is the serial line connected to the USB port on the ARMmite, or the wireless serial port for the ARMmite Wireless.  On the ARMweb it is serial debug port. (labeled TXD0 on the schematic, UART0 of the LPC21xx)

The hardware serial port is used, so the CPU is not tied up.  So when a byte is sent it is placed into the UART0 FIFO, but if the 16 byte FIFO is full then the CPU will wait until space is available.

As of version 8.20 of the firmware, TX interrupts are used so characters are placed into a buffer and sent to the UART hardware when the TX FIFO or output register is empty (all charaters sent).  That buffer size is 128 bytes for all but the PROplus (64 bytes).  If the user sends more bytes than this buffer, the program will stall until there is room in the buffer.

SuperPRO or PROplus--

These devices support 4 UARTs, pin assignments in the Hardware Info.  Access to UART0 and UART1 in all firmware versions, but access to all 4 UARTs requires firmware 8.14 or later.

The compiler is also backward compatible with the syntax -- TXD0 = char  ,  TXD = char  , or TXD1 = char

Example

SUB PrintUART1 (Astr(100) as STRING)
    DIM I as INTEGER
    I=0
    WHILE Astr(I)
        TXD(1) =  Astr(I)
        I=I+1
    LOOP
END SUB
'...

main:
BAUD(1)=19200  ' enable UART1


PrintUART1 ("Hello World")       ' Send a string of characters serially out UART1
 

Differences from other BASICs

See also