I didn't want to make a similar topic so therefore I'm including my findings here. I'm using 16F876A and also A.4 is causing some minor problems.
Code part "Test" is working OK, so PortA.1-5 and PortB.1-5 switching on and off.
Problem occurs with "Test2" on A.4. A.4 is always LOW, meaning that corresponding LED is always ON (other 9 LED's are OK).
I have pull-up for A.4 (open drain) so, it should goes up as soon as it is set high, as it does with "Test" code.
Any idea whats is wrong or how to fix it? At the moment I don't want to change make HW changes so SW is prefered
BR,Code:Mainloop: GOSUB Test GOSUB Test2 GOTO Mainloop Test: PortA = %00000000 PortB = %00000000 PAUSE 500 PortA = %00111110 PortB = %00111110 PAUSE 500 RETURN Test2: LED = %11111111111 GOSUB Select_LED PAUSE 500 LED = %00000000000 GOSUB Select_LED PAUSE 500 RETURN Select_LED: LED = ~LED 'Invert for P-FET supply for LEDs PortB.1 = LED.4 'LED4 PortB.2 = LED.6 'LED6 PortB.3 = LED.8 'LED8 PortB.4 = LED.10 'LED10 PortB.5 = LED.2 'LED2 PortA.5 = LED.5 'LED5 PortA.4 = LED.7 'LED7 !!!!!!!!Open drain PortA.3 = LED.9 'LED9 PortA.2 = LED.1 'LED1 PortA.1 = LED.3 'LED3 RETURN
-Gusse-





Bookmarks