Buttons are driving me nuts


Closed Thread
Results 1 to 4 of 4

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    TRISB configure i/o as input or output while PORTB is the place to read/write from/to.

    try...
    Code:
    <font color="#000000">        @ device pic16F648A, wdt_off, intrc_osc_noclkout, mclr_off, protect_off
            <font color="#000080">DEFINE </font>OSC 4
            CMCON = 7 <font color="#008000">' Turn all comparators to fully digital (needed??)
            </font>TRISB.3 = 0 <font color="#008000">' IR Output Pin
            </font>TRISB.4 = 1 <font color="#008000">' Shutter Input Pin
    
    </font>start:
            <font color="#000080">WHILE </font>PORTB.4 = 0 : <font color="#000080">WEND
            GOSUB </font>Shutter
            <font color="#000080">PAUSE </font>250 
            <font color="#000080">GOTO </font>start
            
    Shutter:
            <font color="#000080">HPWM </font>1,127,38500 <font color="#008000">' Configure HPWM for 50% duty cycle PWM signal at 38.5kHz
            </font><font color="#000080">PAUSE </font>500
            CCP1CON = 0      <font color="#008000">' PWM OFF
            </font><font color="#000080">RETURN
    </font>
    Steve

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

  2. #2
    Join Date
    Aug 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    Thank you SO much!

    I feel like an utter idiot for making that mistake.

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


    Did you find this post helpful? Yes | No

    Default

    I guess you will never do it again

    Don't worry about that, take your time, understand what you do, and enjoy the result.

    We are here to help anyway.
    Steve

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

Similar Threads

  1. In Circut Debug (ICD) buttons palet is disable for 18F2620
    By muskut in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th June 2010, 05:21
  2. destroying my last pic? driving a miniature motor
    By Michael Wakileh in forum Schematics
    Replies: 20
    Last Post: - 28th August 2007, 09:38
  3. Replies: 3
    Last Post: - 17th April 2007, 14:45
  4. Driving me NUTS!
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th October 2005, 15:06
  5. Driving a logic-level HEXFET
    By thelightbrain in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th November 2004, 23:34

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