Melanie where are you?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107

    Default Melanie where are you?

    I am beating my head against a wall trying to figure out why this program makes GPIO.0 output high for 4ms and low for 12ms. Also, GPIO.1 output is high for 8ms and low for 8ms. I would expect GPIO.1 to be low for 4ms and high for 12ms. GPIO.0 should be high all the time.

    REM DEVICE = 12F675 '12F629 CAN ALSO BE USED
    REM USE INTERNAL OSCILLATOR, OUTPUT IS ON GP4 (PIN 3)
    REM CONFIGURATION: INTOSC CLOCKOUT, WDT DISABLED, PWR UP ENABLED,
    'MCLR = OUTPUT PIN, BROWN OUT DISABLED, NO PROTECTION
    REM 60 HZ OUTPUT IS ON PINS 7 AND 6
    REM OSCILLATOR CHOICE: USE 101, INTOSC, CLKOUT
    OPTION_REG.5 = 0 'OTHERWISE GPIO.2 IS AN INPUT
    TRISIO = 0 'SETS ALL PORTS TO OUTPUT
    ANSEL = 0 'SETS ALL DIGITAL MODE
    DEFINE OSCCAL_1K 1 'FOR OSCILLATOR CALIBRATION, DON'T KNOW HOW IT WORKS

    high GPIO.0 'INITIAL CONDITIONS
    high GPIO.1

    START:
    low GPIO.1
    PAUSEUS 4168 ' ON TIME
    high GPIO.1
    PAUSEUS 4167 'DEAD TIME, BOTH high
    REM low GPIO.0 'SETS PIN 7 low
    PAUSEus 4168 'FOR 4.168 MILLISECONDS
    high GPIO.0
    PAUSEUS 4167 'DEAD TIME

    GOTO START '60 HZ FREQUENCY

    END
    Last edited by Russ Kincaid; - 9th May 2007 at 22:34.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Where's the CMCON setting?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Yeah, I would've asked for the pretty girl first too.

    But I think mister_e nailed it. CMCON
    <br>
    DT

  4. #4
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    Hay, thanks for the replies. If ANSEL = 0, I don't see why CMCON setting would make any difference. I tried CMCON = 0, no difference. Is there some other setting that would make sense?

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    CMCON = 7
    (7 = all digital, 0 = one of the analog modes)
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  6. #6
    Join Date
    Mar 2007
    Location
    Boston, MA USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Try setting CMCON=7. Bits 0,1,2 high in CMCON=Comparator off. GP0 and GP1 pins are multiplexed to the comparator inputs. Something to try...

    --John

  7. #7
    Join Date
    Mar 2007
    Location
    Boston, MA USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Paul beat me to it... hope it works.

Similar Threads

  1. program of Melanie
    By jonas2 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th October 2009, 10:03
  2. Re:The Truth about Chernobyl Via Melanie
    By emmett brown in forum Off Topic
    Replies: 1
    Last Post: - 15th August 2006, 08:25
  3. Making a .txt from a PIC Microcontroller? (Melanie may help)
    By hawk72500 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th October 2005, 04:19
  4. Melanie Olympic Timer -> Banner....scroll text...
    By jorge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th November 2004, 22:11
  5. Thanks to Toni and Melanie
    By Moldava in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd June 2004, 23:41

Members who have read this thread : 0

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