bonjour a tous,
j'utilise un pic16F1508 avec le compilateur MPLABX ,
voici le code :
comme je l'ai mentionné dans ma question mon delay dure 5 sec au lieu de 500 ms pourtant mon code est bonCode:#include <xc.h> #include <stdlib.h> // configuration du PIC16F1508 #pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin) #pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled) #pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR) #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) #pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset disabled) #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin) #pragma config IESO = OFF // Internal/External Switchover (Internal/External Switchover mode is disabled) #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is disabled) // CONFIG2 #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.) #pragma config LVP = OFF #ifndef _XTAL_FREQ #define _XTAL_FREQ 8000000 #endif void init_pic() { ANSELB=0; TRISB=0x00; PORTB=0x00; } void main() { init_pic(); RB7=1; __delay_ms(500); RB7=0; }
savez vous pourquoi et comment je peux corriger ca,
merci d'avance
-----