Reset bei 18F2585
Mittwoch, 23. Mai 2012
 
 

PIC Mikrocontroller Forum  |  PIC Mikrocontroller  |  CCS Compiler  |  Reset bei 18F2585 « vorheriges nächstes »
Seiten: [1] Nach unten Drucken
Autor Thema: Reset bei 18F2585  (Gelesen 2390 mal)
 
mkkirchner
Newbie
*
Offline Offline

Beiträge: 2


Profil anzeigen
« am: August 06, 2011, 17:56:35 »

Hallo,
Habe ein Projekt mit einem PIC 18F2585.
Die Schaltung und die Software funktioniert im Prinzip.
Nur dass der Pic in genau gleichen Zeitabständen selbsttätig einen Reset macht.
Auch bei einem kleinen Testprogram geschieht dies:

Code:
#include "D:\Projeckte\OpenBMS\test.h"

 int32 c;
void main()
{

   setup_adc_ports(AN0_TO_AN9|VSS_VREF);
   setup_adc(ADC_CLOCK_DIV_32|ADC_TAD_MUL_20);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_vref(FALSE);
   setup_oscillator(False);

   // TODO: USER CODE!!
  c=0;
  output_high(PIN_B0);
  while(1)                         
  {   
  c++; 
  output_high(PIN_C5);
   printf("+%ld\r\n",c);
   delay_ms(500);   
   output_low(PIN_C5);
   delay_ms(500);
  }
}
Die Datei:"D:\Projeckte\OpenBMS\test.h"
Code:
#include <18F2585.h>
#device adc=16

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS                       //High speed Osc (> 4mhz)
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOBROWNOUT               //No brownout reset
#FUSES BORV21                   //Brownout reset at 2.1V
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES LVP                      //Low Voltage Programming on B3(PIC16) or B5(PIC18)
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES PBADEN                   //PORTB pins are configured as analog input channels on RESET
#FUSES BBSIZ4K                  //4K words Boot Block size
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES LPT1OSC                  //Timer1 configured for low-power operation
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)

#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
Gespeichert
Stampede
Globaler Moderator
Hero Member
*****
Offline Offline

Beiträge: 969



Profil anzeigen WWW
« Antworten #1 am: August 07, 2011, 14:55:24 »

Obwohl du ja den WDT eigentlich abgeschaltet hast, kann es nur der sein. Also die CONFIG und die Funktionen zum Abschalten nochmals prüfen.
Gespeichert

Bernd
Globaler Moderator
Hero Member
*****
Offline Offline

Beiträge: 3815



Profil anzeigen
« Antworten #2 am: August 09, 2011, 00:03:01 »

Zitat
Code:
#FUSES LVP  //Low Voltage Programming on B3(PIC16) or B5(PIC18)

Wirklich? Die wenigsten Programmiergeräte verwenden LVP. Wenn doch, muß an RB5 ein Pulldown vorhanden sein (und dieser Portpin kann nicht mehr als I/O verwendet werden). Ohne den Pulldown sind sporadische Resets oder gänzliche Nichtfunktion zu erwarten.
  
Viele Grüße

Bernd
Gespeichert

Seiten: [1] Nach oben Drucken 
« vorheriges nächstes »
Gehe zu:  

Powered by MySQL Powered by PHP Made for Mozilla (Firefox) Made for Internet Explorer
Seite erstellt in 0.034 Sekunden mit 17 Zugriffen.
 
Top! Top!