| ??? 11/06/09 22:25 Modified: 11/06/09 22:32 Read: times |
#170524 - Code suggestions for 7segment moving display Responding to: ???'s previous message |
The simple setup of counting registers [digit1..4] and the INC on every loop creates an overflow to indexed search because the table consists of just 16 entries. This can be considered on the [segdiplay] part of the code. Actually it is not about a moving display but for a specific rolling counter using hex digits 0..9 and A..F
The part of [segdisplay] should be corrected to use only the lower nibble since the lookup table has only 16 entries. segdisplay:
mov dptr,#lookup
ANL A,#0x0F ; ADDED to clear upper nibble before used to index
movc a,@a+dptr
cpl a
mov p1,a
call delay1ms
mov p1,#0ffh
ret
Also the table entries for seven segment display decoding is partially correct. This file may be trivial but can help a lot anyone interested to 7segment display decoding to port pins. http://www.8052.com/users/angelis/sevensegment.xls K.L.Angelis |



