beautypg.com

General programming, 1 introduction, 2 memory usage – Measurement Computing Micro 488/EX rev.2.1 User Manual

Page 43: 1 serial i/o buffers

background image

Section 4

General Programming

4.1

General Programming

4.1 Introduction

This section provides example information for programming the Micro488/EX in

the Controller and Peripheral modes using the MACRO and clock features. The
concentration is placed on Micro488/EX commands and not specifically on the
programming language. All the examples shown use one of the TERMINAL programs
listed in Appendix D. Other languages may be used as long as they provide similar
functionality. Using this type of terminal program is recommended to become familiar
with the Micro488/EX and any new bus device as it allows direct human-device
interaction.

4.2 Memory Usage

To better understand MACRO programming on the Micro488/EX, a description of

how the system allocates memory for different functions will allow the user to tailor
programming for the most effective use.

Memory in the Micro488/EX is dynamically allocated for the serial input, serial

output, MACRO and LOG buffers. This allows for the most efficient partitioning of
memory for any given application. This memory is kept in the USER 'heap' (a
vernacular for 'heap of memory') until required by the system. A MEMORY command
has been included in the Micro488/EX to report the available memory in the USER
heap.

4.2.1 Serial I/O Buffers

At power on, each serial buffer is allocated an empty 127 byte mini-

buffer or queue. When the serial input [or output] requires more buffer
space, additional queues are allocated. When a queue is empty, it is released
from the buffer so that it may be re-allocated when, and where, required.

There are approximately 240 available queues for a total of 29,000

bytes of buffer (character) space. Queues are continually allocated and
released as required. Of the 240 available queues, 230 are assigned to the