Hello everyone,
I have another strange experience with PIC16Fxx microcontrollers. The chip was supposed to send a 1 to RA1, RA2, and a 0 to RA3 when RA0 was 1 and a 0 to RA1, RA2, and a 1 to RA3 when RA0 was 0. So when I connected RA0 to power RA1 and RA2 (with their LEDs) lit up, and when I connected RA0 to ground, RA3 lit up. But then when I attached RA0 to nothing, just in the air, all three LEDs lit up. I don't have the exact code but it was something like this.
(This was a PIC16F84A 20I/P chip)
Also, what are the designations for on and off for the inputs on the PIC?
Thanks!
I have another strange experience with PIC16Fxx microcontrollers. The chip was supposed to send a 1 to RA1, RA2, and a 0 to RA3 when RA0 was 1 and a 0 to RA1, RA2, and a 1 to RA3 when RA0 was 0. So when I connected RA0 to power RA1 and RA2 (with their LEDs) lit up, and when I connected RA0 to ground, RA3 lit up. But then when I attached RA0 to nothing, just in the air, all three LEDs lit up. I don't have the exact code but it was something like this.
(This was a PIC16F84A 20I/P chip)
Rich (BB code):
PORTA equ 0x05
TRISA equ 0x85
STATUS equ 0x03
main: bsf STATUS, 5
movlw 0x01
movwf TRISA
bcf STATUS, 5
loop: btfss PORTA, 0
goto is_off
goto is_on
is_off: bcf PORTA, 1
bcf PORTA, 2
bsf PORTA, 3
goto loop
is_on: bsf PORTA, 1
bsf PORTA, 2
bcf PORTA, 3
goto loop
end
Thanks!