Buenas muchacchos/as les comento el problema que estoy teniendo , cree un programa para relizar el parpadeo de un led , lo simulo con el proteus funciona perfectamente , y cuando lo paso al micro y lo conecto a veces funciona un rato y luego se apaga y no vuelve a funcionar o directamente no funciona a veces .
Todo esto me trae dudas ya que es la primera vez que uso clock interno aunque me lo recomendaban y tambien es la primera vez que toco demasiado los fuses para sacarle la funcion de MCLR para no poner un pull-up externo y demas .. uds que me dicen tienen una idea de que podria llegar a ser ?
Aca les dejo el codigo y el circuito :
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>
// PIC16F88 Configuration Bit Settings
// CONFIG1
#pragma config FOSC = INTOSCIO // Oscillator Selection bits (INTRC oscillator; port I/O function on both RA6/OSC2/CLKO pin and RA7/OSC1/CLKI pin)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF // RA5/MCLR/VPP Pin Function Select bit (RA5/MCLR/VPP pin function is digital I/O, MCLR internally tied to VDD)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = ON // Low-Voltage Programming Enable bit (RB3/PGM pin has PGM function, Low-Voltage Programming enabled)
#pragma config CPD = OFF // Data EE Memory Code Protection bit (Code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off)
#pragma config CCPMX = RB0 // CCP1 Pin Selection bit (CCP1 function on RB0)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
// CONFIG2
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor enabled)
#pragma config IESO = ON // Internal External Switchover bit (Internal External Switchover mode enabled)
#define _XTAL_FREQ 4000000 ;
/*
*
*/
void main ()
{
TRISB = 0x00;
OSCCON = 0b01101100;
while (1)
{
PORTBbits.RB0 = 0;
_delay(150000);
PORTBbits.RB0 = 1;
_delay(150000);
}
}