| ??? 03/06/03 22:51 Read: times |
#40967 - any one has better option |
I want to know any one has better logic of sending binary data to a 7-segment display then the following which covers lesser memory. suggestions should only be of programming not for hardware.
Objective:- 1) Keeps on monitoring Port 1 whether 8 bit data came or not .. 2) 8 bit Binary data recived at port 1, 3) Range of data 0 to 99. 4) need to be displayed via 74LS373 on two 7-segment common cathode digits. 5) Most important is memory ,logic should be developed in such a way that lesser space can be used.. ORG 00H now really i don't understand how to write a command which can keep on monitoring whether data have arrived on POrt 1 or not.Like for bit i can use:- JNB P1.0,$ but how to monitor entire port. So firstly tell me how to do that ? when ever the data comes i move it in R0 MAIN: MOV R0,P0 ;( 8 bit binary data moved) MOV A,R0 MOV B,#10 ; ( using divde command register) DIV AB CALL MSB DISPLAY (now here something i need to know, if i divide a binary 8 bits number with 10 as done above will the data i will get will be in the MSB = A , and LSB = remainder value in B.) MSB DISPLAY: ZERO: CJNE A,#00H,ONE MOV P2,#3FH JMP LSB DISPLAY ONE: CJNE A,#01H,TWO MOV P2,#06FH JMP LSB DISPLAY TWO: CJNE A,#02H,THREE MOV P2,#5BFH JMP LSB DISPLAY THREE: CJNE A,#03H,FOUR MOV P2,#4FH JMP LSB DISPLAY FOUR: CJNE A,#04H,FIVE MOV P2,#66H JMP LSB DISPLAY FIVE: CJNE A,#05H,SIX MOV P2,#6DH JMP LSB DISPLAY SIX: CJNE A,#06H,SEVEN MOV P2,#7DH JMP LSB DISPLAY SEVEN: CJNE A,#07H,EIGHT MOV P2,#07H JMP LSB DISPLAY EIGHT: CJNE A,#08H,NINE MOV P2,#8FH JMP LSB DISPLAY NINE: CJNE A,#09H,ED JMP LSB DISPLAY LSB DISPLAY: ZERO: CJNE A,#00H,ONE MOV P3,#3FH JMP MAIN ONE: CJNE A,#01H,TWO MOV P3,#06FH JMP MAIN TWO: CJNE A,#02H,THREE MOV P3,#5BFH JMP MAIN THREE: CJNE A,#03H,FOUR MOV P3,#4FH JMP MAIN FOUR: CJNE A,#04H,FIVE MOV P3,#66H JMP MAIN FIVE: CJNE A,#05H,SIX MOV P3,#6DH JMP MAIN SIX: CJNE A,#06H,SEVEN MOV P3,#7DH JMP MAIN SEVEN: CJNE A,#07H,EIGHT MOV P3,#07H JMP MAIN EIGHT: CJNE A,#08H,NINE MOV P3,#8FH JMP MAIN NINE: CJNE A,#09H,ED ED: JMP MAIN can the above be done using only one port but not changing any hardware or doing multiplexing.. |
| Topic | Author | Date |
| any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: still the same ... | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| RE: any one has better option | 01/01/70 00:00 | |
| i think i got it... | 01/01/70 00:00 | |
RE: any one has better option | 01/01/70 00:00 |



