Hi, I have a question that I would like if someone can help me to answer it.
I am using a pic 16F690, and when I use the following program:
I am able to turn ON just port C, bit 3 and stay ON.
But I dont see port C, bit 1, ON, it may be that bit 1 turns on too fast?, if this is the case, why it does not happen
the same with bit 3?
For me, it would make sense that when the following code is executed: bsf PORTC,0x1 ;turn on LED C0
should stay ON?
If I make the following change, bit 3 and 1 turn ON without problem:
Mod edit: code tags
I am using a pic 16F690, and when I use the following program:
Code:
#include <p16F690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF)
Start:
bsf STATUS,RP0
bcf TRISC,0x1
bcf TRISC,0x3
bcf STATUS,RP0
bsf PORTC,0x1 ;turn on LED C0
bsf PORTC,0x3 ;turn on LED C0
End
I am able to turn ON just port C, bit 3 and stay ON.
But I dont see port C, bit 1, ON, it may be that bit 1 turns on too fast?, if this is the case, why it does not happen
the same with bit 3?
For me, it would make sense that when the following code is executed: bsf PORTC,0x1 ;turn on LED C0
should stay ON?
If I make the following change, bit 3 and 1 turn ON without problem:
Code:
#include <p16F690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF)
Start:
bsf STATUS,RP0
bcf TRISC,0x1
bcf STATUS,RP0
bsf PORTC,0x1 ;turn on LED C0
bsf STATUS,RP0
bcf TRISC,0x3
bcf STATUS,RP0
bsf PORTC,0x3 ;turn on LED C0
bsf STATUS,RP0
bcf TRISC,0x2
bcf STATUS,RP0
bsf PORTC,0x2 ;turn on LED C0
goto Start
End
Last edited by a moderator: