3 Using Stimulus
During simulation, the program being executed by the simulator may require stimuli from the outside. Stimulus is the simulation of hardware signals/data into the device. This stimulus could be a level change or a pulse to an I/O pin of a port. It could be a change to the values in an SFR (Special Function Register) or other data memory.
In addition, stimulus may need to happen at a certain instruction cycle or time during the simulation. Alternately, stimulus may need to occur when a condition is satisfied; for example, when the execution of program has reached a certain instruction address during simulation.
Basically, there are two types of stimulus:
- Asynchronous – A one-time change to the I/O pin or RCREG triggered by a firing button on the stimulus GUI within the MPLAB X IDE.
- Synchronous – A predefined series of signal/data changes to an I/O pin, SFR or GPR (e.g., a clock cycle).
To define when, what and how external stimuli are to happen to a program, you would use the 3.4 Stimulus Window tabs to create both asynchronous and synchronous stimulus on a stimulus workbook. Advanced users can attach and generate an SCL (Simulator Control Language) file for custom stimulus needs.
If you will be using multiple forms of stimulus input, you should be aware of input interaction (see 3.6 Stimulus Control Language (SCL)).