Recently I built my own PIC32MX274F256D development board where I want to experiment.
My problem is that the board cannot be programmed. I tried ICD3 and PickIt3 with MPLAB X IDE and IPE.
The dev board uses a 16MHz crystal with 18pF caps as primary osc and a 32.768KHz with 12pF caps, as a secondary osc for the RTC
These are my configuration bits:
I tried to power the MCU from the programmer ICD3/PickIt3 and also from external 3.3v power supply
I tried to program the MCU through PGC1/2/3/4. Nothing!
I changed the configuration bits. Nothing!
I checked the board for short circuits wrong connections etc. Nothing!
When I try to program the MCU through IPE I can successfully erase the MCU, and perform a blank check.
Also I let the tool to choose the memory ranges. Nothing!
When I try to verify after erase it produces the following message:
Erasing... Erase successful Verifying... The following memory areas(s) will be verified: program memory: start address = 0x1d000000, end address = 0x1d03ffff boot config memory configuration memory boot config memory Address: 1fc00000 Expected Value: ffffffff Received Value: ff00002 program memory Address: 1d000000 Expected Value: ffffffff Received Value: 27bdffa8 Verify failed When I perform an erase action and then I try to program the MCU I receive the following message:
Erasing... Erase successful 2018-08-26 13:25:47 +0300 - Hex file loaded successfully. Loading code from C:\Users\me\Desktop\MPLAB PDN\projects\projects\PIC32_My_General_Examples\devBoard\devBoard.X\dist\default\production\devBoard.X.production.hex... 2018-08-26 13:26:04 +0300 - Programming... Device Erased... Programming... The following memory area(s) will be programmed: program memory: start address = 0x1d000000, end address = 0x1d0007ff boot config memory configuration memory boot config memory Address: 1fc0001c Expected Value: 275a0270 Received Value: 275a0010 Failed to program device I don't know what I am doing wrong here.
I also replaced the MCU with a new one. NOTHING!
Next I present the test program that I try to send to the MCU to see if it can be programmed.
#include <stdio.h> #include <stdlib.h> #include <xc.h> // DEVCFG3 // USERID = No Setting #pragma config AI2C1 = ON // Alternate I/O Select for I2C1 (I2C1 uses the ASDA1/ASCL1 pins) #pragma config AI2C2 = ON // Alternate I/O Select for I2C2 (I2C2 uses the ASDA2/ASCL2 pins) #pragma config PMDL1WAY = ON // Peripheral Module Disable Configuration (Allow only one reconfiguration) #pragma config IOL1WAY = ON // Peripheral Pin Select Configuration (Allow only one reconfiguration) #pragma config FUSBIDIO = ON // USB USID Selection (Controlled by the USB Module) // DEVCFG2 #pragma config FPLLIDIV = DIV_4 // PLL Input Divider (4x Divider) #pragma config FPLLMUL = MUL_24 // PLL Multiplier (24x Multiplier) #pragma config FPLLICLK = PLL_POSC // System PLL Input Clock Selection (POSC is input to the System PLL) #pragma config UPLLIDIV = DIV_4 // USB PLL Input Divider (4x Divider) #pragma config UPLLEN = ON // USB PLL Enable (USB PLL Enabled) #pragma config FPLLODIV = DIV_2 // System PLL Output Clock Divider (PLL Divide by 2) #pragma config BOREN = ON // Brown-Out Reset (BOR) Enable (Enable BOR) #pragma config DSBOREN = ON // Deep Sleep BOR Enable (Enable ZPBOR during Deep Sleep Mode) #pragma config DSWDTPS = DSPS32 // Deep Sleep Watchdog Timer Postscaler (1:2^36) #pragma config DSWDTOSC = LPRC // Deep Sleep WDT Reference Clock Selection (Select LPRC as DSWDT Reference clock) #pragma config DSWDTEN = ON // Deep Sleep Watchdog Timer Enable (Enable DSWDT during Deep Sleep Mode) #pragma config FDSEN = ON // Deep Sleep Enable (Enable DSEN bit in DSCON) // DEVCFG1 #pragma config FNOSC = SPLL // Oscillator Selection Bits (System PLL) #pragma config FSOSCEN = ON // Secondary Oscillator Enable (Enabled) #pragma config IESO = ON // Internal/External Switch Over (Enabled) #pragma config POSCMOD = HS // Primary Oscillator Configuration (HS osc mode) #pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled) #pragma config FPBDIV = DIV_1 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/1) #pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled) #pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1:1048576) #pragma config WDTSPGM = ON // Watchdog Timer Stop During Flash Programming (Watchdog Timer stops during Flash programming) #pragma config WINDIS = OFF // Watchdog Timer Window Enable (Watchdog Timer is in Non-Window Mode) #pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls)) #pragma config FWDTWINSZ = WINSZ_25 // Watchdog Timer Window Size (Window Size is 25%) // DEVCFG0 #pragma config JTAGEN = OFF // JTAG Enable (JTAG Disabled) #pragma config ICESEL = ICS_PGx3 // ICE/ICD Comm Channel Select (Communicate on PGEC1/PGED1) #pragma config PWP = OFF // Program Flash Write Protect (Disable) #pragma config SMCLR = MCLR_NORM // Soft Master Clear Enable (MCLR pin generates a normal system Reset) #pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled) #pragma config CP = OFF // Code Protect (Protection Disabled) int main(void) { return (EXIT_SUCCESS); } I have also attached the schematic of the dev board I created,
in case you see something that I don't.
I think I have tried everything...Please Help!
Thank you in advance.
