| ??? 01/07/03 07:05 Read: times |
#35827 - RE: 4 -> 16 ASM routine needed |
Another issue that all these code samples have is that the P1 and P2 are not updated at the same time. Thus there is a short time that one of the ports has the decode from the previous time and the first one updated has the new data.
Depending upon the type of use for this 8051 4->16 decoder this may or may not be a problem. If the outputs are active high to enable some output circuit AND if it is necessary that only one output be active at once then it may be necessary to supplement the code samples a small bit. This would entail clearing both port 1 and port 2 to inactive levels prior to setting a new active level in one of the two ports. This would also make the code more complicated becasue you would need a history copy of P0 so that one can watch and compare port 0 to the history value till it changes and then only apply the pre-clear and new output update to P1 and P2 if the value on P0 has actually changed. Michael Karas |



