Autor Tema: Pic16F88 XC8 - Blink - Parpadeo de LED Problema  (Leído 1837 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado nahueldiaz1992

  • PIC12
  • **
  • Mensajes: 75
Pic16F88 XC8 - Blink - Parpadeo de LED Problema
« en: 18 de Agosto de 2014, 18:34:28 »
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 :

Código: [Seleccionar]
#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);
    }
   
}



Desconectado AngelGris

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 2480
Re: Pic16F88 XC8 - Blink - Parpadeo de LED Problema
« Respuesta #1 en: 18 de Agosto de 2014, 21:04:49 »
  Yo pondría en off el bit BOREN. Y si es que no utilizas Low Voltage Programming, también pondría en off el bit LVP.
De vez en cuando la vida
nos besa en la boca
y a colores se despliega
como un atlas

Desconectado nahueldiaz1992

  • PIC12
  • **
  • Mensajes: 75
Re: Pic16F88 XC8 - Blink - Parpadeo de LED Problema
« Respuesta #2 en: 19 de Agosto de 2014, 23:03:54 »
Si si justamente era eso , los fuses :/ muchas gracias !