Hi,
ich habe seit letzter Woche das Problem, dass ich einen PIC nicht zum
laufen bekomme. flashen geht, irgendwie läuft er nicht.
1 | #include <p30fxxxx.h>
|
2 | #include <xc.h>
|
3 |
|
4 | _FOSC(CSW_FSCM_OFF & XT_PLL4); // Run this project using an external crystal routed via the PLL in 4x multiplier mode
|
5 | _FWDT(WDT_OFF); // Turn off the Watch-Dog Timer.
|
6 | _FICD(ICS_PGD); // Communicate on PGC/EMUC and PGD/EMUD
|
7 | _FBORPOR(MCLR_EN & PWRT_OFF); // Enable MCLR reset pin and turn off the power-up timers.
|
8 | _FGS(CODE_PROT_OFF); // Disable Code Protection
|
9 |
|
10 |
|
11 | int main (void)
|
12 | {
|
13 | ADPCFGbits.PCFG0 = 1; // Initialize pin RB0 as digital
|
14 | TRISBbits.TRISB0 = 0; // Set RB0 as digital output (LED 1)
|
15 | LATBbits.LATB0 = 0; // Set RB0 to HIGH
|
16 |
|
17 | while (1) {
|
18 | }
|
19 |
|
20 | return 0;
|
21 | }
|
hier soll einfach eine led eingeschaltet werden. Auch in den debug-modus
komme ich nicht.
Programming/Verify complete
The target device is not ready for debugging. Please check your
configuration bit settings and program the device before proceeding. The
most common causes for this failure are oscillator and/or PGC/PGD
settings.
die configuration bit settings müssten so aber eigentlich in ordnung
sein. PGC/PGD sind richtig mit dem pickit3 verbunden.
den quarz habe ich mit je 22pF an OSC1 und OSC2 verbunden.
Mit dem Multimeter kann ihc an diesen pins auch eine spannung von ~2,3V
messen. leider habe ich kein oszilloskop um zu ermitteln, ob der quarz
wirklich läuft.
ein anderes board, mit selbem pic und quarz usw. war schon einmal in
betrieb. doch auch hier funktioniert jetzt jetzt auf einmal nichts mehr.
Gibt es bei MPLABX noch irgendetwas was ich evtl. geändert haben könnte,
wodurchr nchts mehr funktioniert?
Johannes