Discussion in "Project Help" started by    HiteshDR    Nov 29, 2007.
Thu Nov 29 2007, 08:17 am
#1
Hello All,

Good Morning..

i want to make a digital clock and i have selected components RTC IC-DS1307, 16x2 LCD, 4X4 Matrix Keyboard and micro-controller.
i am able to interface LCD and keyboard separately but i am not getting any idea how to embedded programme for both interfacing part.
i also don't know how programme and to integrate RTC IC with this embedded module.
can any one guide me how to solve it....

thanking you all in advance...!!
 ratnam, like this.
Thu Nov 29 2007, 01:45 pm
#2
when you design an embedded application... you need following things for basic start..
1. Device drivers for peripherals like LCD, keypad, motors etc.
2. Make a layout of your final project i.e. decide, what has to come first
3. How they are going to work in a while(1) loop i.e. you have to decide which part of the code will be under while(1) loops and how it has to be arranged.

This way of systematic approach makes designing a project easy. As per you said, you have already done the LCD and keypad modules.
So first try to put them together... like read input from keypad and display it on LCD. After that make RTC routines like initialize rtc, read rtc, write rtc.

After you are done with all that you will just need to put everything together. that i will tell you after you finish RTC part.
 HiteshDR like this.
Thu Jan 10 2008, 09:06 am
#3
thank you ajay...

after putting keyboard and lcd together, i am able to display the ouput of keyboard on lcd.

now can you please help me and tell me from where i have to start to make clock....

for your kind information i am working in assembly language.

Thank you...
Thu Jan 10 2008, 01:23 pm
#4
make I2C library.. check the download section if you want to use an existing one.. or study about I2C protocol if you want to write on your own..
just try to read content of RTC and display on LCD. then i will tell you how to move further..
 HiteshDR like this.
Thu Jan 10 2008, 03:33 pm
#5
hi ajay...

i have read the i2c library..
i am taking my own lcd and keypad code.
sorry to say but i am confused how to join the i2c loop with my that one code...
can you please give me some hint...or clue..???

Thanks for helping...
Thu Jan 10 2008, 09:46 pm
#6
sure.. its like this...
in while(1) loop or say infinite loop in your main subroutine...
read RTC content and display it on LCD. that is the basic function of your clock. read datasheet for information on what register to read and what that register contains.

now come the use of keypad. Its only for setting the time... so connect a switch to interrupt pin of controller so when you press that set time switch it takes your controller to the service routine.. where you can change time of clock. this can be done by storing all the values of clock parameters like day date, time etc in registers or a series of memory location and then stored to RTC memory.

Its just you have to make up your mind.. thats why i am saying first complete the reading of RTC and then displaying it. which is the basic and important part.
 HiteshDR like this.
Fri Jan 11 2008, 05:41 pm
#7
hello ajay...

i am sending you my main loop please tell me where i am going wrong because its not showing any error but its not displaying anything also...

CSEG	AT	0
	ORG	0000H
	LJMP	MAIN
	
		ORG	0050H
MAIN:		MOV	A, #00H
		LCALL	LCD_INIT
		LCALL	DELAY_30ML
  		LCALL 	WEL_DISP
		LCALL	RTC_INIT
		LCALL	DELAY_30ML
GO_ON:		MOV         SP,#2FH    ; POSITION STACK ABOVE BUFFER
		MOV         IE,#0      ; DISABLE INTERUPTS
		SETB        SDA        ; ENSURE SDA HIGH
		SCL_HIGH               ; ENSURE SCL HIGH
		CLR         ACK        ; CLEAR STATUS FLAGS
		CLR         BUS_FLT
		CLR         _2W_BUSY                				

		LCALL	DELAY_30ML
KEY_CHK:	LCALL 	DELAY_30ML
     		SETB	KEY1
      		SETB	KEY2
      		SETB	KEY3
      		SETB	KEY4
SET_KEY: 	JNB	KEY1, PRESS_1
      		JNB	KEY2, PRESS_2
      		JNB	KEY3, PRESS_3
      		JNB	KEY4, PRESS_4
      		AJMP	KEY_CHK

thank you..


[ Edited Fri Jan 11 2008, 11:52 pm ]
Fri Jan 11 2008, 11:57 pm
#8
will you please explain what are you doing in your code? :-s
you said your LCD is working..

one more thing if you can do.. use hyper terminal.. to display rtc content.. if LCD is not working at the moment..
Sat Jan 12 2008, 04:00 pm
#9
sir, as you said i have try to initialise the LCD,, RTC and display welcome msg...
but nothing is updated...??
Sat Jan 12 2008, 05:49 pm
#10
do you see atleast the welcome message?
and move stack to 50H.. 2F is not a good option..

what do you mean by nothing is updated?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am
ArnoldDiant
Fri Apr 26 2024, 03:53 am
RodneyKnorb
Thu Apr 25 2024, 07:08 pm