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.

Projects to build with PIC16F628

Status
Not open for further replies.

Andrei_D12

Active Member
Hello!!! My name is Andrei and I have recently joined this forum.
I am looking for some simple projects for PIC16F628/88 or PIC16C54 because I have just started learning about programming PIC micros. You may ask: Why these micros?? Well, these are the chips I got up to now (I will get the PIC12F629/675 soon). I think I got all the needed stuff for the beginning: an USB programmer which can program lots of chips, including memories, also it has a ZIF socket, and, of course, the PICkit 2 programmer (the usb programmer matches the software).
As electronics experience, I built a lot of simple circuits such as oscillators, led flashers, sirens, fm bugs, even some robots and more... I also built circuits with ICs such as LM358, NE555N, CD4093, CD4017, 74HC00, CD4069... I understand the terms of analogue and digital, modulation of a signal, buffers, logic gates, operational amplifiers, schmitt inverters, counters...
Dont missunderstand me, I am still a beginner in electronics, and for me the programming of micros is something interesting and i understand the fact that a tiny device like a micro has a huge capability.
I understand a little from the Boolean algebra, and the programming in C++(very little).
After reading the articles provided by the Talking Electronics website I understood that the best way of learning is PRACTICE. Practice, practice, practice, this is the magic word. And thats what i want to do. You may say: Talking electronics website surely has pic projects that you want, so why are you asking for projects HERE????
Sincerely, it got more ideas of projects with PIC12F629, however my intenton is to get familiarised even with the other PIC micros (im sure you know what I mean).
I know that I have to learn a code such as BASIC or whatever in order to make projects , but the machine code isnt so hard to understand, since there are just 33-35 instructions for the chips I intend to use. Even the HEX numbers arent difficult, knowing the rule...
So give me some ideas of simple projects such as flashers, simple led displays (police lights, knight rider, sequencer...), sounds, sirens, in order to study them and, eventually, modify them.

Thank you for patience!!!
 
Before you get into an actual project as such, if you are just beginning with microcontrollers and programming, you might want to read through some of the various tutorials that members here have already written up. There's also plenty of good ones on the web too, if you do a little digging. These little mini projects will help you understand the way that the various peripherals work on the micro's and how to program them. It also gives you good practise generally in program flow, thinking your way around a problem etc. The programming experience gained will help you begin writing better, tighter code to begin with and help steer you clear of some of the pitfalls and gotcha's that newcommers often get hung up on. Don't pick projects that are too challenging to begin with, despite their obvious appeal, work your way up to them as your understanding grows and you become more comfortable with programming, otherwise you will only end up being disappointed with the results and spend a lot of time and energy trying to track down problems that, had you taken the time to learn, would either not have cropped up to begin with, or would be easily solved.
Once you have gotten that out of the way, each of these little mini project/ building blocks can be combined into whatever larger project you decide to have a go at :)
 
As a starting project, I suggest putting 4 LEDs (with resistors) on A0 to A3 and 4 push buttons on B0 to B3 that are wired to 0V (Gnd). You could then start with something really simple like when button pushed LED lights. This could be as simple as PORTA = PORTB. However, just to get to this point you have to have figured out: how to connect your PicKit2; how to setup the fuses (config) to use the internal oscillator; how to set port A to digital and output; how to turn on the port B weak pullups (WPUs) and lot's of other stuff.

Once that is working then go on to do,
Toggle each LED when it's button is pressed - this requires you to learn about debounce.
Make it act like radio buttons - last button pressed light it's own LED and extinguishes the others.
Add some more LEDs and make a night rider type display.

If you manage the above you'll be well on your way to writing anything.

Mike.
 
Thats what I am looking for. Simple projects, in order to understand the basic functions of a microcontroller. As for the programmer, its a pickit2 clone and I have a document which shows exactly how to insert the different micros in the ZIF socket. I understand that I should not take up complex projects, but flashing a led its ideal... It will take some time to understand all the 33 instructions of a PIC, I dont want to start writing my own programs now because Im aware of the complexity of this, but copying and pasting programs (10-20 lines) would be just enough to get started.
 
I've just read an article telling that all the micros with the name containing "C" are once programmable. However, thanks for your advice!!!
 
I've just read an article telling that all the micros with the name containing "C" are once programmable. However, thanks for your advice!!!

Actually, that's not entirely true :D

The expensive versions (ending in JW) are erasable under UV light (and have quartz windows for that purpose), but more importantly the 16C84 was an EEPROM based device, and electronically erasable/reprogrammable just as with more modern devices. The 16C84 was really the device that introduced PIC programming to the public.

It was only with the second and subsequent EEPROM based PIC's that they started using F as the designation - while people might think F stands for 'flash' it long pre-dates any flash based devices.
 
Another project that might be fun to do is a reaction timer. Just flash an LED and time how long the subject takes to hit a push button. There are simple ways to do that by polling the button. You can also do it with the "capture" functionality of the CP module.

John
 
Actually I am still learning about the PIC family and reading some articles about the functions of these micros. I am not capable of writing a program from zero yet, it will take some time to understand the main functions and instructions of the chip and the programming language. A ready writen program for blinking a LED or something similar (I am asking for something very very simple) that can be modified easy is what I am looking for. I found some "ready to burn" programs for chips such as 16f84, 12f508 that can blink a LED on Talking Electronics (Here I started with electronics). To avoid complications I will buy the 12f629 chip as soon as possible because here many projects have been designed around it. But I know that there are differences between micros: 12f629 has the instruction GPIO for making pins inputs and/or outputs, while 16f628 has the TRISA for port A and TRISB for port B. Anyway, some micros have personalised instructions and thats why a program made for the chip X cannot be directly transferred into the chip Y. It needs modifications. And I dont know what must be modiffied in the program... to adapt it for another chip :banghead:
If there is some wrong info in my replies, please announce me!!!
 
There is a design for a tachometer on my website that uses a PIC16F628. The source code is included so you can play round making changes to it.

Les.
 
A ready writen program for blinking a LED or something similar (I am asking for something very very simple) that can be modified easy is what I am looking for.

Look in the link at the bottom of Nigel Goodwins posts: www.winpicprog.co.uk
A good starting place.

JimB
 
Too many words up to now. Make a LED to blink.

Once there, make two LEDs to blink but at unrelated frequencies.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top