µVision4 User's Guide

ASSIGN

The ASSIGN command allows displaying and changing the input and output sources for the specified serial channel.

SyntaxDescription
ASSIGNDisplay serial channel I/O assignments.
ASSIGN channel <inreg > outregChange serial channel I/O assignments. Note the brackets around inreg and the trailing blank before the closing bracket.

The following table shows the supported channels and the default settings for the input register (inreg) and output register (outreg).

ChannelDefault inregDefault outregDescription
COM1NoneNoneCOM port 1 on the PC.
COM2NoneNoneCOM port 2 on the PC.
COM3NoneNoneCOM port 3 on the PC.
COM4NoneNoneCOM port 4 on the PC.
WINSIN or S1INSOUT or S1OUTThe Serial window.

The names of the input- and output registers (VTREGs) are defined by the CPU in use. The VTREGs can be listed with the command DIR VTREG.

The baudrate and other serial port parameters must be set with the MODE command.

Examples
>ASSIGN                     /* Display serial assignment                */
  WIN: <S0IN >S0OUT         /* S0IN provides serial input &             */
                            /* S0OUT provides serial output             */
>
>ASSIGN WIN <S1IN >S1OUT    /* Assign S1IN & S1OUT to the Serial window */
>ASSIGN                     /* And display the assignment               */
  WIN: <S1IN >S1OUT

>ASSIGN COM1 < SIN > SOUT   /* Assign SIN & SOUT to COM1                */

Notes

  • The ASSIGN command cannot be used in target debug mode.
  • The PC serial port (COM port) supports only up to 8 data bits. Therefore, it is impossible to generate more then 8 data bits, as it is possible on some microcontroller UART interfaces.