Hi all
I want to be able to create a 1ms delay using timer0 and have tried the below code.
Timer0 problem with PIC16F1716
I want to be able to create a 1ms delay using timer0 and have tried the below code.
Code (Text):
- #include <stdio.h>
- #include <pic16f1716.h>
- #include <xc.h>
- #include <stdlib.h>
- #pragma config FOSC = INTOSC
- #pragma config WDTE = OFF
- #pragma config PWRTE = OFF
- #pragma config CLKOUTEN = ON
- void delay();
- int main(int argc, char** argv)
- {
- PORTB = LATB = ANSELB = TRISB = 0;
- OSCCONbits.SCS = 0b10;
- OSCCONbits.IRCF = 0b1111;
- OPTION_REGbits.PSA = 0;
- OPTION_REGbits.PS...