12F629 beginning


Results 1 to 12 of 12

Threaded View

  1. #7
    Join Date
    Sep 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Question Input/Output 12F629

    ok, this works but I donīt know how to adress in and outputs of the 12F629

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* 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

    trisio.5 = 1 ' port5 is an input

    led1_status var bit
    button1 var gpio.5
    led1 var gpio.0

    main:

    if button1 = 0 then ' if the button is pressed

    led1_status = 0 ' make it 0
    pulsout GPIO.0,10000
    pause 50 'debounce

    else

    led1_status = 1 ' the last state was a 0 so now make it a 1
    pulsout GPIO.0,2000

    pause 50 'debounce

    endif
    goto main

    there has to be a simple straightforward command to define inputs and outputs

    what the heck is it? I know the tris option for the 16F628A which works fine but doesnīt seem to work for me on the 12F629..why? This looks like "I define one port and hope the others work somehow for me" what do I miss? the explanation in the picbasic pro handbook doesnt help a bit because it adresses only the bigger Pics
    Last edited by Davidpower; - 1st October 2007 at 19:02.

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