µVision simulates the behavior of I/O inputs. If an I/O pin is
configured as counter input, then the count value increments when the
pin toggles. The following example shows how to simulate input for
Counter 3:
// in your C user program
T3CON = 0x004B; // set T3 Counter Mode
You may toggle the counter input P3.6 with the VTREG PORT3, i.e.
with a signal function:
signal void ToggleT3Input (void) {
while (1) {
PORT3 = PORT3 ^ 0x0040; // toggle P3.6
twatch (CLOCK / 100000); // with 100kHz
}
}
View of the Counter 3 status with the Peripheral dialog.
Also, interrupt inputs are simulated: if a port pin is used as
interrupt input, then the interrupt request will be set when you
toggle the associated I/O pin.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.