Keil Logo Arm Logo

MON51 User's Guide

Other Functions

Since most serial interface configurations are already predefined, it is extremely seldom that there is a need to modify the communication functions listed below. Please note, that it is not allowed to modify any other register value (e.g. DPTR) without saving and restoring it.

  • INITSERIAL: This function initializes the serial interface and maybe other peripherals. At the end of this function a jump to MON51 instead of a RET is necessary.
  • Ser_Int_Adr: This definition specifies the interrupt vector address of the serial interface. The default value is 023H for a standard 8051, but it can be set to any other interrupt vector address (e.g. external interrupt). If the serial interface is not able to generate an interrupt, set this value to any unused interrupt vector address.
  • INSTAT: This function returns the receive status of the serial interface in the C-flag. C = 1 means character received; C = 0 means no character received.
  • OUTSTAT: This function returns the transmit status of the serial interface in the C-flag. C = 1 means character transmitted; C = 0 means character not yet transmitted.
  • INCHAR: This function returns the received character in the accumulator.
  • OUTCHAR: This function transmits the character in the accumulator to the serial interface.
  • CLR_TI: This function clears the transmit interrupt flag of the serial interface.
  • SET_TI: This function sets the transmit interrupt flag of the serial interface.
  • CLR_RI: This function clears the receive interrupt flag of the serial interface.
  • CLR_SER_IE: This function clears the interrupt enable flag of the serial interface.
  • SET_SER_IE: This function sets the interrupt enable flag of the serial interface.
  • BEFORE_GO: This function is called before a application is started with GO or P-step. It is empty by default (only RET). This function can be used to generate a signal at a port pin or to change the memory configuration.
  • AFTER_GO: This function is called when a application has been stopped with a breakpoint. It is empty by default (only RET). It should do the opposite of BEFORE_GO.
  • WR_CODE: Since it is not possible to write to the code memory of a 8051, the external RAM needs to be 'von Neumann' wired. Therefore, write access to the code memory is usually done with a MOVX @DPTR,A instruction. However, if the target system allows a different way to do this (e.g. different address area) it can be adapted here.

arm-logo-small

Keil logo
Important information

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