7

Like it is already mentioned in the title I have question regarding this dev stack:

  • MPLAB X IDE v1.80
  • PICkit 3
  • PIC16F684-ICD (datasheet)
  • AC16205

There is image of how things are connected (I don't think there is a problem):

enter image description here

Powering settings: enter image description here

There is simple program I am using for testing:

/*
 * File:   main.c
 * Author: Primoz
 * 
 * PIC16F684
 *
 * Simple test program.
 */

#include <xc.h>

// CONFIG
#pragma config MCLRE = OFF      // MCLR Pin Function Select bit (MCLR pin function is digital input, MCLR internally tied to V
#pragma config FOSC = INTOSCIO  // Oscillator Selection bits (INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config CP = OFF         // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF        // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = OFF      // Brown Out Detect (BOR disabled)
#pragma config IESO = OFF       // Internal External Switchover bit (Internal External Switchover mode is disabled)
#pragma config FCMEN = OFF      // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)

void main()
{
    TRISA = 0b111101;

    PORTA = 0b000010;

    for (;;)
    {
        ;
    }
}

I successfully programmed the device only few times. Most of the time I get this output:

Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.28.72
Firmware type..............Midrange

Target detected
Failed to get Device ID

So my question is what could be a reason for such an odd behaviour? How can I make it work?

If you need any additional information, please let me know...

PrimosK
  • 296
  • 1
  • 4
  • 20
  • Presumably you're powering it from the programmer; is the voltage correct? – pjc50 May 11 '13 at 09:15
  • It is said in datasheet `Wide operating voltage range (2.0V-5.5V)` so I think 5V is ok, right? – PrimosK May 11 '13 at 09:20
  • Looks good. Maybe you have a loose connection? – pjc50 May 11 '13 at 09:24
  • I don't think so.. But it would be good thing to check out.. Will do it but not right now as I don't have any multimeter at hand... Will let you know what I have found out... – PrimosK May 11 '13 at 09:35

6 Answers6

5

I checked out if there are any loosed connections like suggested by @pjc50 - found none.

I even ordered new header and on my surprise the issue was still not gone.

After many trial and error I figured out that it works if I set Voltage Level to 4,875 (instead of 5V):

enter image description here

PrimosK
  • 296
  • 1
  • 4
  • 20
3

No promises, but I have personally experienced that exact same behavior more than one hundred times.

Every single one of them was fixed by throwing away my connecting cable, and wiring a new one.

This means

  • The plug on the PICkit3
  • The physical connector on the PIC side itself
  • The physical wires between those two plugs

Your current observations might be totally confusing you; as mine confused me repeatedly when this was happening over here. When you consider broken wires which are "sometimes there" the picture becomes quite a bit more clear.

Incidentally, if...

  • The problem recently started
  • You have only one set of these connecting wires arranged for your use
  • They used to work perfectly
  • You are currently seeing "sometimes" results (perhaps, "random success")

.. then my suspicion increases.

Again, no promises, but this is what happened to me on my PIC24 arrangement with an ICD-3 and occasionally a PICkit. What you are describing is exactly what I observed.

User.1
  • 143
  • 1
  • 9
2

I had the same problem, getting error messages such as "Failed to get Device ID". My configuration is the 44-pin demo board with a PIC16F887, Pickit 3 (firmware version 1.28.18), and MPLAB 8.88. I followed PrimosK advice,above, and it was right on the money: Reduced the voltage from the default 5.0V to 4.875V and everything worked. But also noted that MPLAB does not keep the settings and had to set them again the next time I started MPLAB. Good luck.

user39113
  • 21
  • 1
2

I have a similar issue with firmware 01.28.72. When I went back to 1.12.01 it worked again.

Chris
  • 21
  • 1
1

I had the same problem, working with a Pic16F883, and PicKitt3. And Now is fix it, I power the target card with a external source (5Vcd) and in the Project options --> Programmer, I uncheck box the option "POWER TARGET CIRCUIT FROM PICKKIT3", I hope this info help you.

Omar Diaz
  • 11
  • 1
0

Similar problem was faced by me. I have a 24FJ128GA308 based controller board with a 128*64 COD display interfaced and board is powered up externally. For a unit with just manufactured (un programmed controller), when invoked 'Program' option, it gave error as "Programming Failed - ThePICkit 3 is missing a Memory Object.' I tried with changing - with Controller board powered up from PICKit 3, still it didn't work. Then under Programmer option, I used 'Hold in Reset' for 2-3 seconds, released back, then 24F got programmed and board started functioning. Incidentally, I have a right reset circuit. -Chandrashekhar Joshi