Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Flashing LED with PIC16F627

Status
Not open for further replies.

rasclerhys

New Member
Hi
I have just bought the Vellemean K8045 PIC Programmer and have a PIC16F627 microcontroller and want to create a basic flashing LED circuit, I have looked on Google and Youtube but havent found anything that does this. The only thing I have found seemed to have a connection going into the computer. However I would like mine to be a stand alone circuit (PIC are capable of this, arent they?!).
Any Advice and Tutorials would be appreciated
Thanks
Rhys
 
Here a little something to go by I added a pot so you could lite the leds by the adc value if you wanted
and gave you 4 led to use to and the ICSP jack
 

Attachments

  • 16f627.PNG
    16f627.PNG
    28.5 KB · Views: 1,660
That's Nigel Goodwin site and it for a 16f628 but they will work with your chip to just change this part
Code:
LIST	p=16F628		;tell assembler what chip we are using
	include "P16F628.inc"		;include the defaults for the chip
to
Code:
LIST	p=16F627		;tell assembler what chip we are using
	include "P16F627.inc"		;include the defaults for the chip

Thanks but I dont get what the ICSP is for???

For programming your chip
 
Last edited:
I assume you meant: , I couldnt see a circuit there though?! Also I am looking for a PIC16F627 circuit not a 16F628 (thats all I could see on your site).
Thanks

This is the link for all the hardware boards that should be used for the tutorial programs.



Check out Main Board and LED board.

For your case, it only consists of LED's connected to PORTA and PORTB thorugh 100 ohm resistors.
 
Thanks, I have read a bit about ICSP but was wondering if that is necessary in circuits, or can I just program it with my Velleman Kit, and then put the PIC into a circuit without need for an ICSP ?
 
Yes you can then remove it and place it in your board I just drawled that up as a sample you can leave out the ICSP the pot

but mclr has to be pulled high with a 10 k and you need a cap from vdd to gnd and yes you could use 100 ohm for the leds as long as your blinking then I would use the 150 ohm then you can leave one on and look at it lol

100 ohm is to low for most red leds at 5 volts 5 v / 100r = 50 Milliamps a pic can sink 25 or source 25

So use the 150 for your leds
 
I assume you meant: , Also I am looking for a PIC16F627 circuit not a 16F628 (thats all I could see on your site).
Thanks

The 16F627 is just a 16F628 with only half the program memory, otherwise it's absolutely identical, and no code changes are required (unless the 628 code uses more than half the memory).
 
Yes you can then remove it and place it in your board I just drawled that up as a sample you can leave out the ICSP the pot

but mclr has to be pulled high with a 10 k and you need a cap from vdd to gnd and yes you could use 100 ohm for the leds as long as your blinking then I would use the 150 ohm then you can leave one on and look at it lol

100 ohm is to low for most red leds at 5 volts 5 v / 100r = 50 Milliamps a pic can sink 25 or source 25

So use the 150 for your leds
Thanks, sorry to be so stupid, but do you have the schematics for the circuit without the ICSP
 
Although my LED flasher tutorial may be a diferent to Nigel's, take a look, it may help.

It should have everything you need. (Breif description, parts list, ASM file, HEX file, schematic and a pic or 2)

Jake's Electronics | Tutorials

Like Nigel's tutorial, mine shows a PIC16F628, but just repeating, this code will work on your 627.
 
Glad I could be of assistance.

Although I believe the more views of the same thing you see, the easier it is to understand.
There is soooo much going on inside that chip you will forever learn something new about the same project.
Each different persons example you see, even something as simple as a flashing LED, the more you will learn. Even though the end result is the same.
 
hi

if you are looking for Knight Rider

here is the code that i make some weeks ago :)

all the led are attached to all PORTB
 

Attachments

  • KN627.hex
    677 bytes · Views: 272
Last edited:
Thanks for that but I have all ready made Knight Rider and am just looking to get into using PICs (with an easy circuit) but Thanks anyway
 
@ Jakes electronics, Thanks for the circuit I have got it to work :) What kind of voltage does each pin allow out to the component? If i was to create a circuit for a motor would I have to use a transistor?
Thanks
Rhys
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top