Autor Tema: AYUDA CON REINICIO DE 30F4013  (Leído 2448 veces)

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

Desconectado Win0

  • PIC10
  • *
  • Mensajes: 3
AYUDA CON REINICIO DE 30F4013
« en: 15 de Enero de 2011, 18:43:23 »
Que tal amigos, les escribo porque tengo una situación que se sale de mis manos lo que pasa es que me estoy iniciando en el mundo de los dspic con un 30f4013 y la cosa es que apenas voy en el simple ejemplo de prender y apagar un led , la cosa es que el micro se reinicia cada cierto tiempo y la verdad no se porque, lo tengo montado en un protoboard  y estoy usando una fuente de computador y condensadores de 100nf en los vcc , ademas he probado con cristales externos y el oscilador interno y nada , siempre se reinicia , es mas lo he intentado en varios lenguajes como c30, miKro C y CCS  desabilitando el WDT , pero aun así no para de reiniciarse, gracias por su tiempo y espero me puedan ayudar.

estos son los codigos que estoy usando en picc

#include <30F4013.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES FRC_PLL16                //Internal Fast RC oscillator with 16X PLL
#FUSES PR_PLL                   //Primary Oscillator with PLL
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES WPSB16                   //Watch Dog Timer PreScalar B 1:16
#FUSES WPSA512                  //Watch Dog Timer PreScalar A 1:512
#FUSES PUT64                    //Power On Reset Timer value 64ms
#FUSES NOBROWNOUT               //No brownout reset
#FUSES BORV47                   //Brownout reset at 4.7V
#FUSES LPOL_HIGH                //Low-Side Transistors Polarity is Active-High (PWM 0,2,4 and 6)
   //PWM module low side output pins have active high output polar
#FUSES HPOL_HIGH                //High-Side Transistors Polarity is Active-High (PWM 1,3,5 and 7)
   //PWM module high side output pins have active high output polarity
#FUSES NOPWMPIN                 //PWM outputs drive active state upon Reset
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOCOE                    //Device will reset into operational mode
#FUSES ICS0                     //ICD communication channel 0
#FUSES RESERVED                 //Used to set the reserved FUSE bits

#use delay(clock=117920000)



void main()
{
   setup_spi(SPI_SS_DISABLED);


   setup_wdt(WDT_OFF);
   setup_timer1(TMR_DISABLED);
   output_HIGH(pin_b9);
   delay_ms(1000);
   output_low(pin_b9);
   while(1)
   {}

   // TODO: USER CODE!!

}

EN MIKROC

void main() {

  //--- turn off A/D inputs
  ADPCFG = 0xFFFF;
  LATB = 0xFFFF;
  TRISB = 0;
  Delay_ms(1000);
  LATB = ~LATB;
  while(1)
  {
  }
}

EN C30 CON VISUALINITIALIZER

#include<p30f4013.h>
#include <libpic30.h>
#include <dynamixel.c>
int  main(void)
{
    VisualInitialization();

    PORTBbits.RB9=1;
    __delay32(29480000);
    PORTBbits.RB9=0;
    while(1)
    {}
   return 0;
}


COMO PUEDEN VER LA IDEA ES QUE PRENDA EL LED Y DESPUÉS DE UN TIEMPO LO APAGUE Y LUEGO QUE NO HAGA NADA, PERO DESPUÉS DE UN TIEMPO VUELVE Y PRENDE EL LED EJECUTANDO LA RUTINA , POR LO CUAL SE QUE EL MICRO SE REINICIA.


Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18286
    • MicroPIC
Re: AYUDA CON REINICIO DE 30F4013
« Respuesta #1 en: 16 de Enero de 2011, 03:45:10 »
¿ #use delay(clock=117920000) ?

¿Cómo has calculado esa cifra?


 

anything