RA5 (MCLR) cannot be used as an output. You may only use it as MCLR or input.
Jerson
RA5 (MCLR) cannot be used as an output. You may only use it as MCLR or input.
Jerson
Ok, so if I swap one of the segments with one of the switchs it should work? say for example ra7 swapped for ra5 and set trisa as:
trisa=%00100000
Do I need to change something else?
Thanks
you're right! nothing else to change
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I just tried the attached circuit with this code:
@ DEVICE pic16F628a, INTRC_OSC_NOCLKOUT
@ DEVICE pic16F628a, WDT_ON
@ DEVICE pic16F628a, PWRT_ON
@ DEVICE pic16F628A, MCLR_OFF
@ DEVICE pic16F628a, BOD_Off '(off si es muy baja la alimentacion)
@ DEVICE pic16F628a, LVP_OFF
@ DEVICE pic16F628a, CPD_Off
@ DEVICE pic16F628a, PROTECT_Off
trisb =%00000000
trisa =%00100000
cmcon =%00000111 'Comparators Off
porta=0
portb=0
loop:
if porta.5=1 then
porta.4=1
porta.3=0
else
porta.3=1
porta.4=0
endif
goto loop
and it only lits the led on ra3
Any idea? Maybe its a simulator issue (proteus vsm)
Thanks
PORTA.4 is an open drain type. so you can't really drive it like that... you can drive it low but not high... well not directly.
BTW you really need to a resistor in serie with your LEDs to limit the current.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks Steve, I changed common cathode for common anode display and now it works as expected!!
Bookmarks