Programming Failed (PIC16f1936)

Status
Not open for further replies.

kirangkr

Newbie level 6
Joined
Sep 19, 2014
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
183
Hello All,

In my application I'm using PIC16f1936 MCU. While programming (in debug mode) it is giving the following error message. Please help me to solve this!

Thank you!
Kirangkr



"Programming...

Failed to get Device Id.
Programming failed

Low voltage programming requires the low-voltage programming
configuration bit to be set. If this bit has been disabled
it may explain why programming has failed."




Also please see my code


#include <htc.h> //PIC hardware mapping
//#include <pic16f1936.h>
#include <xc.h>



// BEGIN CONFIG
#pragma config FOSC = INTOSC // Oscillator Selection bits (Internal oscillator)
#pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON // Master Enabled
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection ON)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
//END CONFIG
#define _XTAL_FREQ 2000000
#define FOSC 8000000


void main ()
{

TRISB0 = 0; //RB0 as Output PIN
while(1)
{
RB0 = 1; // LED ON
__delay_ms(1000); // 1 Second Delay
RB0 = 0; // LED OFF
__delay_ms(1000); // 1 Second Delay
}
}
 

Attachments

  • error.jpg
    71.4 KB · Views: 90

As indicated by the error messages, try turning on your LVP bit if you are actually using LVP. If that doesn't help, the most common reason I've had for problems like that was simply bad or incorrect connection between the programmer and the device. Double check all your wiring to the programmer. I assume you are using ICSP, as with a PICkit or something similar. Here is a thread that might be relevant: https://www.microchip.com/forums/m640643.aspx
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…