Hello everyone
i need some help from you againon a tester i am presently working on.
Basically the tester is a cable tester which tests the Continuity of a 16 core cable and also checks to see if the cable cores are shorted to each other.
I am using two 16 channel multiplexers which both have 4 control lines and an enable pin (DG406)
so i am using portc of the 16f877 for those where the first four bits RC0 - RC3 controls Mux1 and the last four bits RC4 - RC7 controls Mux2
Now here comes the problem.
i want to be able to leave the value of the first 4 bits constant and then change just the last 4 bits to check for shorts (ie if s1 on mux1 is shorted to s2,3,4---s16
but the only way i can do this is very long winded as you can see from below
Is there and easier way i can do this as i would need to do this for 16 times for each pin
PIN1_SHORT:
high PORTE.0: PORTC=%00011111
GOSUB SHORT_CHECK ' check if shorted to pin2
high PORTE.0: PORTC=%00101111
GOSUB SHORT_CHECK ' check if shorted to pin3
high PORTE.0: PORTC=%00111111
GOSUB SHORT_CHECK ' check if shorted to pin4
high PORTE.0: PORTC=%01001111
GOSUB SHORT_CHECK ' check if shorted to pin5
high PORTE.0: PORTC=%01101111
GOSUB SHORT_CHECK ' check if shorted to pin6
high PORTE.0: PORTC=%01111111
GOSUB SHORT_CHECK ' check if shorted to pin7
high PORTE.0: PORTC=%10001111
GOSUB SHORT_CHECK
RETURN
Best Regards
Toni
Bookmarks