<?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-08T12:17:17-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-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9130.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>actually i want to see the display through ports of the microcontroller by connecting a 7-segment display to it,how will i connect this 7-segment display to port1 of the mirocontroller(8051),i am designing the circuit on a breadboard,what will be the program code???please helpme,its too urgent///</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>Arun Kumar V</dc:creator>
						<dc:subject></dc:subject>
						<description>Hi,From i want understand from your posts- the ADC value is displayed in Binary format on 8 LEDs on a port  ( 33H(hex)  - 00110011 (binary) -  led7. ........led0 (Display on port)1) you need a "Hex2BCD" conversion routine to display hex value into BCD on a 7 segment display  For Eg: 33H is displayed as 51Decimal  (BCD) on 2-digit 7seg display after conversion.2) if you just need the 2 digit 7 seg to display - 33, then instead of sending the processed ADC value to Port directly store it in some Register and make a look up table containing patterns for generating numbers from 0 to 9. i think this is where you are getting confused, i think you are aware of the segments in a 7 seg display - seg a,b,c,d,e,f,g,h (decimal point) -  to construct 0(zero) on a 7 seg display you have to output the port with - 11000000b or #0C0H  this will mean connecting segments "g" &amp; "h"(Decimal point) to + 5V and grounding all other segments. now lets try displaying "3" , so you out put -10110000b or #0B0H to the port - you ground the segs which are to be seen( by writing zeros-0) and connect  +5V  to the segs which have to be hidden(by writing 1s).i hope you are using Common Anode (LTS542) 7 seg display , if you are using Common Cathode (LTS543) then you have to do reverse logic with the binary number you  want to display.you draw the numbers you want to display on a paper and construct patterns 8 bit  foreach number.Apart from having lookup table ready you should also have a  Compare subroutine to CJNE the value stored in a register( ADC value which is stored) to the look up table.for eg: 33H is 00110011b which is a packed BCD number which is made up of  two numbers - 3H and 3H  after unpacking(higher nibble and lower nibble)  you will get  - 00000011b and 00000011 now store these two values in 2 variables  say HI_Byte and LO_Byte. now compare Hi_byte in the sub routine  with the Look up table and display1st  digit , same way compare Lo_byte in the lookup table  and display 2nd digit.you may have to mutliplex the digits or use CD4511 BCD decoders for each digithope this will solve your problemho boy it's been a lengthy Post - thanks to my patience Arun</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>pdi33</dc:creator>
						<dc:subject></dc:subject>
						<description>How many digits are u planning to connect to the uC?. Are u planning to display only numbers or also some alpha numeric characters? Please clarify.Actually, u need to interface a multiplexed LED display to the uC. If u clarify the above points, i can provide u a ciruit idea about the connection.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>actually i want to display some numbers only. my project is somewhat like this: i have interfaced adc(0804) and microcontroller(8051) .on appling a voltage say 2volts adc displays 033h and display is seen through port1 of microcontroller.at first i saw the display through leds connected on my trainer kit but now i want to see the display through a 7-segment display.i am providing my program code ,please tell me what changes are to be made in the code?setb p2.5setb p2.6intr bit p2.7setb intradc_port equ p1adc_val equ 30hvoltage_val equ r3back:  clr wr         setb wr         acall conversion read:   clr rd         mov a,adc_val         setb rd         mov r3,#00h         acall data_display1         mov r3,#01h         acall data_display2         mov r3,#02h         acall data_display3         mov r3,#03h         acall data_display4         mov r3,#04h         acall data_display5         mov r3,#05h         acall data_display6         sjmp back  data_display1:  mov a,#00h   conversion:    mov b,#0ah                   div ab                   mov r7,b                   mov b,#0ah                   div ab                   mov r6,b                   mov r5,a                   mov p1,r7                   acall delay                   mov p1,r6                   acall delay                   mov p1,r5                   acall delay                   retdata_display2:     mov a,#33h                    mov b,#0ah                    div ab                    mov r7,b                    mov b,#0ah                    div ab                    mov r6,b                    mov r5,a                   mov p1,r7                    acall delay                    mov p1,r6                    acall delay                    mov p1,r5                    acall delay                    ret data_display3:    mov a,#67h                   mov b,#0ah                   div ab                   mov r7,b                   mov b,#0ah                   div ab                   mov r6,b                   mov r5,a                  mov p1,r7                   acall delay                   mov p1,r6                   acall delay                   mov p1,r5                   acall delay                   ret  data_display4:   mov a,#97h                    mov b,#0ah                    div ab                    mov r7,b                    mov b,#0ah                    div ab                    mov r6,b                    mov r5,a                    mov p1,r7                    acall delay                    mov p1,r6                    acall delay                    mov p1,r5                    acall delay                    ret data_display5:     mov a,#99h                    mov b,#0ah                    div ab                    mov r7,b                    mov b,#0ah                    div ab                    mov r6,b                    mov r5,a                    mov p1,r7                    acall delay                    mov p1,r6                    acall delay                    mov p1,r5                    acall delay                     ret  data_display6:    mov a,#0ffh                      mov b,#0ah                      div ab                      mov r7,b                      mov b,#0ah                      div ab                      mov r6,b                      mov r5,a                     mov p1,r7                      acall delay                      mov p1,r6                      acall delay                      mov p1,r5                      acall delay                      ret        delay:         mov r4,#200        here:          djnz r4,here                        ret                        end</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>Hi Priya...Plz do not make multiple posts of the same topic....you have posted the same question in 3 diff. threads!!As for your problem...you would need to display 3 digits.So you need three multiplexed 7-seg displays  as pdi33 pointed out.In multiplexing what you do is connect all the 7-seg displays in parallel,to one uc port,ie P1 in your case. Now Vcc to each display is provided by a transistor controlled by a port pin.So when the transistor connected to a particular display is switched on,only that display(out of the 3) will work.Similarly the next display will be made to turn on and the remaining will be off.When this cycle continues at a fast rate (greater than 20Hz) you get the impression that all 3 displays are on at the same time.Look at the attached ckt.The display is a common anode one.To switch any display on you'll have to write a 0 to the particular port pin(P2.0,P2.1 or P2.2).</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>For writing digits you'll have to send the fol. values to P1.Digit........ P1value(in hex)--------------------------------0........... C01........... F92........... A43........... B04........... 995........... 926........... 827........... F88........... 809........... 98</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>pdi33</dc:creator>
						<dc:subject></dc:subject>
						<description>here is a simple idea for writing the display routine: (w.r.t the hardware suggested by shashi)first u define a byte say digit_count = 0. then folow the following stepsstep1:  disable all digits (p2.0=p2.1=p2.2 = 1)step2: fetch seven-segment code for the particular digit corresponding to digit_count.step3: output the seven-segment code to port1step4: enable the selected digit (p2.0/p2.1/p2.2 = 0) depending upon the digit_count.step 5: increment the digit_count and reset it if it is > = 3.return.this routine should be called in the main loop and should be called continuously in real time.( rate of execution should be > 60hz. as the full display will be shown only when the routine is executed three times for the three digits.)</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>sir, i have another doubt------ the thing is that actually for a certain voltage say 2volts ,adc is reading 033h ,this data i am sending to the microcontroller and it is displaying 033h.i want 2 see 033h on the ports of the microcontroller through seven segment display. but here the digits 0-9 doesnt correspond to the values i have provided in my program. please help me clear this doubt.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>Plz go through the previous posts.Your answer is there.For displaying digit '0' in the 7-seg,you have to send 'C0'.For displaying digit '1',you have to send 'F9'.....and so on.Read the above posts........</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>please provide your circuit...</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>pdi33</dc:creator>
						<dc:subject></dc:subject>
						<description>here is a simple circuit for directly interfacing the 7 seg to uC without multiplexing which will require a little more hardware but the software is very easy. but note that the 7- segment display should be strictly common cathode.just convert ur binary input from the ADc into BCD and output it to port p2 and lower nibble of p3. i.e two digits on p2 and one digit on port 3.0 to p3.3. direct_display.pdf</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>sir,i hv enclosed the assembly language program code of my project,but at that time i was seeing the display through leds connected  on my trainer kit, but as now i want to se the display through 7-segment display so i think some changes are to be made in my program code ,sir please tell me what are the changes to be made?</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>shyam</dc:creator>
						<dc:subject></dc:subject>
						<description>where is the code??</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>i had posted the code but somehow it didn't appear,anyways i am resending the code,please go through it and help me to find out what changes should i do to see the display through a 7-segment display.l CODE:setb p2.5<br />setb p2.6<br />intr bit p2.7<br />setb intr<br />adc_port equ p1<br />adc_val equ 30h<br />voltage_val equ r3<br />back: &nbsp;clr wr<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setb wr<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall conversion<br />&nbsp;read: &nbsp; clr rd<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov a,adc_val<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setb rd<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r3,#00h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall data_display1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r3,#01h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall data_display2<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r3,#02h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall data_display3<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r3,#03h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall data_display4<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r3,#04h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall data_display5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r3,#05h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall data_display6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sjmp back<br />&nbsp; data_display1: &nbsp;mov a,#00h<br />&nbsp; &nbsp;conversion: &nbsp; &nbsp;mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r7,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r6,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r5,a<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r7<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ret<br />data_display2: &nbsp; &nbsp; mov a,#33h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r7,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r6,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r5,a<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r7<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret<br />&nbsp;data_display3: &nbsp; &nbsp;mov a,#67h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r7,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r6,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov r5,a<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r7<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ret<br />&nbsp; data_display4: &nbsp; mov a,#97h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r7,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r6,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r5,a<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r7<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret<br />&nbsp;data_display5: &nbsp; &nbsp; mov a,#99h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r7,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r6,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r5,a<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r7<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ret<br />&nbsp; data_display6: &nbsp; &nbsp;mov a,#0ffh<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r7,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov b,#0ah<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div ab<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r6,b<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov r5,a<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mov p1,r7<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r6<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,r5<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acall delay<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret<br />&nbsp; &nbsp; &nbsp; &nbsp; delay: &nbsp; &nbsp; &nbsp; &nbsp; mov r4,#200<br />&nbsp; &nbsp; &nbsp; &nbsp; here: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;djnz r4,here<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>Arun Kumar V</dc:creator>
						<dc:subject></dc:subject>
						<description>Hi Priya123, did you read my earlier post in this thread ?  it took a lot of my time to explain the whole concept in a simple way.  Again your are back to square One and all you do is ask the same question again and again. other members too have tried their best to explain to you the concept even with diagrams but you don't want to learn .Please Note: it is minimum courtesy for you to thank the members who are trying to help you before you start your new post Arun</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>pdi33</dc:creator>
						<dc:subject></dc:subject>
						<description>Is the code for the 7segment display or for the simple LED display which u have written? please add circuit diagram or atleast the connections used by u for connecting the LED display. else it is difficult to follow the logic u have used. For e.g. note the following code:'data_display1: mov a,#00hconversion: mov b,#0ah'What does it exactly do? Is it the display driving routine or the ADC conversion routine   .Always define the port pins with the respective functions as it makes the code more readable for u as well as for US   Also mention whether u are using the direct display drive ( check circuit diagram posted by me in my previous post) or the multiplexed display as suggested by shashi. This is important as both methods require completely different code logic .</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>OK one last time.....You can do it this way... CODE:data_display6: mov a,#0ffh<br />mov b,#0ah<br />div ab<br />mov r7,b<br />mov b,#0ah<br />div ab<br />mov r6,b<br />mov r5,a<br />mov p1,r7<br />acall delay<br />mov p1,r6<br />acall delay<br />mov p1,r5<br />acall delay change to CODE:data_display6: mov a,#0ffh<br />mov b,#0ah<br />div ab<br />mov r7,b<br />mov b,#0ah<br />div ab<br />mov r6,b<br />mov r5,a<br />mov a,r7<br />acall disp_7seg<br />;mov p1,r7<br />acall delay<br />mov a,r6<br />acall disp_7seg<br />;mov p1,r6<br />acall delay<br />mov a,r5<br />acall disp_7seg<br />;mov p1,r5<br />acall delay for disp_7seg subroutine,you compare the value of 'a' with 0.If they match send 'CO' to P1.If not then compare 'a' with 1 and send 'F9' if they match.Similarly proceed with other digits upto 9.CJNE a,#0,D1mov p1,#0C0hD1:CJNE a,#1,D2mov p1,#0F9hD2:CJNE a,#2,D3mov p1,#0A4h   .   .   .   .ret</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>Arun Kumar V</dc:creator>
						<dc:subject></dc:subject>
						<description>after a match is found it can jmp to calling routineCODE:disp_7seg: &nbsp;CJNE a,#0,D1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov p1,#0C0h<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sjmp back<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />D1: CJNE a,#1,D2<br />&nbsp; &nbsp; &nbsp; &nbsp; mov p1,#0F9h &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; sjmp back<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />D2: &nbsp;CJNE a,#2,D3<br />&nbsp; &nbsp; &nbsp; &nbsp; mov p1,#0A4h &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; sjmp back<br />.<br />.<br />.<br />.<br />.<br />back: &nbsp;ret<br />&nbsp;Arun</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>oops forgot the return after match.....thanks Arun for the correction.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>sir,i have tried to simulate my program by the way u suggested,i hv tried to write the program code in that way,but  i think still i hv made some mistakes,as its not working.when i am simulating my program it shows the following errors------in  the disp_7segment subroutine if i write sjmp back  then error shows ADDRESS OUT OF RANGE. Replacing sjmp back  by ret it gives  STACK OVERFLOW.Please sir help me to correct the errors.i am enclosing the code here-------   setb p2.5setb p2.6intr bit p2.7setb intradc_port equ p1adc_val equ 30hvoltage_val equ r3back:  clr wr       setb wrconversion:   acall conversion read:  clr rd        mov a,adc_val        setb rd        mov r3,#00h        acall data_display1        mov r3,#01h        acall data_display2        mov r3,#02h        acall data_display3        mov r3,#03h        acall data_display4        mov r3,#04h        acall data_display5        mov r3,#05h        acall data_display6        sjmp back   data_display1:  mov a,#00h                   mov b,#0ah                   div ab                   mov r7,b                   mov b,#0ah                   div ab                   mov r6,b                   mov r5,a                   mov a,r7                   mov p1,r7                   acall disp_7segment                   acall delay                   mov a,r6                   mov p1,r6                   acall disp_7segment                   acall delay                   mov a,r5                   mov p1,r5                   acall disp_7segment                   acall delay   data_display2:    mov a,#33h                       mov b,#0ah                       div ab                       mov r7,b                       mov b,#0ah                       div ab                       mov r6,b                       mov r5,a                       mov a,r7                       mov p1,r7                       acall disp_7segment                       acall delay                       mov a,r6                       mov p1,r6                       acall disp_7segment                       acall delay                       mov a,r5                       mov p1,r5                       acall disp_7segment                       acall delay     data_display3:     mov a,#67h                        mov b,#0ah                        div ab                        mov r7,b                        mov b,#0ah                        div ab                        mov r6,b                        mov r5,a                        mov a,r7                        mov p1,r7                        acall disp_7segment                        acall delay                        mov a,r6                        mov p1,r6                        acall disp_7segment                        acall delay                        mov a,r5                        mov p1,r5                        acall disp_7segment                        acall delay      data_display4:    mov a,#99h                        mov b,#0ah                        div ab                        mov r7,b                        mov b,#0ah                        div ab                        mov r6,b                        mov r5,a                        mov a,r7                        mov p1,r7                        acall disp_7segment                        acall delay                        mov a,r6                        mov p1,r6                        acall disp_7segment                        acall delay                        mov a,r5                        mov p1,r5                        acall disp_7segment                        acall delay      data_display5:    mov a,#97h                        mov b,#0ah                        div ab                        mov r7,b                        mov b,#0ah                        div ab                        mov r6,b                        mov r5,a                        mov a,r7                        mov p1,r7                         acall disp_7segment                        mov a,r6                        mov p1,r6                        acall disp_7segment                        mov a,r5                        mov p1,r5                        acall disp_7segment                        acall delay     data_display6:       mov a,#0ffh                          mov b,#0ah                          div ab                          mov r7,b                          mov b,#0ah                          div ab                          mov r6,b                          mov r5,a                          mov a,r7                          mov p1,r7                          acall disp_7segment                          mov a,r6                          mov p1,r6                          acall disp_7segment                          mov a,r5                          mov p1,r5                          acall disp_7segment                          acall delay    disp_7segment:  cjne a,#0,d1                            mov p1,#0c0h                            ret                 d1:     cjne a,#1,d2                       mov p1,#0f9h                       ret               d2:     cjne a,#2,d3                        mov p1,#0a4h                        ret               d3:    cjne a,#3,d4                         mov p1,#0b0h                         ret               d4:     cjne a,#4,d5                          mov p1,#99h                          ret               d5:     cjne a,#5,d6                           mov p1,#92h                           ret               d6:     cjne a,#6,d7                            mov p1,#82h                            ret               d7:      cjne a,#7,d8                           mov p1,#0f8h                           ret               d8:     cjne a,#8,d9                            mov p1,#80h                            ret               d9:     cjne a,#9,d10               d10:             mov p1,#98h                             ret                      delay:  mov r4,#200                    here:   djnz r4,here                             ret                             end                                                                                                                                                                                                                                  thanking u,</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>sir,once again i tried to simulate the program by removing the statement CONVERSION:ACALL CONVERSION,program after being simulated shows no error ,in the previous case it was showing STACK OVERFLOW.but i just want to confirmis it the correct way i am programming???lease send a quick reply.                                                                                                       thanking u sir</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>Arun Kumar V</dc:creator>
						<dc:subject></dc:subject>
						<description>Hi Priya,CODE:setb p2.5<br />setb p2.6<br />intr bit p2.7<br />setb intr<br />adc_port equ p1<br />&nbsp;adc_val equ 30h<br />voltage_val equ r3<br />back: clr wr<br />setb wr<br />conversion: acall conversion<br />read: clr rd<br />mov a,adc_val<br />setb rdhere are the  two bugs i found :back: clr wrsetb wrconversion: acall conversion1) label name : back is already defined once and you are using it again in the disp_7seg routine, in my last post i used the sjmp back ( i didn't know that back label was already used )command just to avoid  so many ret s,  so the program was trying to sjmp (short jump) from disp_7seg routine to back label in the begininng of the program which is obviously out of address range ( in some cases when you get "out of range " error trying using LJMP command instead of SJMP)2) conversion: acall conversion  - the program counter  is stuck here indefinetly 3) tip : it is a good practice  to  First relocate the stack pointer beyond the 4 Register Banks Address &amp; bit addressable ram ( from 20h) in the main routine - this avoids stack overflow/over writing   you can use  :  MOV SP,#50H   ; put this in the first line of your Main routine to relocate SP to some safe address which you'll not be using for your variables try these corrections and simulate Arun</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>pdi33</dc:creator>
						<dc:subject></dc:subject>
						<description>hi priya, looks like something is seriously missing in ur code.data_display1: mov a,#00hmov b,#0ah                     div ab                       -----here acc=0 and b =0ahmov r7,bmov b,#0ahdiv abmov r6,bmov r5,amov a,r7mov p1,r7        -------here r7 will always bear a value 00h   from ur code i feel that the segments of  display  are connected to port p1.now in the above code there is no mention of the register r3 nor is the adc_val u have put in accumulator. So please check the logical flow of ur routine. also mention the hardware connections of the adc and display to the uC to avoid further confusion.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>sashijoseph</dc:creator>
						<dc:subject></dc:subject>
						<description>CODE:mov r6,b<br />mov r5,a<br />mov a,r7<br />mov p1,r7<br />acall disp_7segment<br />acall delay<br />mov a,r6<br />mov p1,r6<br />acall disp_7segment<br />acall delay<br />mov a,r5<br />mov p1,r5<br />acall disp_7segment<br />acall delay Comment out or remove the fol. lines in the code above(as well as in all the other display routines).1)mov p1,r72)mov p1,r63)mov p1,r5</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9130.html">
						<title>Re: query regarding display</title>
						<link>http://www.8051projects.net/forum-t9130.html</link>
						<dc:date>2009-01-08T12:17:17-08:00</dc:date>
						<dc:creator>priya123</dc:creator>
						<dc:subject></dc:subject>
						<description>thanx a lot a shash sir,arun sir n  pdi33 sir,my program has now started working.its all because of ur guidance,thanx .</description>
						</item>
				</rdf:RDF>