Simple program for 12F629


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    8

    Default Simple program for 12F629

    Hello

    I need som help with this program.
    It should work like this: when power on, GPIO.2 is high. When I apply HI on GPIO.0, after 3 sec GPIO.2 should be low. Config is mclr=off, pwrt=on, wdte=on,boren=on, int OSC I/O.

    Here is the code

    CMCON=7

    ul var GPIO.0 'Define GPIO.0 pin as ul
    izl VAR GPIO.2 'Define GPIO.2 pin as izl

    High izl
    Input ul

    loop:
    if ul=1 then
    pause 3000
    low izl
    end if
    goto loop

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Does 'blinky LED' work?

  3. #3
    Join Date
    Jun 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Does 'blinky LED' work?
    I'm sorry, but I can't find 'blinky LED' example.

  4. #4
    Join Date
    Dec 2003
    Location
    Storrs, Ct.
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Code:
    ' Example program from manual to blink an LED connected to PORTB.0 about once a second
    
    loop:   High 0          ' Turn on LED connected to PORTB.0
            Pause 500       ' Delay for .5 seconds
    
            Low 0           ' Turn off LED connected to PORTB.0
            Pause 500       ' Delay for .5 seconds
    
            Goto loop       ' Go back to loop and blink LED forever
            End
    http://www.melabs.com/resources/samples.htm#pro


    Hope this helps..
    "It will never happen here!" just happened here.
    My thoughts and prayers for Sandy Hook victims and families.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rele View Post
    I'm sorry, but I can't find 'blinky LED' example.
    WOW!!!!!!!

  6. #6
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    WOW!!!!!!!
    I know its tough, but count to ten, take deep breaths and read Mels most http://www.picbasic.co.uk/forum/show...99&postcount=1

    If you look at his code, there is some logic in his thinking, he has made an attempt to write a program, which doesn't work, and thus came here seeking assistance...

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink Ladies and Gentlemen ... please

    Hi,

    First of all let's leave guns and knives outside ...

    Won't you think a little ( real ! ) SCHEME would be compulsory, here ???

    just to verify how and what to inputs and outputs are linked ...


    "my two cents"

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Simple Blink program doesnt work.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st March 2009, 20:30
  2. Help with simple program
    By mykewl in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st July 2008, 08:58
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. simple counting program - please help!!
    By john meiers in forum mel PIC BASIC
    Replies: 3
    Last Post: - 20th February 2006, 13:17
  5. Simple Interrupt Program
    By eoasap in forum General
    Replies: 5
    Last Post: - 28th October 2005, 16:22

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