??? 05/22/04 02:33 Read: times |
#70913 - RE: Programmable relationship between pi Responding to: ???'s previous message |
Right - most of 8052 clones have quite enough pins so you should be able to create a procedure that picks the right function depending on, say, a dip switch or a jumper attached to pins on a different port.
Say, MOV P0,#FFh MOV P1,#FFh CLR C LOOP: MOV P0.0,C MOV C,P0.1 LOOP2 JNB P1.0,DO_ANL JNB P1.1,DO_ORL JNB P1.2,DO_XRL JMP LOOP2 DO_ANL: ANL C,P0.2 JMP LOOP DO_ORL ORL C,P0.2 JMP LOOP DO_XRL ;do your homework, there's no bitwise XRL in '52. ;so write your own. JMP LOOP |