|
|||||||||||
Technical Support On-Line Manuals µVision3 User's Guide µVision3 Overview 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 Simulation I²C Concepts I²C Simulation Virtual Simulation Registers (VTREG) Simulating an I²C Device Application Examples SPI Simulation Flash Programming Dialogs Example Programs Command Line Appendix |
UART CommunicationMany microcontrollers provide a standard UART or RS232 serial interface. The µVision3 Debugger simulates the UART interface of a microcontroller and provides three Serial Windows which operate like a terminal. The serial windowsthat opens with View — Serial Window #1 .. #3. These serial windows interact like a terminal. As an alternative you may direct the serial output even to any available COM port of your computer using the ASSIGN command. Peripheral DialogThe dialogs provided in the Peripheral Menu show the current status of the UART in your microcontroller system. In this way you may easily review the communication baudrate and other parameters of your system.
Virtual Simulation Registers (VTREG)For simulation of UART communication, the µVision3 Debugger implements the following virtual simulation registers (VTREG)
The VTREG naming conventions SxIN, SxOUT, and SxTIME vary from device to device. Several devices provide more than one UART interface and therefore the VTREG names may be prefixed with S0 or S1. You may use the command DIR VTREG to check the virtual simulation register names of the UART interface of the device you have selected. Input Characters via the SxIN VTREGThe SxIN VTREG represent the inputs to the on-chip serial port of the microcontroller. The following Debug Commands (typed in the debugger's Command Window) input a value into the serial stream. Note that you may also use the Serial Window in the µVision3 Debugger to input characters for the serial port. SIN = 'A' /* Input the letter A into the serial stream */ SIN = 0x019E /* Input the 9-bit value 19Ex into the serial stream */ SIN = 0xA9 /* input value 0xA9 to I/O stream for the UART */ Control UART Communication TimingThe SxTIME VTREG allows you to control 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 */ } Refer to the Support Knowledgebase at www.keil.com/support for an Automated Serial Input Script and other examples. | ||||||||||
|
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.