I have strange problem with LEDs on PCB EasyPIC5 HW REV 1.02.
I pogrammed the PIC16F877A using code:
Code: Select all
program display1
dim i as byte
sub function mask(dim num as byte) as byte ' this function returns mask
' of parameter 'num'
select case num ' for common cathode 7-seg. display
case 0 result = $3F
case 1 result = $06
case 2 result = $5B
case 3 result = $4F
case 4 result = $66
case 5 result = $6D
case 6 result = $7D
case 7 result = $07
case 8 result = $7F
case 9 result = $6F
end select'case end
end sub
main:
INTCON = 0 ' Disable PEIE,INTE,RBIE,T0IE
TRISA = 0
TRISB = 0
TRISC = 0
TRISD = 0
TRISE = 0
' PORTD = 0
' PORTA = 4
while TRUE
for i = 0 to 9
PORTA = mask(i)
PORTB = mask(i)
PORTC = mask(i)
PORTD = mask(i)
' PORTE = mask(i)
Delay_ms(500)
next i
wend 'endless loop
end.
All dip swithes are turned off and notheing is connected to the ports (DIS0...3, SW1...SW5, SW7...SW9 ae in off position)
Then I compiled code:
Code: Select all
program display1
main:
INTCON = 0 ' Disable PEIE,INTE,RBIE,T0IE
TRISA = 0
TRISB = 0
TRISC = 0
TRISD = 0
TRISE = 0
' PORTD = 0
' PORTA = 4
PORTA = 255
PORTB = 255
PORTC = 255
PORTD = 255
end.
RA4, RA6, RA7, RC3, RC4, RC5 are always turned off.
What can be a reason of that?