TXD
 
Syntax


void TXD (int pin, int byte );   // for bit-banged version on any pin

void TXD0(int byte);       // for hardware support

void TXD1(int byte);       // for UART1

Description

TXD (pin, byte) will send a single byte of data that is shifted out as an asynchronous serial stream on pin.  This function is similar to SEROUT,  but is a more efficient implementation.  The baudrate for the pin should be set before using TXD, that is done setting the SERbauds[] array.

These routines are "bit-banged" by the processor, so the processor is consumed during these operations.  Interupts are also disabled during each byte for these operations. 

UART0 UART1 support-

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

For ARMexpress modules baudrates for RXD0 can be upto 19.2 Kbaud as it is limited by the level translators. No limit for ARMmite/ARMweb  Use setUART0baud() routine to set this baud.

Example

    TXD(3,'a'); TXD(3,'b'); TXD(3,'c');  // send out   abc

See also