Starting Programming PIC16f877 with C

absf

Joined Dec 29, 2010
1,968
Program is compiled OK,
Hex code programmed into the PIC also OK.
Problem must be the hardware.

Please show us your schematics or take a picture of your PCB should help.

Allen
 

absf

Joined Dec 29, 2010
1,968
1. You need a 10K resistor between /MCLR and Vcc.
2. The crystal needs 2x 22pF capacitors to GND.
3. The LED needs a 330Ω in series.
4. Try to put 100nF between Vcc and GND.

HTH

Allen
 

Attachments

Last edited:

t06afre

Joined May 11, 2009
5,934
But there is no internal Oscillator in 877A ( i think)
That is correct. But many PICs do have it. Another thing to check before purchasing PICs. They must be compatible with your programmer. By the way. Connecting LEDs to anything without using a proper resistor is cause for detention. Your assignment for the detention. Will be writing down 100 times. "I will not use LEDs without proper series resistor ever again. As I now understand a LED is not the same as a light bulb"
 

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
That is correct. But many PICs do have it. Another thing to check before purchasing PICs. They must be compatible with your programmer. By the way. Connecting LEDs to anything without using a proper resistor is cause for detention. Your assignment for the detention. Will be writing down 100 times. "I will not use LEDs without proper series resistor ever again. As I now understand a LED is not the same as a light bulb"
The schematic i posted was not having a series resistor but in bread board i was using 220Ohms R.

You need a 10K resistor between /MCLR and Vcc.
Except this R i was not using and The capacitor are of 15pF with XT.
anyway i have found that the the two Vdd and Vss on both side of PIC pin 11,12 and 31,32 are not internal short or is there any problem with PIC i have b'coz during testing it get hot little bit, why??
 
Last edited:

t06afre

Joined May 11, 2009
5,934

t06afre

Joined May 11, 2009
5,934
I think software is compatible but not my Programmer i.e. Hardware..!!
Have you given it a try. It want hurt your setup in any way. By the way. I downloaded and read the manual that you linked to in post 50. It looks here that the support list is much larger than that on the web. It should be compatible with 16f88x series. The manual state also that your programmer is compatible with JDM and should also work on software like the winpic800.
 

Thread Starter

RRITESH KAKKAR

Joined Jun 29, 2010
2,829
I have programmed the PIC 16F877A with this code:
and PIC was connected as per your schematic given in earlier post using 4Mhz the problem is that the LED was not blinking as the output from port B is zero all the time, why??



Rich (BB code):
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_XT);


#define _XTAL_FREQ 4000000

void main (void)
{
TRISB=0b00000000;//all pins set as ouput
PORTB=0;
while (1)
 {//endless loop
  PORTB = !PORTB;
  __delay_ms(1000);
 }
}
Rich (BB code):
hex code 
:060000000A128A11DC2F38
:100FB80083010A128A11E02F831603138601831214
:100FC80003138601E72F83120313860800300319E1
:100FD800013086000630F2001330F100B130F00025
:100FE800F00BF42FF10BF42FF20BF42FFB2FE72F5C
:080FF800E72F0A128A110028FC
:02400E0031FF80
:00000001FF
 

Attachments

Top