Help Needed to build a circuit for PIC Programming

Thread Starter

harshkumar1

Joined Apr 26, 2012
5
Hi,
I am trying my hand at PIC Programming using PIC16F877A and need to create a circuit to check my LED Blinking Code. I have a development board which i need to connect for it to work. It may be very simple but i for some reason am not able to connect it. I have attached the schematic of the board herewith.
I had bought the board from this web link http://www.nskelectronics.com/pic_development_board.html

I have been trying to build the circuit for quite some time but i am unable to do it, if someone of you can please help me by pointing out which pins needs to be connected to which pin it would help me a lot.

Regards,
Harsh
 

Attachments

WBahn

Joined Mar 31, 2012
33,135
Build what circuit? Connect what?

You say you have a board. Is that board built up or did you get a kit that you are trying to build and are having trouble following the schematic?

If you are trying to connect this board to some circuit, you haven't given any indication what what that circuit is.

Please be more explicit and detailed in your description.
 

t06afre

Joined May 11, 2009
5,934
First in order to program the chip. You need a programmer. That is compatible with your chip. Do you have such a unit?
 

Thread Starter

harshkumar1

Joined Apr 26, 2012
5
Its a board which i have purchased.
I have a PICKIT2 Programmer.

I will place PIC microcontroller on the board and get the output from PORTA0. Want to build a circuit on the board which would accomplish this.

I am really Sorry if i am sounding too generic. I do not intend to but since i do not have the necessary Electronic experience so i may be sounding that way.
 

Thread Starter

harshkumar1

Joined Apr 26, 2012
5
No i am able to flash fine.
Its when i want to put the chip in the development board and test my program is when i am getting struck.
 

t06afre

Joined May 11, 2009
5,934
From what I can see. Your board do only have 4 LEDs not 8. And in the schematic the LEDs do not have any series resistor. You can not connect a LED directly to a PIC port. Do you have a bread board. Some LEDs and some 330Ohm resistors?
 

debjit625

Joined Apr 17, 2010
790
harshkumar1 said:
No i am able to flash fine.
Its when i want to put the chip in the development board and test my program is when i am getting struck.
Which programmer you are using to flash the chip?

Are you sure you have flash your chip properly, normally many programmers after programming the chip verify the chip.Did you got any confirmation form your programmer.

If you think you have properly programmed the chip and the chip is ok ,then may be your development board is damaged.

To check ,just write a LED blinking program then flash it and remember when flashing ,set the "Power Up Time" configuration bit.Now in a bread board give +5VDC to the mcu's Vdd pin and GND to Vss pin ,connect the MCLR to +5VDC using a 10K resistor and connect the LED with a 470 ohms resistor to the correct PORT as per your program,and check if its working if it is then your development board is damaged or might have some problem.

Good Luck
 

Thread Starter

harshkumar1

Joined Apr 26, 2012
5
From what I can see. Your board do only have 4 LEDs not 8. And in the schematic the LEDs do not have any series resistor. You can not connect a LED directly to a PIC port. Do you have a bread board. Some LEDs and some 330Ohm resistors?
I do not have a bread board.
 

Thread Starter

harshkumar1

Joined Apr 26, 2012
5
Which programmer you are using to flash the chip?

Are you sure you have flash your chip properly, normally many programmers after programming the chip verify the chip.Did you got any confirmation form your programmer.

If you think you have properly programmed the chip and the chip is ok ,then may be your development board is damaged.

To check ,just write a LED blinking program then flash it and remember when flashing ,set the "Power Up Time" configuration bit.Now in a bread board give +5VDC to the mcu's Vdd pin and GND to Vss pin ,connect the MCLR to +5VDC using a 10K resistor and connect the LED with a 470 ohms resistor to the correct PORT as per your program,and check if its working if it is then your development board is damaged or might have some problem.

Good Luck
I have a Development board which i have bought @ http://www.nskelectronics.com/pic_development_board.html

