The following is a list of the available plugins, their type and what they do. More details of each are available in the following section.
Plugin | Type | Configurable | Function |
---|---|---|---|
Television | Medium | No | Simulates a video display |
Simple Led | Medium | No | A simple, non configurable LED |
Better Led | Medium | Yes | A configurable LED |
Simple Switch | Fast | Yes | A switch, toggle or momentary |
LED Array | Medium | No | An array of four LEDS |
7 Segment LED | Medium | Yes | One or two seven segment LED displays |
Memory Monitor | Fast | No | Displays the registers and EEProm contents |
LCD Display | Slow | Yes | HD 44780 compatible LCD display |
Fast plugins make no attempt to synchronise with the processor - they either only update when simulation is completed, or only respond to user actions. Examples of fast plugins would be the Memory Monitor (which only updates at the end of a 'Step' or 'Over', or when 'Stop' is clicked) or the Simple Switch, which interacts with the microcontroller only when the user presses the switch. Simulation speed is hardly affected by Fast Plugins at all.
Medium plugins respond to output from the microcontroller. Whenever a signal from the microcontroller ports changes, a Medium plugin is informed of the event and can perform an appropriate task. Clearly the task will take longer if the plugin must decode a complex set of signals, or if it must draw graphics to the screen. Simulation speed will depend on how much work the plugin will do for each signal change, and how often the simulated program alters those signals. Examples of Medium plugins are the LEDs, which update whenever the port outputs change, or the Television plugin, which builds a video picture from the outputs generated by the microcontroller.
Slow plugins are exactly synchronised with the microcontroller, so that they can behave correctly with regards to generating signals to the microcontroller. A Slow plugin is informed after each instruction is simulated, so that it can update or monitor signals for the microcontroller. In fact, the interrupt simulation for the microcontroller is a form of slow plugin. Invoking a plugin every time an instruction is executed slows down the processor enormously. An example of a Slow plugin is the LCD display, which times its busy signal to be synchronised with the microcontroller. In fact the LCD plugin does its best not to slow down simulation, by only requesting full synchronisation when it is busy.
If the configuration of a plugin is likely to be very complex, the Plugin author can choose to design their own user interface to edit or view that configuration.
Port
A:0
- For Port A, Bit 0
The notation of port name:bit number is used in this manual to identify a particular bit on a given port, and is used in config strings for the same purpose.
Plugins may wish to connect to more than a single pin of a port, however. miSim DE provides a standard piece of software to handle these connections, called the Port Mapper. The Port Mapper provides a standard way of describing and processing a larger number of connections to one or more ports. To describe the connections, each of the signals that must be linked to the plugin is named with a single character. For example, if the Plugin has a four bit bus, the four connections that must be made could be called '0','1','2' and '3'. If the Plugin has an Enable signal, it might be called 'E'.
To tell the port mapper the connections from the Plugin's signals to the microcontroller, the config string lists a port name, followed by the signals connected to that port. The signals listed for each port are in order of the port bits - with the '0' bit last. So the mapping:
Port
A:ER
Connects the signal 'E' to Port A, bit 1 and the signal 'R' to Port A bit 0. If a port bit is not connected to any signal, it can be marked with an 'x'. Only as many bits as are connected need to be listed. Another example would be:
Port
A:WRxE
Which maps the signal 'W' to Port A, bit 3 and the signal 'R' to Port A, bit 2. Bit 1 of Port A is not mapped to any signal. Port A bit 0 is mapped to the signal 'E'.
If more than one port is mapped, then each port mapping is comma separated. For instance:
Port A:WRxE, Port
B:3210
Which adds to the Port A Mapping above the signals '3' to '0' mapped to bits 3 to 0 on Port B.
The Television plugin simulates a composite video display connected to Port A:0 for the sync signal, and Port B:0 for the brightness signal. The plugin assumes that the processor is running at 12MHz. This is compatible with the hardware and software developed by Rickard Gunée to play Pong and Tetris on the PIC MCU. For more information on generating video signals in software on the PIC MCU, visit Rickard's excellent homepage.
The Simple LED Plugin is a handy code example for producing a Plugin that responds to an output from the microcontroller. In this case, the LED lights when Port B, bit 0 is high ('1').
The Better LED is more sophisticated than the Simple LED in that the port that the LED is connected to can be configured, as can the colour of the LED. As with the Simple LED, the LED lights when the chosen port pin is high ('1').
The configuration string for the Better LED is as follows:
Port Name:Bit Number
[Colour]
Port Name is the name of any port for the simulated microcontroller. In the case of the PIC16X84, the choices are 'Port A' or 'Port B'. The bit number is the bit number on the port. The PIC16X84 Port A can have a bit number of 0 to 4 (it is a five bit port). Port B can have a bit number of 0 to 7 (an eight bit port). The Colour parameter is optional and is a single character indicating the colour of the LED. The colour may be 'r' - Red, 'g' - Green or 'b' - Blue. If no colour is specified, the LED will be red. An example configuration for a green LED connected to Port B, bit 5 would be:
Port B:5
g
The Simple switch provides both momentary and toggle switches in one. You can click 'Toggle' to switch from 'On' to 'Off' and back again. Clicking 'Momentary' will turn from 'On' to 'Off', or vice-versa only as long as the button is clicked. The switch can be connected to any Port pin, with the configuration string:
Port Name:Bit
Number
For example to connect a switch to Port A, bit 0, the configuration would be:
Port
A:0
The LED Array is an array of four red LEDs connected to Port B, pins 0 to 3. It cannot be configured, but is an example of altering the simple LED plugin to provide different behaviour.
The Seven Segment LED plugin can provide one or two seven segment LEDs connected to port B. The configuration string decides one of the following settings:
Configuration | Behaviour |
---|---|
b |
One digit, each segment connected to a separate pin |
d1 |
One digit, displays hex value on pins 0-3 |
d2 |
Two digit, displays hex values on pins 0-7 |
The Memory Monitor plugin displays the contents of the Registers and EEProm of the microcontroller being simulated. It updates when simulation is complete - i.e. after each 'Step' or 'Over' command, or when 'Stop' is clicked to stop a running simulation.
The LCD Display simulates a HD 44780 controlled LCD display. The display has three controlling signals, and either four or eight data lines that must be connected to the microcontroller. The display may be one, two or four lines deep, and may have eight, sixteen, twenty, twenty-four, thirty-two or forty columns. Note that some combinations of height and width are not available. Those that are supported are shown below:
Columns | |||||||
---|---|---|---|---|---|---|---|
Rows | 8 | 16 | 20 | 24 | 32 | 40 | |
1 | Yes | Yes | Yes | Yes | Yes | Yes | |
2 | No | Yes | Yes | Yes | Yes | Yes | |
4 | No | Yes | Yes | No | No | No |
The three controlling signals are 'R' - Read/write, 'E' - Enable and 'S' - Select. The eight data signals are indentified by the digits '0' through '7'. If a four bit interface is being used (selected in software), then only bits '7' through '4' need to be connected.
To configure the LCD, the height and width are specified, then the port mappings for the control and data signals are given. The LCD plugin uses a Port Mapper to read these settings, so the format for the mappings is standard, and shown below. The basic config therefore is of the form:
HEIGHTxWIDTH, Port
Mappings
A Port mapping consists of the Port name, a colon and then the relevant signals that are connected to that port. The signals are listed in port bit order, with the least significant bit last. Pins that are not connected to a signal are indicated with an 'x'. Therefore the mapping 'Port A:ExxRS' will connect the signal 'E' to Port A, bit 4, the 'R' signal to Port A, bit 1 and the 'S' signal to Port A, bit 0. If more than one port is mapped to different signals, then the additional ports are separated by commas.
In the case of the LCD plugin, the signals are 'R','E','S' and '7-0', though signals '4-0' are not needed if a four bit interface is being used. A simple configuration for a one line, eight character display connected with an eight bit interface might be:
1x8, Port A:ERS, Port
B:76543210
A two line by twenty character display, connected with a four bit interface might be:
2x24, Port A:ERS,
Port B:7654xxxx
For more information on the HD 44780 display controller and writing software for it, you can visit Peer's LCD Pages or Ian Harries' LCD Information
![]() |
![]() |
![]() |