This is your code:
ANSEL = %00000000 ' everything is digital
ADCON0 = 0 ' disable ADC
CMCON0 = 7 ' no comparators
This is what it should be:
Al.Ansel = 0 ' disable analog
CMCON = 7 ' no comparators
This is your code:
ANSEL = %00000000 ' everything is digital
ADCON0 = 0 ' disable ADC
CMCON0 = 7 ' no comparators
This is what it should be:
Al.Ansel = 0 ' disable analog
CMCON = 7 ' no comparators
All progress began with an idea
IŽm a similar problem.
The outputs in a 16f690 controlled by HIGH command dŽont work fine.
This simpy code present the follw voltages in the pins of 16F690 pic.
Code:inicio: High PORTC.5 High PORTC.4 High PORTC.3 High PORTC.6 High PORTC.7 High PORTB.7 GOTO inicio
VCC Values:
PORTC.5 = 5V
PORTC.4 = 5V
PORTC.3 = 5V
PORTC.6 = 0.6V
PORTC.7 = 1.8V
PORTB.7 = 5V
Hi joseluistajada,
Now add a "pause 500" then make all of your port pins "LO"
All you have done in your simple little program is turn the pins ON.
Put a short delay after your last HIGH command then make all of the pins LO
and you should see your outputs flash on and off at a 1/2 second on and 1/2 second off (assuming a 4mhz crystal).
HTH,
BobK
joseluistajada, you also need to show your initialization code. The pins may not be set to digital by default. You need to set TRIS values and ANSEL and other registers before a PIC will work as expected.
Tim Barr
Bookmarks