This is my first shot using a 16F688 and the internal OSC. I am pretty sure I have the config's set right for the OSC because I did a DEBUG command and was able to see the correct output. I have the OSC setting at INTOSCIO, WatchDog , PowerUp, BrownOut, Internale External, and, Fail Safe disabled. I have the MCLR set as a reset and it is pulled high.
My problem is just turning on and off the PortC pins. When I try to turn on/off 0, 1, and 2, only 0 turns on/off. When I comment out Pin0(ClutchOut), pin 1 turns on and not 2. Of course then when I comment out 0 and 1, then 2 turns on. Below is the code.
I did notice that I do have the Pull-Ups enabled yet only A2 and A5 are at 5v. A4 is 1.4v. The rest are 0v
INCLUDE "modedefs.bas"
Throttle Var PortA.0
ClutchIn var PortA.1
LineLockIn var PortA.2
'MCLR var PortA.3
'DEBUG var PortA.4
Arming var PortA.5
ClutchOut var PortC.0
LineLockOut var PortC.1
Aux1Out var PortC.2
Aux2Out var PortC.3
Jumper1 var PortC.4
Jumper2 var PortC.5
Marker var bit
Counter var byte
Timer var byte
Option_Reg.7=0 'Pull-Ups Enabled
TRISA=%111111
TRISC=%110000
ANSEL=%00000000 'D/A turned off on all pins
ADCON0.0=0 'ADCON turned off
VRCON.7=0 'VRef Off
'INTCON.7=1
'IOCA.5 = 0
'IOCA.4 = 0
'IOCA.3 = 0
'IOCA.2 = 0
'IOCA.1 = 0
'IOCA.0 = 1 'Throttle Interrupt On
define OSC 4
DEFINE DEBUG_REG PortA
DEFINE DEBUG_BIT 4
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_MODE 1
loop:
high LineLockOut 'Yellow LED PortC.1
high ClutchOut 'Green LED PortC.0
high Aux1Out 'White LED PortC.2
pause 1000
low LineLockOut 'Yellow LED PortC.1
low ClutchOut 'Green LED PortC.0
low Aux1Out 'White LED PortC.2
pause 1000
goto loop
Bookmarks