Showing posts with label PCB. Show all posts
Showing posts with label PCB. Show all posts

Tuesday, August 4, 2009

Small LED dot matrix development board

I was very busy for the past two months so this blog just didn't move. As you may know, the LED dot matrix display is my favorite device. I have designed a small development board for testing my led dot matrix related programs.
The schematic is as the following:
LED dot matrix development board Schematic

The PCB is single sided so I can make it at home. Most of the components are SMD to keep small footprint of the board. The PCB size: 58.4mm x 46mm
LED dot matrix development board PCB

Acutally, I made a PCB and installed all components but the board didn't work :p. It was working when I tested the schematic on breadboard (with through hole version of PIC16F887). I think the SMD PIC16F887 may be broken or the PCB is bad but I just don't have time to figure out the problem. I will try new PCB and PIC16F887.

Friday, February 20, 2009

1Hz Clock Generator using PIC12F675

Based on the idea from http://www.josepino.com/pic_projects/?timebaseI have created a 1Hz Clock Generator. I use PIC12F675 as it's available locally. Its price is just about US$1.
The concept is using 32.768kHz crystal as a clock for the PIC. Therefor, the internal instruction clock is 32768/4 = 8192 Hz. By using the 16 bit Timer1 to count the instruction clock cycles, the interrupt will occur every 8 second. This period can be reduced by setting initial value of the Timer1 (TMR1H:TMR1L). I have to make Timer1 to count up to 8192 for generating overflow interrupt every 1 second. To make Timer1 count up to 8192, the initial value of TMR1 must be 65536-8192 = 57344 or 0xE000. This means TMR1H = 0xE0 and TMR1L = 0x00. In this case, I need to set only the TMR1H=0xE0 and let TMR1L runs continuously. By changing the initial value of Timer1, I can generate almost any frequencies.

An application for this project is a precise 1Hz blinking LED signal :) ha ha. I know that it's not useful but I think it's fun to look at (am I crazy?). Another application is a precise 1Hz time base for a clock.

The source code is written in MikroC.

// PIC12F675
// 1Hz Time Base Osc.
// Timer1 Module
// 32.768 KHz
unsigned short tick;
void Init ();
void interrupt ()
{
        if (PIR1.TMR1IF)
        {
                TMR1H = 0xE0;
                PIR1.TMR1IF = 0;
                tick = 1;
        }
}
void main ()
{
        tick = 0;
        //Initialize Ports and Timer1 Module
        Init ();
        while (1)
        {
                if (tick)
                {
                        tick = 0;
                        GPIO = (1 << 2);
                }
                if (TMR1H > 0xF0)
                {
                        GPIO = 0;
                }
        }
}
void Init ()
{
        TRISIO = 0;
        //Make all pins as output ports
        GPIO = 0;
        //Use Timer1 module
        INTCON.GIE = 1;
        INTCON.PEIE = 1;
        T1CON = 0x01;
        //Overflow every 8192
        TMR1H = 0xE0;
        TMR1L = 0x00;
        //  Enable TMR1 interrupt
        PIE1.TMR1IE = 1;
}



The schematic is as the following image.
1Hz Clock generator using PIC12F675


The PCB:


3D version:

Tuesday, November 18, 2008

PCB for 7-Segment PIC Digital Clock

I have designed a single-sided PCB for the PIC Digital Clock. Because the autorouter is not good for routing single-sided PCB so I have to route by hand. It was my first hand routed PCB design and it was a time consuming task. I haven't tested the PCB yet. Use it by your own risk. I will produce this PCB and test it later.

As I don't have server to upload the Eagle file, please contact me if you want the file or PDF version of the image below.

PCB for 7-Segment PIC Digital Clock

Components side of the PCB. The red lines are jumpers.
Component placement on the PCB of 7-Segment PIC Digital Clock