|
STC15W408AS library 0.12.0
|

Macros | |
| #define | COUNTER0_INITIAL_VALUE 65530 |
| Counter0 initial value. Counts is 65535 - initial value. | |
| #define | LED_PIN P10 |
| LED pin. | |
| #define | LED_OFF 1 |
| LED state OFF. | |
| #define | LED_ON 0 |
| LED state ON. | |
Functions | |
| void | counter0ISR () __interrupt(1) |
| Counter0 interrupt service routine. | |
| void | main () |
| main function | |
How to use counter0 in mode1.
Program counts from 65530 to 65535 (5 times). Counter is drived by T0 pin change state in a main function. On T0 pin change from 1 to 0 counter is incremented. On each T0 pin change LED is toggled.
LED is blinking 5 times and counter is stopped. On each T0 pin change counter value printed to UART.