Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Display Current time & date in LCD 16x2 using pic16f877a ( Hi Tech C )

Status
Not open for further replies.

WhyWhy

Member level 4
Joined
Mar 18, 2013
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,779
Hi guys,

i know how to display word in LCD,but how i display the current time and date.
Thanks for help.



Code:
#include<htc.h>
#include<pic.h>

#define RS RB2
#define EN RB3
#define D4 RB4
#define D5 RB5
#define D6 RB6
#define D7 RB7
#define _XTAL_FREQ 8000000
#include "lcd.h"

void main()
{
  int i;
  TRISB = 0x00;
  Lcd4_Init();
  while(1)
  {
    Lcd4_Set_Cursor(1,1);
    Lcd4_Write_String("LCD Hello World");
    for(i=0;i<15;i++)
    {
      __delay_ms(1000);
      Lcd4_Shift_Left();
    }
    for(i=0;i<15;i++)
    {
      __delay_ms(1000);
      Lcd4_Shift_Right();
    }
    Lcd4_Clear();
    Lcd4_Set_Cursor(2,1);
    Lcd4_Write_Char('e');
    Lcd4_Write_Char('S');
    __delay_ms(2000);
  }
}

Regards,
YY
 

If minutes contails the minute value then LCD character printing function can be used.

Code C - [expand]
1
2
LCD_Chr(minutes / 10 + 48);
LCD_chr(minutes 5 10 + 48);

 

Hi Jayanth,

Why the minutes need to divide 10 and then + 38 ( minutes /10 +48) and minutes (510 + 48) ?

Regards,
YY
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top