8x8 Led Dot Matrix Clock using PIC16F627A

Led Dot Matrix Clock 8x8 Actually, I have made this long before the 5x7 led dot matrix clock. The clock utilizes a PIC16F627A and a 74HC595 to drive a small 8x8 Led Dot Matrix display (20x20mm). My dream is transforming these clocks to watches that I can ware on my wrist.

8x8 Led Dot Matrix Clock using PIC16F627A

7-Segment PIC Digital Clock : The photographs

The prototype of the 7-Segment PIC Digital Clock. Check out 7-Segment Digital Clock for the schematic and source code.
7-Segment Digital Clock
7-Segment Digital Clock PIC Microcontroller
7-Segment Digital Clock PIC16F627A
7-Segment Digital Clock PIC16F628

Setting Internal Oscillator for PIC16F627A

I love to use PIC16F627A and PIC16F628 because they come with internal oscillators. That means I can make a project with lower component count (without 1 crystal and 2 load capacitors). The project setting of MikroC for using internal oscillator of the PIC16F627A shows below:
Setting MikroC for Internal Oscillator

DS1307 + PIC16F877A

DS1307 is a popular Real Time Clock (RTC) chip from MAXIM . Now, PIC16F877A is my favorite microcontroller. So, I was looking for information about interfacing DS1307 with PIC16F877A but I found only information in assembly language (assembly is not my cup of tea) and other C compilers. I use only mikroC. I adapted what I have found from the Internet. The source code is listed below:

//Sample code for
//DS1307 RTC Ineterfacing with PIC16F877A
//Coded by Pynn Pynn
//Compiler: mikroC 8.0.0
//Use with your own risk

unsigned short read_ds1307(unsigned short address );
unsigned short sec;
unsigned short minute;
unsigned short hour;
unsigned short day;
unsigned short date;
unsigned short month;
unsigned short year;
unsigned short data;
char time[9];
char ddate[11];

unsigned char BCD2UpperCh(unsigned char bcd);
unsigned char BCD2LowerCh(unsigned char bcd);

void main(){

I2C_Init(100000); //DS1307 I2C is running at 100KHzPORTB = 0;
TRISB = 0; // Configure PORTB as output
Lcd_Init(&PORTB); // Initialize LCD connected to PORTBLcd_Cmd(Lcd_CLEAR); // Clear displayLcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor offLcd_Out(1, 1, "TIME:");
Lcd_Out(2, 1, "DATE:");

sec=read_ds1307(0); // read secondminute=read_ds1307(1); // read minutehour=read_ds1307(2); // read hourday=read_ds1307(3); // read daydate=read_ds1307(4); // read datemonth=read_ds1307(5); // read monthyear=read_ds1307(6); // read year

time[0] = BCD2UpperCh(hour);
time[1] = BCD2LowerCh(hour);
time[2] = ':';
time[3] = BCD2UpperCh(minute);
time[4] = BCD2LowerCh(minute);
time[5] = ':';
time[6] = BCD2UpperCh(sec);
time[7] = BCD2LowerCh(sec);
time[8] = '\0';

ddate[0] = BCD2UpperCh(date);
ddate[1] = BCD2LowerCh(date);
ddate[2] ='/';
ddate[3] = BCD2UpperCh(month);
ddate[4] = BCD2LowerCh(month);
ddate[5] ='/';
ddate[6] = '2';
ddate[7] = '0';
ddate[8] = BCD2UpperCh(year);
ddate[9] = BCD2LowerCh(year);
ddate[10] = '\0';


unsigned short read_ds1307(unsigned short address)
I2C_Wr(0xd0); //address 0x68 followed by direction bit (0 for write, 1 for read) 0x68 followed by 0 --> 0xD0I2C_Wr(address);
I2C_Wr(0xd1); //0x68 followed by 1 --> 0xD1

unsigned char BCD2UpperCh(unsigned char bcd)
return ((bcd >> 4) + '0');

unsigned char BCD2LowerCh(unsigned char bcd)
return ((bcd & 0x0F) + '0');

As I don't have DS1307 in hand, so I test my code with Proteus ISIS simulator. The image shows the working clock. Click on the image for big image.

Schematic of DS1307 and PIC16F877a or PIC16F887

Big 5x7 Led Dot Matrix Clock with new font

Now, I'm so crazy about led dot matrix clocks and led dot matrix watches. Just recently, I have upgraded my small 5x7 Led Dot Matrix Clock with a bigger green 5x7 led dot matrix display and a new font.
For the images below, the time 21:44:37 was displaying on the clock. The clock display is big comparing to a 44mm Panerai (PAM 4).
Big Green 5x7 Led Dot Matrix Clock
Big Green 5x7 Led Dot Matrix Clock
Big Green 5x7 Led Dot Matrix Clock

The code for the new font is showing below:

const unsigned char char2[][4]={
{0x0E,0x11,0x0E,0x00}, //0{0x09,0x1F,0x01,0x00}, //1{0x13,0x15,0x09,0x00}, //2{0x11,0x15,0x0A,0x00}, //3{0x1C,0x04,0x0F,0x00}, //4{0x19,0x15,0x12,0x00}, //5{0x0E,0x15,0x12,0x00}, //6{0x13,0x14,0x18,0x00}, //7{0x0A,0x15,0x0A,0x00}, //8{0x09,0x15,0x0E,0x00}, //9{0x0A,0x04,0x0A,0x00}, //Comma1{0x04,0x0A,0x04,0x00} //Comma2};

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Engr.Arif Naseem | Bloggerized by Naseem - | Affiliate Network Reviews