Wiring a PIC16F887

For users of Matrix Multimedia Electronics software to discuss projects, circuits and any other electronics concepts.

Moderators: Benj, Mods

Post Reply
AKNL90
Posts: 2
Joined: Sat May 24, 2014 8:26 pm
Contact:

Wiring a PIC16F887

Post by AKNL90 »

Hi there i am Sebastian from the netherlands and new at this forum :) im busy learning with PIC's for a hobby. :D

i am working with a PIC16F887 but i cant figure it out how to connect the wires to the PIC. Im using a pickit3 as a programmer.
now im wondering if someone can help me with a wiring diagram to connect the wires correct.

how many wires do i need connect to let the PIC work? VDD/VSS/MCLR/data in/program enable e.c. :roll:

what do i need to do with the CLKIN and CLKOUT ? is it nessesary to put a capasitor in the circuit ? :?: :|

i hope you guys can help me a step forward ! Thanks already! :D

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9180
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Wiring a PIC16F887

Post by medelec35 »

Hi Sebastian,
Welcome to Matrix forums.
AKNL90 wrote:im busy learning with PIC's for a hobby.
It's a great hobby, especially when you will have masted Flowcode.
AKNL90 wrote:how many wires do i need connect to let the PIC work? VDD/VSS/MCLR/data in/program enable
When connecting programmer only five connections are required.
I find the circuit diagram in PICkit 2 manual clearer to follow:
ICSP1.png
(25.16 KiB) Downloaded 7633 times
You will only require the isolation resistors connected to ICSPDAT and ICSPCLK if you have components connected (Shows: 'To application circuit' on the circuit diagram) that can load the pins if external voltage is applied via a programmer. e.g variable resistors, LEDs + series resistor etc.
If I was you I would power your circuit externally and not use programmer to supply voltage.

LVP and WDT should both be disabled.
Clock out will only have the the waveform of clock oscillator/4 so it's usually not required.
AKNL90 wrote:what do i need to do with the CLKIN and CLKOUT ? is it nessesary to put a capasitor in the circuit ? :?: :|
Perhaps for now, just use a microcontroller that has an internal oscillator, which simplifies your circuit so CLKIN and CLKOUT are not required.
Luckily most do have, including the 16F887 :)

If you want to learn how to connect CLKIN and CLKOUT to an external crystal, then if you take a look in the Learning Centre
Then select Flowcode Beginners Course
Take a look at the page titled The Clock Circuit
You wont require the switch (or any componts connected to the left of the switch.
You will only requre 2 caps and one crystal.
The value of the caps are depended on the value of the crystal.
Datasheet for your microcontroller should show you what value capacitors to use.

My advice would be to learn how to use flowcode by looking at the tutorials and loading example files and understand how they work.
I Can't point you in the right direction until I know what version of Flowcode you're using.
You can find that information by selecting Help, About Flowcode.

Getting a bit outdated, but you can take a look Here for useful advice to do with configuration settings.
Also I would always start with the most basic of 1Hz flasher (as discribed in the above link) to check that configuration settings are set up correctly.
Once flasher is working, then carry on with developing your flowchart, but don't jump too fast.
If flowchart will have several functions and is fairly complex, I would created and then test one function at a time.

You will need to configure the PICkit3 within the programmer settings.
Again can't point you in the right direction until I know what version of Flowcode you're using.
If you require help with a flwochart, then best to post in the correct section for your Flowchart.
E.g:
Flowcode V5 (If you have paid for a V5 licence, you must first have your forum account up graded by visiting Here
Flowcode V5 Free Edition
Flowcode V6 (Currently Upgrade of forum account is not required)

Hope this helps as a starting point

Martin
Martin

AKNL90
Posts: 2
Joined: Sat May 24, 2014 8:26 pm
Contact:

Re: Wiring a PIC16F887

Post by AKNL90 »

Martin Thanks for your extensive help :D im using Flowcode v5 demo version right now in the future i would like to buy a licence for flowcode. But first i want t learn and understand how to program in flowcode. I have seen the tutorials on the website and i m working on it but i would like to try some little programs and see what happen in real live. Now i need to get an capasitor and try again! The power supply comes from another USB port of my old crappy laptop 8) is that wrong or might give problems? it's 5 v :roll:
You will only require the isolation resistors connected to ICSPDAT and ICSPCLK if you have components connected (Shows: 'To application circuit' on the circuit diagram) that can load the pins if external voltage is applied via a programmer. e.g variable resistors, LEDs + series resistor etc.
If I was you I would power your circuit externally and not use programmer to supply voltage.
do i have to place some resistors in the circuit and connect them to the ground ? what do they mean with aplication circuit :oops:


i wil try it again :D

And again thanks for your help!

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 9180
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Wiring a PIC16F887

Post by medelec35 »

AKNL90 wrote:do i have to place some resistors in the circuit and connect them to the ground ? what do they mean with aplication circuit
No the resistor are only connected if you use the same pins for programming as used for ADC detection so post are connected. or pots/programmer will get damaged.
See This Link
I advised for the resistors to be connected between the pot wipers and the microcontroller pins (that are also used for programming).
AKNL90 wrote:Now i need to get an capasitor and try again!
You don't have to if you use the internal oscillator.
The crystal and two caps are omitted from the circuit.
If you are using internal oscillator, the speed of the microcontroller will require setting up by using a c code block with something like

Code: Select all

 osccon=0x70;
The 0x70 is for 8MHz, take a look at This post

Martin
Martin

Post Reply