In Full Chip Simulation (FCS) mode, this module simulates all functionality of the Timer Interface module, including:
FCS mode uses the simulated port inputs to trigger the input capture on a given timer channel. To define an input state of the specific port, use the INPUT<x> <n> command in the Command window. The <x> represents the corresponding I/O port, while <n> stands for the input value to write to this port. At the same time, the INPUTS command can be used to display the Simulated Port Inputs for all general I/O ports. It displays the current simulated values to all applicable input ports. Refer the documentation for Timer Module Commands for more information about the various forms of this command.
Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port. To trigger the event, first set the port inputs high or low and then invert them to an opposite value, depending on whether the input capture is set for rising/falling edge. Once the Input Capture event takes place you can observe the CHxF in the Channel Status and Control register in the Memory window.
If the Timer module is configured for an Output Compare event, then once the event takes place you can observe the same CHxF Flag via the Memory window. If the timer channel interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the Timer channel interrupt vector is properly defined. To observe the Timer Overflow Flag (TOF) flag being set as a result of the corresponding CPU event, situate your Memory window on the memory location of the Timer Status and Control register.
To observe the Pulse Width Modulation (PWM) operation, properly configure the Timer to operate in the Modulo up count mode, select the toggle-on-overflow or clear/set output on compare events to create the desired duty cycle wave. Once a PWM event takes place, you can observe pin toggle/clear/set behavior corresponding to the Timer configuration in the Memory window displaying the I/O port associated with a given timer channel.
To observe the accuracy of the Timer module operation, you can observe the number of CPU cycles that it takes for the event to occur. The cycle counter is only incremented as the you step through the code. To determine the exact amount of cycles over which the event occurs, one can either observe the cycle display in the Register window or use the built in simulation commands. To display the current number of cycles in the Command window, use the CYCLES command. To change the number of cycles in the cycle counter, use CYCLES <n>, where <n> is the new cycle value. If the event has a pre-calculated number of cycles, use CYCLE 00 to reset the number of cycles and GOTOCYCLE <n> to run through the code until you reach the expected event.