Crossware

Table of Contents        Previous topic       Next topic       

Using the Console I/O Utility

SelectConsole I/O  from the Peripherals menu to open the console i/o dialog box.

This dialog box can be used enable or disable memory mapped I/O and to specify the external ram mapping address to be used.
Click in the Map I/O to External Ram checkbox to enable and disable Console I/O.  A cross in the checkbox indicates that Console I/O is enabled.

Edit the address in the edit box to the hexadecimal value that you wish to use as an I/O address. This address can be anywhere in external ram and so should be selected to suit your program.

If you are using a compiler, such as the Crossware 8051PSDS C Compiler, which uses external ram as heap and stack, it is best to specify a memory mapped address at either the top or bottom of external ram (0000h or 0FFFFh).  Be sure to reserve the memory location by defining an absolute XDATA segment with an appropriate space allocation directive in it.  Eg:

    XSEG AT &0000
    DS 1

You should also do the same with the Crossware 8051XDS Relocatable Cross Assembler to make sure that the linker does not allocate this space to a relocatable segment.

No special requirements are needed when using the Crossware 8051XPC Absolute Cross Assembler.

When console I/O is enabled, any bytes written to the specified external ram address are sent to the console I/O window.  This window is automatically opened when the first byte is output.

If console I/O is disabled, bytes written to the mapped address are discarded.

Also when console I/O is enabled, when the 8051 program reads a byte from the mapped address, the simulator will wait for data to be entered into the console I/O window.  If the window is not already open, it will be opened automatically when the address is first read.

By default, console I/O is disabled and the mapping address is $FE00.  If you change the setting, the new setting will be save in the program status file and restored when you next open the same program.

Console I/O is not a simulation of any particular peripheral, it is only a convenient way of enabling input and output for the 8051 program that is running.  On the other hand, the alternative serial input and serial output is a true simulation and requires the 8051 program to have correctly set up the serial port.