Simple program for 12F629


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Does 'blinky LED' work?

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

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

  4. #4
    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!!!!!!!

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

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    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 " !!!
    *****************************************

  7. #7
    Join Date
    Jun 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    I need to disable writing to external eeprom few secconds after power is applyed. So, GPIO.2 pin is connected to the WP pin of eeprom, and GPIO.0 pin have +5V when eeprom have +5V. Between VCC and MCLR is 4K7.

    I know this is very simply for most of you, but this is my first program, and it has practical purpose.

    Regards
    Last edited by rele; - 27th July 2008 at 13:12.

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


    Did you find this post helpful? Yes | No

    Default

    I think the point that skimask was trying to get over, is that for a 1st program, the main goal is to get the chip to flash a LED correctly, then go on to develope that.

    A golden rule here is to look at the datasheet, and then set the pic up accordingly. Often these small chips don't have their pins set to digital i/o by default, so need the config set accordingly.

    Once you have a bit of code that blinks an LED, then introduce inputs and modify the code to get the result you want.

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rele View Post

    I know this is very simply for most of you, but this is my first program, and it has practical purpose.

    Regards
    Hi,

    NOOOOOO ... nothing is simple !!!

    We still do not know what is connected to your Pic I/Os ...

    Just remember if hardware is False ... software can't work as expected !!! ... and vice versa.

    We must know everything of your project, if you want us to give a serious answer.


    Now, for some fun ...

    You ask for help...Ok, but you do not tell us even if it works ... How do you verify GPIO.2 works ( or doesn't work ! ) properly ???
    How do you drive GPIO.0 ???



    For the day,We do not use the crystal ball on this Forum ... so, you must do your "part of the work" of debugging, and tell us what's on your side ...

    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