16F688 problem


Results 1 to 8 of 8

Thread: 16F688 problem

Threaded View

  1. #1

    Default 16F688 problem

    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
    Last edited by Tobias; - 9th May 2009 at 06:24.

Similar Threads

  1. 16F688 counter problem
    By jderson in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 16th February 2008, 04:06
  2. Problem with PWM using 16F688
    By electrocomp in forum General
    Replies: 9
    Last Post: - 1st December 2007, 14:14
  3. A/D problem ON 16F688
    By Christopher4187 in forum General
    Replies: 2
    Last Post: - 19th October 2005, 22:13
  4. 16F688 problem
    By Christopher4187 in forum General
    Replies: 0
    Last Post: - 16th October 2005, 02:00
  5. Problem with 16F688 and Hserout
    By DWV in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 19th March 2005, 05:37

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts