Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Problem in programming my pic16f877a using pickit3 programmer

Status
Not open for further replies.

deepshah3

Junior Member level 1
Joined
Jan 30, 2018
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
161
I am using pickit3 programmer to program my pic16f877a.
The problem i am facing is that,even after i am done with loading the whole program on to my chip,the CODE IS NOT RUNNING ON THE HARDWARE.
I have loaded a simple led on/off program.
I am using LVP method for programming.I have pulled the pgm/rb3 pin high(5 volts) using a 100ohm resistor.
What values must be loaded in the configurtion word??
Also when i check voltages on the port pins using a multimeter,I find 1.7-2Volts on every port pin.
What could be the problem here?Please help!!
 

CODE IS NOT RUNNING ON THE HARDWARE

Do you mean it is working at least in another environment, e.g on simulator ?
Why not to show your code, as well as the whole fuse settings, the actual schematic, etc... ?
Without having the whole scenario, it will be difficult to assess possible reasons, unless guessing.
 
YES the code is running on proteus.

This is the code i have used:

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <xc.h>
#define _XTAL_FREQ 20000000
 
// CONFIG
#pragma config FOSC = HS        // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = OFF      // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = ON         // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF        // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#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)
 
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
 
 
void main() 
{
    TRISC=0x00;
while(1)
{
 PORTC=0x01;
 __delay_ms(500);
 PORTC=0x00;
 __delay_ms(500);
}
 
}


I dont have any schematic of the hardware.
Please see if u can help me this much info.
Also it would be great if you suggest me the step by step(hardware and software) procedure to program a chip using the pickit3.
 
Last edited by a moderator:

Hi,

I dont have any schematic of the hardware.
Then it´s time to draw one. You hardly find any professional that works without schematic. A piece of paper and a pencil is all you need.
This doesn´t consume time, it saves time.

It´s not unlikely that a code works on proteues, but not in real hardware. Proteus doesn´t need a power supply, nor does it need a clock (circuit). Proteus doesn´t care about ESD and EMC.. and so on.

Klaus
 

Yes i do have the schematic in proteus,but all it has is a chip and an led.
Yes the configuration bits in IDE match withe pragma directives.
I sm using a development board to program the chip,which is powered by a 12V smps & Vdd=5 Volts.I have pulled up(5 Volts) the pgm/rb3 pin,for LVP(Low voltage programming).
I dont know if the problem lies in the hardware or the software.
 

I dont know if the problem lies in the hardware or the software.

Me neither, anyway instead of giving a literal narration of the circuit connections, why don't you spent a time to draw it even in Proteus ? It is not clear whether you have added for example capacitors at both crystal terminals or not, if the MCLR is properly biased somewhere, etc...
 
Thank you sir..
Just found the problem..I had to keep the pgm pin open..
Thank you..your replies were really helpful
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top