<?xml version="1.0" encoding="utf-8" ?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
				<channel rdf:about="http://www.8051projects.net/">
				<title>8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes : Forum / topic</title>
				<link>http://www.8051projects.net/</link>
				<description>Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet.</description>
				<dc:language>en-gb</dc:language>
				<dc:date>2009-01-07T22:34:45-08:00</dc:date>
				<dc:creator>contact@nospam.com</dc:creator>
				<admin:generatorAgent rdf:resource="http://e107.org" />
				<admin:errorReportsTo rdf:resource="mailto:contact@nospam.com" />
				<sy:updatePeriod>hourly</sy:updatePeriod>
				<sy:updateFrequency>1</sy:updateFrequency>
				<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
				<items>
				<rdf:Seq>
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t760.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>i am  trying to implement a real time clock using an 16x2 LCD microcontroller AT89C5131 in our project.we want only the clock part without the alarm and i removed some part of the clock.asm program and tried but its not working.our lcd is working properly.we are trying to display date,time and day onlyi want to know if the code given below will workadditional change is i have given a small delay before actual starting. Code removed!</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>I removed the code from the first post, coz no more needed.So regarding the information about the flags i used.. i am gonna explain then one by one.. all the defination in the code.CODE:<br />sec equ 30h &nbsp; &nbsp; &nbsp; ;second register *needed*<br />to store RTC seconds<br />min equ 31h &nbsp; &nbsp; &nbsp;;minutes register *needed*<br />to store mins<br />hour equ 32h &nbsp; &nbsp; ;hour register *needed*<br />to store hr<br />days equ 33h &nbsp; &nbsp; ;days register *needed*<br />to store days<br />date equ 34h &nbsp; &nbsp; ;date register *needed*<br />to store date<br />month equ 35h &nbsp; ;month register *needed*<br />to store month<br />year equ 36h &nbsp; &nbsp; &nbsp;;year register *needed*<br />to store year<br />alarm equ 37h &nbsp; &nbsp;;alarm register *needed*<br />it is written as alarm but it is used for SQWT register of<br />your RTC. so is also needed, if you want change the name to<br />sqwt or something u want.<br />sig equ 38h &nbsp; &nbsp; &nbsp; ;signature for data checking in RTC RAM *needed*<br />needed for checking of valid ram content of RTC<br />ahour equ 39h &nbsp; ;alarm hour register<br />for alarm only can be removed<br />amin equ 3Ah &nbsp; &nbsp;;alarm minute register<br />for alarm only can be removed<br />sda equ P1.1 &nbsp; &nbsp; ;Serial data pin *needed*<br />SDA pin for I2C<br />scl equ P1.0 &nbsp; &nbsp; &nbsp; ;Serial clock pin *needed*<br />SCL pin for I2C communication<br />rw equ p3.6 &nbsp; &nbsp; &nbsp; &nbsp;;read write pin of LCD<br />for LCD<br />en equ p3.5 &nbsp; &nbsp; &nbsp; ;enable pin of LCD<br />for LCD<br />rs equ p3.7 &nbsp; &nbsp; &nbsp; &nbsp;;register select pin of LCD<br />for LCD<br />alarm_key equ p3.3 &nbsp; ;Alarm set key<br />to set alarm.. not needed.. so one key can be removed. and<br />also the subroutine at location 0x13H<br />time_key equ p3.2 &nbsp; &nbsp;;Time ser key *needed*<br />to set time of clock<br />increment equ p1.3 &nbsp; ;Increment value *needed*<br />to set time and alarm, but for u it will only time<br />decrement equ p1.2 &nbsp; ;Decrement Value *needed*<br />to set time and alarm, used to reduce the value<br />alarm_port equ p1.4 &nbsp; ;Alarm Buzzer port<br />not required<br />alarm_flag equ 20h &nbsp; &nbsp;;flag for alarm<br />not required<br />time_flag equ 21h &nbsp; &nbsp; &nbsp;;flag for time *needed*<br />when u press time set key this flag is set.<br />ampm_flag equ 22h &nbsp; &nbsp;;am/pm flag *needed*<br />used in display am/pm<br />alarm_on equ 23h &nbsp; &nbsp; &nbsp; ;Alarm on flag<br />not required<br />alarm_off equ 24h &nbsp; &nbsp; &nbsp; ;alarm off flag<br />not required<br />alarm_ring equ 25h &nbsp; &nbsp; &nbsp;;alarm ring flag<br />not required<br />alarm_hrs equ 58h &nbsp; &nbsp; &nbsp; ;Alarm hour register<br />not required<br />alarm_min equ 59h &nbsp; &nbsp; &nbsp;;Alarm Minutes register<br />not needed<br />alarm_chk_hour equ 5Ah ;Alarm hour check register<br />not needed<br />alarm_chk_min equ 5Bh &nbsp;;Alarm min check register<br />not required<br />ampm equ 61h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;AM/PM register *needed*<br />needed<br />BELL equ 0h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;Bell icon *needed*<br />SPEAKER_OFF equ 1h &nbsp;;speaker off icon *needed*<br />SPEAKER_ON equ 2h &nbsp; &nbsp;;speaker on icon *needed*<br />CLOCK equ 3h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;clock icon *needed*<br />OK equ 4h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;ok icon *needed*<br />HEART equ 5h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;heart icon *needed*<br />MUSIC equ 6h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;music icon *needed*U can see what things are needed, what variables or flagsneeded. Please carefully edit the code now.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>actually you did not edited the code properly.you removed many things which were necessary for the clock. I am giving you one example...In your code above there is a mistake..CODE:done:<br />mov sec,#00h ;For more information about the RTC DS1307<br />mov min,#0h ;Please refer to the datasheet<br />mov hour,#51h ;21h for 24 hour format<br />mov days,#01h<br />mov date,#1h<br />mov month,#1h<br />mov year,#05h<br />;;;LINE MISSING;;;<br />mov sig,#'~'<br />mov r6,#07h<br />mov r0,#30h<br />mov r1,#00h<br />acall rtc_ini ;initializing RTC if requiredthere is a line missing.. i mentioned where...you missed..CODE:mov alarm,#0the reason is.. if you take a look at the datasheet of DS1307 then register #7 is SQWT register so.. as we are not using it, so we have to make it 0. The reason i made kept its name as alarm was, i was first driving the alarm from internal square wave generator but then i changed it. if you want you can keep the old name. or change the alarm to sqwt for your knowledge.so make these changes in above code..put the missing line there and change thisCODE:mov r6,#08hmake it 08H u using 07Hand i do not understand why you are putting this codeCODE:MOV R7,#0FFH<br />BACK1:MOV TMOD,#01H<br />MOV TL0,#00H<br />MOV TH0,#00H<br />SETB TR0<br />HER:JNB TF0,HER<br />CLR TF0<br />CLR TR0<br />DJNZ R7,BACK1Please explain the use of this. and check what all things are missing in the code. i think you must start reviewing the original code again and rewrite the original one according to your need.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>pinky</dc:creator>
						<dc:subject></dc:subject>
						<description>thanks for the advice...actually had a doubt in understanding the code.wanted to know why exactly time flag and alarmflag used...and also the increament and decreament flag. can we do without using switches.i.e is it for setting time in clock or setting time  for alarm...</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>Well i need help and contribution from other forum members too..   not just me.. ok?</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Junied </dc:creator>
						<dc:subject></dc:subject>
						<description>great help! keep it up Rickey!</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>NiceThou</dc:creator>
						<dc:subject></dc:subject>
						<description>In your code , there's a label i dont understand .it's thealgorthm to read data from ds1307recv:						;Recieving data from I2C bus	mov        r7,#08back2:	setb       sda	setb       scl	lcall      delay       ;nop nop nop;	mov        c,sda	rlc        a	clr        scl	lcall      delay       ;nop nop nop;	djnz       r7,back2	setb       sda	clr        scl	lcall      delay       ;nop nop nop;	clr        sda	setb       scl	lcall      delay       ;nop nop nop;	clr        scl	lcall      delay       ;nop nop nop	mov        @r0,a	inc        r0	retSDA=1 => C=1 , then A =11111111 after 8 times shift left ??????????</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>NiceThou wrote ...In your code , there's a label i dont understand .it's thealgorthm to read data from ds1307recv:						;Recieving data from I2C bus	mov        r7,#08back2:	setb       sda	setb       scl	lcall      delay       ;nop nop nop;	mov        c,sda	rlc        a	clr        scl	lcall      delay       ;nop nop nop;	djnz       r7,back2	setb       sda	clr        scl	lcall      delay       ;nop nop nop;	clr        sda	setb       scl	lcall      delay       ;nop nop nop;	clr        scl	lcall      delay       ;nop nop nop	mov        @r0,a	inc        r0	retSDA=1 => C=1 , then A =11111111 after 8 times shift left ??????????I thought everything was mentioned clearly...recv:      ;Receiving data from I2C busit is to receive data from I2C bus... and yes, if u keep SDA = 1 so while reading C will also be 1.but everytime the clock changes, the new data comes on the SDA pins. so next can be 0 or 1.if whole data is 1, then u get a = 11111111</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>you're welcome</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>NiceThou</dc:creator>
						<dc:subject></dc:subject>
						<description>Thankz u .Now i understand</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>gongyoo</dc:creator>
						<dc:subject></dc:subject>
						<description>can provide the sample c programming about this project??actually I use the DS1302 real time clock do this  project?? can provide the sample c programming ?thanks</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t760.html">
						<title>Re: doubt in rtc</title>
						<link>http://www.8051projects.net/forum-t760.html</link>
						<dc:date>2009-01-07T22:34:45-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>I dont that enough time to do that.. I am really sorry. I highly insist you to please start it on your own.. read the datasheet and check the timing diagram on how to start with reading and writing. Will help you in all respect.</description>
						</item>
				</rdf:RDF>