Hallo zusammen,
ich habe eine Schaltung entwickelt nach Vorbild des
http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=dv164139-2
Entwicklungsboards . Leider kriege ich jedoch mein Testprogramm per
MPLABX IDE über das PICKIT 3 nicht Programmiert.
Es taucht folgende Fehlermeldung auf "Target Device ID (0x0) does not
match expected Device ID (0x3024)." Ich habe das ganze mit externen
Spannungsversorgung von 3,3V versucht und mit Versorgung direkt über das
PICKIT 3, beides mit dem selben Ergebnis.
Der Controller ist Brandneu und wurde nie zuvor programmiert. Daher
schließe ich einen Fehler aufgrund von Programmierung aus. Desweiteren
habe ich mehrere dieser Boards herstellen lassen, alle weisen den selben
Fehler auf. Die Pinbelegung der Programmierschnittselle habe ich
ebenfalls mit dem Durchgangsprüfer getestet.
So sieht meine confg.h header File aus für die Konfigurationsbits aus
1 | // PIC16LF1454 Configuration Bit Settings
|
2 |
|
3 | // 'C' source line config statements
|
4 |
|
5 | #include <xc.h>
|
6 |
|
7 | // #pragma config statements should precede project file includes.
|
8 | // Use project enums instead of #define for ON and OFF.
|
9 |
|
10 | // CONFIG1
|
11 | #pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator: I/O function on CLKIN pin)
|
12 | #pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled)
|
13 | #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled)
|
14 | #pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR)
|
15 | #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)
|
16 | #pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset disabled)
|
17 | #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)
|
18 | #pragma config IESO = ON // Internal/External Switchover Mode (Internal/External Switchover Mode is enabled)
|
19 | #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled)
|
20 |
|
21 | // CONFIG2
|
22 | #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off)
|
23 | #pragma config CPUDIV = CLKDIV6 // CPU System Clock Selection Bit (CPU system clock divided by 6)
|
24 | #pragma config USBLSCLK = 48MHz // USB Low SPeed Clock Selection bit (System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8.)
|
25 | #pragma config PLLMULT = 3x // PLL Multipler Selection Bit (3x Output Frequency Selected)
|
26 | #pragma config PLLEN = ENABLED // PLL Enable Bit (3x or 4x PLL Enabled)
|
27 | #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset)
|
28 | #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.)
|
29 | #pragma config LPBOR = OFF // Low-Power Brown Out Reset (Low-Power BOR is disabled)
|
30 | #pragma config LVP = ON // Low-Voltage Programming Enable (Low-voltage programming enabled)
|
Die main.c ist nahezu leer bis auf die Einbindung der confg.h etc. das
Programmieren sollte ja trotzdem funktionieren.
1 | /*
|
2 | * File: main.c
|
3 | * Author: Martin
|
4 | *
|
5 | * Created on 4. November 2015, 09:00
|
6 | */
|
7 |
|
8 | #include <stdio.h>
|
9 | #include <stdlib.h>
|
10 | #include "confg.h"
|
11 | /*
|
12 | *
|
13 | */
|
14 | int main(int argc, char** argv) {
|
15 |
|
16 | return (EXIT_SUCCESS);
|
17 | }
|
Ich stehe leider total auf dem Schlauch.
Gruß Martin