The schematic of the board i had attached it in my first post. But i had the other member reply that the dev board which i have does not have LEDs connected in series and hence it may not be possible to do it :(
Thats a bit confusing but i think that the way it is
 

t06afre

Joined May 11, 2009
5,934
I think you misunderstand. Each LED must have resistor in series with it. In order to work. Your board have LEDs on it. But from the picture and the board schematics. I can not see any resistors connected to the LED.
 

debjit625

Joined Apr 17, 2010
790
harshkumar1 said:
The schematic of the board i had attached it in my first post. But i had the other member reply that the dev board which i have does not have LEDs connected in series and hence it may not be possible to do it.Thats a bit confusing but i think that the way it is
I think you need to understand basic electronic first before doing mcu stuff...
A LED can pass a certain amount of current, if you exceed that amount it will be destroyed. So we add a series resistor (also known as current limiting resistor) with it so that we can limit the current going through the LED.
Other members are talking about this series resistor. And on page 3 of your schematic file I found the LED array but their are no series resistors with them, so if that’s the real circuit the LED may be damaged because of excessive current from the mcu pin.

Many LEDs can work too as the I/O pins of the mcu in your case PIC16F877A can source or sink max 25mA and many LEDs can tolerate this current, but this is a bad practice always try to add a proper load on mcu's pin as in this case the mcu's pin falls under a short circuit situation. Adding a current limiting circuit will ensure the proper load condition for the pin.



Good Luck
 
Last edited:

WBahn

Joined Mar 31, 2012
33,135
What debjit625 said was that the schematics only show 4 LEDs (as compared to the webpage claiming there are eight) and that they didn't appear to have current limiting resistors in series with them. I noticed the same thing. Nothing was said about the LEDs themselves being in series (they aren't). The problem is that, if the schematics are correct, then if you apply 5V to the LED it will draw too much current and destroy the LED. Actually, it's possible that the PIC output pin can't supply enough current to damage anything, but relying on this is really poor design.

Note that this is assuming that the schematics are correct and no current limiting resistors are in place. It seems odd that a development board designer would do that. In looking at the picture of the board on the website, I think I see the LEDs and, sure enough, there are only four. I can't tell where the current limiting resistors might go and so I have no idea if they are there or not.

As near as I can tell, this board appears to have a bunch of small circuits on it that are not connected together at all. The idea would then be to use jumper wires to connect between the port pins and the circuits you want to use. Not an unreasable approach, actually.
 

MrChips

Joined Oct 2, 2009
35,125
If you have a PICkit2 and a PIC16F877A in a DIP package and a breadboard, you can skip the complexity of the dev board and work directly with the PIC chip. You might learn more doing it this way.
 

WBahn

Joined Mar 31, 2012
33,135
I highly second MrChips' recommendation. Get a solderless breadboard. Doesn't have to be fancy - I still use my 25 year old Radio Shack boards and they work fine. A development board is great for many things, but I think you are at the level in your learning that the education from actually building the circuits up from scratch on a bread board, and invariably destroying a few components along the way, will be invaluable to you.
 

panic mode

Joined Oct 10, 2011
5,219
since you have no breadboard, i'm guessing that you are inserting PIC into development board and then using pickit2 to program PIC through ICSP.

you also seem to be quite sure that programming works ok. this can easily be verified as there are bunch of sample projects including already compiled HEX files. all it takes is to download one at a time and try them out.

most parts of the development board are perfectly normal.
one of the odd things are 4 LEDS with no resistors connected to CN4. maybe this is left as exercise for prorgammer to experiment with different values resistors and see how brightness relates to different resistor values. the four LEDS on the board are labeled L0, L1, L2, L3 and all next to CN4. Schematic shows 4 LEDS connected to CN4 and no series resistors, but those leds are identified as L4, L5, L6 and L7.

if you are connecting LEDs to port B, use resistors instead of wires (220...680 Ohm will do just fine).

if you are just trying to make your first 'hello world' by turning on the LED, use the 7-segment display. for example wire CN2 to one of PIC ports (port A or port B). bring +5V to one (only one) of pins of CN1. now you have 8 LEDs to play with and resistors are already on the board. once you are done with lighting and blinking led segments, you can connect CN1 to other port and do real 4xdigit display
 
Last edited:
Top