12F629 beginning


Results 1 to 12 of 12

Threaded View

  1. #5
    Join Date
    Sep 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Unhappy Damn input

    Hi Guys,

    my program shows a flaw but i dont know where.

    depending on the press of a button at GPIO.1 a led should flash defferent at GPIO.0.

    ************************************************** **************
    '* Name : Blink4.pbp *
    '* Author : [select VIEW...EDITOR OPTIONS] *
    '* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 26.09.2007 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    @ DEVICE pic12F629, INTRC_OSC_NOCLKOUT ; System Clock Options
    @ DEVICE pic12F629, WDT_ON ; Watchdog Timer
    @ DEVICE pic12F629, PWRT_ON ; Power-On Timer
    @ DEVICE pic12F629, MCLR_OFF ; Master Clear Options (Internal)
    @ DEVICE pic12F629, BOD_OFF ; Brown-Out Detect
    @ DEVICE pic12F629, CPD_OFF ; Data Memory Code Protect
    @ DEVICE pic12F629, PROTECT_OFF

    DEFINE OSCCAL_1K 1' Set OSCCAL for 1k
    cmcon = 7 ' Comparator OFF


    TRISIO = %11111110 ' Set GPIO 0 as output 1-4 as input

    if gpio.1 = 1 then
    pulsout GPIO.0,10000
    else
    pulsout GPIO.0,2000

    endif

    I missed something, but dunno what. The led reacts at the first command line, whether theres a gpio.1 = 1 or gpio.1 = 0
    but never at the button itself. it doesnīt find the input.

    HELP!
    Last edited by Davidpower; - 27th September 2007 at 22:01.

Similar Threads

  1. 12f629 config settings
    By Dennis in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st December 2009, 22:39
  2. Basic help for 12F629
    By Gene Choin in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd September 2009, 04:06
  3. Servo control with 12F629
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd June 2005, 23:34
  4. Program returns to beginning at interupt
    By BGreen in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th April 2005, 11:20
  5. 12F629 I2C problems
    By AIW128ProGuy in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th November 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