<?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>2008-12-01T22:50:08-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-t10309.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10309.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10309.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10309.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t10309.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t10309.html">
						<title>problem with timer..</title>
						<link>http://www.8051projects.net/forum-t10309.html</link>
						<dc:date>2008-12-01T22:50:08-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>hi friends, i m facing aproblem with timer ... CODE:<br />void check_button&#40;&#41;;<br />void OFF&#40;&#41;;<br />//unsigned char <br />void inti_m&#40;&#41;;<br />unsigned short SECOND,cnt,minu,h,m;<br />int*MINUTE=1,HOUR=0,oldstate;<br />void min_init&#40;&#41;;<br />//void <br />void interrupt&#40;&#41;<br />&#123;<br />cnt++ ;<br />PIR1.TMR1IF = 0; // clear TMR1IF <br />TMR1H = 0x0B;<br />TMR1L = 0xF7;<br />if &#40;cnt == 2&#41; &#123; // if cnt is 76 <br />SECOND++;<br />cnt = 0; // reset cnt <br />if &#40;SECOND==60&#41;<br />&#123;<br />SECOND=0; //reset SECOND <br />// m++; <br />// if(m==1) <br />// { m=0; <br />min_init&#40;&#41; ; //GO TO min_init() function <br />//PORTB =~PORTB; <br />// } <br />&#125;<br />&#125;<br /><br />&#125;<br />void main&#40;&#41;<br />&#123;<br />inti_m&#40;&#41;;<br />check_button&#40;&#41;;<br /><br />do&#123;<br /><br />if&#40;PORTB.F0==0&#41;<br />&#123;check_button&#40;&#41;;<br />&#125;<br />else if &#40;PORTB.F0==1&#41;<br />&#123;<br />OFF&#40;&#41;;<br />&#125;<br />&#125;<br />while&#40;1&#41;;<br /><br />&#125;<br /><br />void inti_m&#40;&#41;<br />&#123;<br />//OPTION=0x40; <br />TRISB=0x00;<br />TRISC=0xFF;<br />PORTB=0xF0;<br />//PORTC=0x00; <br /><br />TMR1H = 0x0B; // Initialize Timer1 register <br />TMR1L = 0xFD;<br /><br />cnt = 0; // initialize cnt <br />INTCON = 0xC0; // Set GIE, PEIE <br />//PORTB = 0xF0; // Initialize PORTB <br />SECOND=0;<br />m=0;<br />minu=0;<br /><br /><br />&#125;<br />void check_button&#40;&#41;<br />&#123;<br />for&#40;;;&#41;<br />&#123;<br />if &#40;PORTC.F0==1&#41;<br />&#123; // Delay_ms(10); <br />// if(PORTB==0){ <br />//if ( Button(&PORTB, 0, 1, 0)) { <br />PORTB.F0=1;<br />PIE1.TMR1IE = 1; // enable Timer1 interrupt <br />T1CON.T1CKPS1=1;<br />T1CON.T1CKPS0=1;<br />T1CON.T1OSCEN=1;<br />T1CON.TMR1ON = 1; // Timer1 settings <br />PIR1.TMR1IF = 0; // clear TMR1IF <br />/*}<br />else<br />{<br />OFF();<br />} */<br />break;<br />&#125;<br />&#125;<br />&#125;<br /><br />void min_init&#40;&#41;<br />&#123;<br />minu++;<br />if &#40;minu>=MINUTE&#41;<br />&#123; minu=0;<br />PORTB.F0 =0;<br />T1CON = 0;<br /><br />&#125;<br />// return 0; <br />&#125;<br />void OFF&#40;&#41;<br />&#123;if&#40;PORTC.F0==1&#41;<br />&#123; PORTB=0;<br />T1CON = 0;<br />//INTCON.RBIF=0; <br />&#125;<br />&#125;<br /><br />&nbsp; this is the programm for the 1min timer , operated when key is pressed. it works fine ..... i  m using  mikro c compiler.....but my problem is that after timer starts in between key is pressed microcontroller should be reset..... or itshould go to the OFF () function and exicute it............ please any budy help me..............</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10309.html">
						<title>Re: problem with timer..</title>
						<link>http://www.8051projects.net/forum-t10309.html</link>
						<dc:date>2008-12-01T22:50:08-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>are you sure its working fine?try this small change in main program..CODE:while&#40;1&#41;&#123;<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0==0&#41;; //Wait for keypress<br />&nbsp; &nbsp; &nbsp;check_button&#40;&#41;; &nbsp; //Keypressed start timer<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0&#41;; &nbsp; &nbsp; //Wait for release<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0==0&#41;; //wait for keypress again<br />&nbsp; &nbsp; &nbsp;OFF&#40;&#41;; &nbsp; &nbsp; &nbsp; //key pressed stop timer<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0&#41;; //wait for release<br />&#125;<br />&nbsp;I hope this is what you wanted</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10309.html">
						<title>Re: problem with timer..</title>
						<link>http://www.8051projects.net/forum-t10309.html</link>
						<dc:date>2008-12-01T22:50:08-08:00</dc:date>
						<dc:creator>electronicfreak</dc:creator>
						<dc:subject></dc:subject>
						<description>Ajay wrote ...are you sure its working fine?try this small change in main program..CODE:while&#40;1&#41;&#123;<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0==0&#41;; //Wait for keypress<br />&nbsp; &nbsp; &nbsp;check_button&#40;&#41;; &nbsp; //Keypressed start timer<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0&#41;; &nbsp; &nbsp; //Wait for release<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0==0&#41;; //wait for keypress again<br />&nbsp; &nbsp; &nbsp;OFF&#40;&#41;; &nbsp; &nbsp; &nbsp; //key pressed stop timer<br />&nbsp; &nbsp; &nbsp;while&#40;PORTB.F0&#41;; //wait for release<br />&#125;<br />&nbsp;I hope this is what you wanted  sir , my problem is that portB is zero when key is pressed timer starts , when it complete the given time timer reset,  at that time key is pressed it works fine............when timer is running in between key is pressed it won't take it , untill unless specified time will exicute ............. but software works fine..........above mentioned problem occurs only when i burn hex to uC .</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10309.html">
						<title>Re: problem with timer..</title>
						<link>http://www.8051projects.net/forum-t10309.html</link>
						<dc:date>2008-12-01T22:50:08-08:00</dc:date>
						<dc:creator>electronicfreak</dc:creator>
						<dc:subject></dc:subject>
						<description>sir , u are suggested code is works as my  code...............i mentioned my problem in previous post...........</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t10309.html">
						<title>Re: problem with timer..</title>
						<link>http://www.8051projects.net/forum-t10309.html</link>
						<dc:date>2008-12-01T22:50:08-08:00</dc:date>
						<dc:creator>electronicfreak</dc:creator>
						<dc:subject></dc:subject>
						<description>sir , u are suggested code is works as my  code...............i mentioned my problem in previous post...........</description>
						</item>
				</rdf:RDF>