12F629 beginning


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    12

    Question 12F629 beginning

    Hi you all again!

    Iīm already working with pics a little bit thanks to your help but didnīt work with these mcus for nearly a year.
    Iīm working with 16F628A and this is already ok for me, LCD text and frequency counters even
    digitally rev limiters for engines with two BCD rotary switches, works all fine.

    BUT: I need a little helper-program and donīt want to waste a 16F628 for this. The 12F629 could do just fine even without crystal etc. I just need one pin as Input and one as output for example for a LED.

    So what: I donīt even know how to start anything in PICBasic Pro (got the full version!!)
    for example something like blink.pbp .

    I can load a hex file into the PIC but i dont know how to adress the pins , start the intern oscillator . Thats for starters.

    hey donīt laugh that loud! iīm a mechanical by profession with just a few electrons in my veins.

    Thanks in Advance !

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


    Did you find this post helpful? Yes | No

    Default

    Configuration fuse : http://www.picbasic.co.uk/forum/showthread.php?t=543

    This one use GPIO instead of PORTA-PORTB
    TRISIO instead of TRISA-TRISB

    and you need to disable the analog comparator... same as 16F628 CMCON=7


    maybe the following would be enough to start
    http://www.picbasic.co.uk/forum/show...t=blink+12F629
    Steve

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

  3. #3
    Join Date
    Sep 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Smile Upgrade from Blinking

    Thanks Mister_e!
    The blink.pbp works with my 12F629 with pin 7 as output which is ok for me.

    Leaves one problem: I want to make for example pin 7 (GP0) output and pin 2 (GP5) Digital Input for frequency measure purposes. The program will switch the LED on when the input gets a lower than specified frequency . The program is no problem, just the PIN order.

    So theres one thing I see: I have to concentrate on a very small Number of different Pics to get used to them. My favorites: 12F629, 16F628A, 16F876A. That should do for the next years or so. Iīve learned the old school "two transistor 6-18V circuits" when I was 14. Thats 30 years ago. Now Iīm wriggling around sportscar engines and some electronics knowledge comes in handy you know.

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


    Did you find this post helpful? Yes | No

    Default

    I suggest you have a look to 12F683. Really nice one for a 8 pin device, PWM, A/D, Comparator and much more codespace.

    16F88 is also a nice one. Nice replacement for the 16F628

    16F88x are nice as well... OH well, hard to find my favourite... i had 50-60 different model before in stock. And Microchip seems to release a brand new model each week.
    Steve

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

  5. #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.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If that is all of your code it is stopping at the endif.

    Code:
    MAIN:    'Add this for a loop name.
    if gpio.1 = 1 then
    pulsout GPIO.0,10000
    else
    pulsout GPIO.0,2000
    
    endif
    GOTO MAIN    'Add this to start the loop again
    Dave
    Always wear safety glasses while programming.

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