Wednesday, July 6, 2011

Persistence of Vision (POV) Coding using PIC16

In this section i will tell you about the POV coding using PIC16F877A in C language. Persistence of vision is the phenomenon of the eye by which an afterimage is thought to persist for approximately one twenty-fifth of a second on the retina.
My plan is to use the fan from PC power supply; for rotating purpose. Now first of all i want to tell the two things. 1st i don't have smaller MCU that is why me using 40 pin, you can also use 28 pin if you have any. 2nd due to my hardware design fault, actually soldering fault,  i missed the RB0 pin; so to compensate it i used RD0. You can change the coding if you want for your ease.
Now come towards the hardware part; as already told you using the 877A MCU with 4MHz crystal, and 16 small leds, 9v dc battery, and one fan. Also don't forget to install the on/off switch to save the battery power.

Software part consist of coding in HITECH compiler and there is about 2ms delay after each display. Tricky part in POV coding is to display; for this just draw whatever you want but remember the number of leds you are using, these represents the rows in my case. I used the MS Excel to draw the things, after this just add the columns to obtain the port values; that is it. One thing more it is easy to store these values in array or in lookup tables and then use them to obtain the port values, but i did not use this, i simply moved the valued into the ports.


Download: Code and Schematic, here

Schematic & Hardware Pics:
POV using PIC16F877A
back side
front side
rotating base with battery
complete assembly
After making all this i have found that the load is too much and due to this the fan speed is very low, so if you have dc motor just power full enough to handle it then use it. But the good news is rest of the circuit is fully functional. Here is the video, enjoy.
                    
Components Required:
330 ohm resistors =------------------- 16
Red LEDs  =---------------------------- 16
PIC16F877A---------------------------- 1
LM7805 =-------------------------------1
10k ohm resistor=----------------------1
15pF capacitor=------------------------2
4MHz crystal=--------------------------1
9v dc battery=--------------------------1
CPU fan=--------------------------------1
switch=----------------------------------1

6 comments:

  1. donde se conecta en el circuito el LM7805

    ReplyDelete
  2. Hi partner:
    I wanted to download the files, but the link expired!!
    CAn you upload it again??
    Thank you very much

    ReplyDelete
  3. How did you find port values using ms EXCEL

    ReplyDelete
  4. yes ,How did you find port values using ms EXCEL

    ReplyDelete
  5. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. ithor

    ReplyDelete