|
|||||||||||
Technical Support On-Line Manuals µVision User's Guide About µVision User Interface Creating Applications Utilities Debugging Debug Commands Debug Functions Simulation Digital Input Push Button Interrupt Signal Impulse Patterns Analog Input Square Wave Signal Saw Tooth Signal Sine Wave Noise Signal Signal Combination UART Communication CAN Communication Dialog Pages Virtual Simulation Registers (VTREG) Simulate Incoming Messages Process Outgoing Messages Send Periodic Messages I²C Communication I²C Concepts I²C Simulation Virtual Simulation Registers (VTREG) Simulating an I²C Device Application Examples SPI Simulation XPAGE VTREG PPAGE VTREG Flash Programming Dialogs Example Programs Command Line Appendix |
UART CommunicationUART Communication or RS232 serial interfaces are provided by many microcontrollers. The µVision Debugger simulates the UART interface and provides Serial Windows for communication. Serial Windows operate similar to a terminal. As an alternative, serial output can be redirected to any COM port using the ASSIGN command. Peripheral DialogUART or Serial dialogs provided through the menu Peripherals show the serial interface status of the microcontroller. These dialogs allow reviewing the communication baudrate and other parameters of the system.
Virtual Simulation Registers (VTREG)VTREGs that simulate UART communication are implemented as follows:
The naming conventions for VTREGs (SxIN, SxOUT, and SxTIME) vary from device to device. Several devices provide more than one UART interface. Therefore, the VTREG names might be prefixed with S0 or S1. Use the command DIR VTREG to check the VTREG names of the UART interface. Input Characters via SxIN VTREGThe SxIN VTREG represent inputs to the on-chip serial port of the microcontroller. The following commands, used from the Command Window, input a value to the serial stream. Also, the Serial Window can be used to input values for the serial port. SIN = 'A' /* Input the letter A to the serial stream */ SIN = 0x019E /* Input the 9-bit value 19Ex to the serial stream */ SIN = 0xA9 /* Input value 0xA9 to I/O stream for the UART */ Control UART Communication TimingThe SxTIME VTREG allows controlling the timing of the simulated serial port.
For example: STIME = 0 /* Set Serial 0 for FAST timing */ STIME = 1 /* Set Serial 0 for accurate timing */ UART Simulation ExampleThe following debug script sends the characters 'A' - 'Z' with a speed of about 19.200 baud. signal void serialA_Z (void) { char ch; for (ch = 'A'; ch < 'Z'; ch++) { S0IN = ch; /* Send character */ twatch (CLOCK / 900); } /* Repeat */ } Note
| ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.