ElecM
aka m.devriesjr
Ik gebruik een 16F872 microcontroller, maar deze start niet op. . . Behalve als ik met de multimeter aan oscillator pinnen ga meten. Heb verschillende oscillators geprobeerd en waardes condensatoren, maar zonder succes.. De microcontroller wordt gevoedt (en gemeten) door een stabiele 5V, middels een LM7805.
Een overzicht van de gegevens:
De hardware
PIC = 16F872
Xtal = 4MHz
C's = 22pF
programmer
Pickit2
Ontwikkelomgeving
CCS C Compiler IDE (PWM)
CODE
#include <TEST.h>
void main (void){
while(TRUE){
output_high(LAMP1);
output_high(LAMP2);
output_high(LAMP3);
output_high(NUL);
output_high(HORN);
output_high(LED1);
output_high(LED2);
output_high(LED3);
}
}en de H file
#include <16F872.h>
#fuses HS, nowdt, noprotect, put, BROWNOUT, NOLVP, NOWRT, NODEBUG
#use delay (clock=4000000) //Fosc = 4MHz
#define JUMPER6 PIN_A0
#define JUMPER5 PIN_A1
#define JUMPER4 PIN_A2
#define JUMPER3 PIN_A3
#define JUMPER2 PIN_A4
#define JUMPER1 PIN_A5
#define LAMP1 PIN_B0
#define LAMP2 PIN_B1
#define LAMP3 PIN_B2
#define LED3 PIN_B3
#define LED2 PIN_B4
#define LED1 PIN_B5
#define PGC PIN_B6
#define PGD PIN_B7
#define not_used0 PIN_C0
#define START PIN_C1
#define STOP PIN_C2
#define EMERGENCY PIN_C3
#define not_used1 PIN_C4
#define not_used2 PIN_C5
#define NUL PIN_C6
#define HORN PIN_C7
Heb de code tevens getest met de PIC Simulator, en hij werkte gewoon hier....
Heb je de XT fuse al geprobeerd?
100nF over voedingspennen?
[Bericht gewijzigd door tubos op (30%)]