Keil Logo

Peripheral Simulation

For Silicon Laboratories, Inc. C8051F020 — Serial UART 0 (Enhanced Interface)

Simulation support for this peripheral or feature is comprised of:

  • Dialog boxes which display and allow you to change peripheral configuration.
  • VTREGs (Virtual Target Registers) which support I/O with the peripheral.

These simulation capabilities are described below.

Serial Channel 0 Dialog

Serial Channel 0

The Serial Channel dialog displays and allows you to edit the configuration of the Serial Interface.

  • Mode displays and allows you to change the serial interface mode of operation (data bit length and baud rate).
  • SCON0 (Serial Control Register 0) holds the control and setup information for programming the serial port.
  • SBUF0 (Serial Interface Buffer Register 0) contains the transmit data to be sent or received data.
  • SADDR0 (Slave Address) when the MCU is a master, this selects a slave device for communication with another serial device.
  • SADEN0 (Slave Address Mask) determines which bits of the slave address are used for communication with another serial device.
  • SM20 (Enable Serial Port Multiprocessor Communication In Modes 2 and 3) is set to suppress a receiver interrupt (RI0) if the received 9th data bit is 0.
  • TB80 (Serial Port Transmitter Bit 9) is the 9th data bit to be transmitted for serial modes 2 and 3.
  • RB80 (Serial Port Receiver Bit 9) is set for serial modes 2 and 3 when a 9th bit is received. In serial mode 1, this is the stop bit.
  • SSTAT0 (Status Mode Select) is set to enable framing error, receiver overrun and transmitter collision detection.
  • FE0 (Framing Error Detected) is set when an invalid stop bit (framing error) is detected. This bit must be reset by software.
  • REN0 (Receiver Enable) is set to enable serial data input.

BaudRate

  • SMOD0 (Double Baudrate) is set to double the baudrate in mode 2.
  • RCLK0 (Receive Clock Enable) is set to use Timer 2 overflows for the receive clock. If reset, Timer 1 overflows are used.
  • TCLK0 (Transmit Clock Enable) is set to use Timer 2 overflows for the transmit clock. If reset, Timer 1 overflows are used.
  • Transmit & Receive Baudrate is the actual baudrate for the serial channel. It may be derived from the oscillator frequency or generated by Timer 1.

IRQ

  • TI0 (Transmitter Interrupt Flag) is set by hardware for each character frame transmitted. TI0 is cleared by software.
  • RI0 (Receiver Interrupt Flag) is set by hardware for each character frame received. RI0 is cleared by software.

SxTIME VTREG
Data Type: unsigned char

The SxTIME VTREG allows you to control the timing of the simulated serial port 0, 1, and so on.

  • A value of 1 (which is the default) indicates that the serial port timing is identical to the target hardware. Use this value when you want to see the effects of baud rate on the serial port I/O.
  • A value of 0 indicates that all serial input and output occur instantaneously. Use this value when you don't care about any baud rate effects or when you want serial output to be fast.

For example:

S0TIME = 0   /* Set Serial Port 0 for FAST timing */
S0TIME = 1   /* Set Serial Port 0 for accurate timing */
Get more information about the
Peripheral Simulation Capabilities
of the µVision Debugger.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

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.