Pic 12F509??


Closed Thread
Results 1 to 7 of 7

Thread: Pic 12F509??

  1. #1

    Default Pic 12F509??

    Hello all i am a newbie here,

    well i have been given this schematic as a challenge (attached)
    i have no previous experience writing in program for pics
    my assignment was to write a program that would turn the motor on for 6 sec
    if the switch was pressed.

    how would i go about starting this?????
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Welcome.

    No experience at all...
    Lets start off by finding out what too;s you have to work with.

    Programmer?
    Pic Basic or Pic Basic Pro?
    Do you have MPLAB installed?

    We normally like to start folks off with an LED blinking program, but yours also looks like a good one to start with.

    One of the first things you need to understand is how to configure the PIC.
    This thread will help you there.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    And this is useful.
    http://www.picbasic.co.uk/forum/showthread.php?t=555

    The basic code for you app.
    Code:
    LOOP:
    IF PORTx.x = 1 THEN   'Switch pin
    HIGH PORTy.y    'Motor pin
    PAUSE 6000
    LOW PORTy.y
    ELSE
    LOW PORTy.y
    ENDIF
    GOTO LOOP
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Wink KISS method ...

    Hi, Northdelights

    First of all, Welcome here.

    I remember having built such a circuit 10 years ago ( goal was to power a soap pump for 3 secs ... more if finger kept on button ) with a single 555 timer as a monostable multivibrator.

    As the case is the same ... you can make the 555 look like a pic ...

    honour will be saved ...

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

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Welcome.

    No experience at all...
    Lets start off by finding out what too;s you have to work with.

    Programmer?
    Pic Basic or Pic Basic Pro?
    Do you have MPLAB installed?

    We normally like to start folks off with an LED blinking program, but yours also looks like a good one to start with.

    One of the first things you need to understand is how to configure the PIC.
    This thread will help you there.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    And this is useful.
    http://www.picbasic.co.uk/forum/showthread.php?t=555

    The basic code for you app.
    Code:
    LOOP:
    IF PORTx.x = 1 THEN   'Switch pin
    HIGH PORTy.y    'Motor pin
    PAUSE 6000
    LOW PORTy.y
    ELSE
    LOW PORTy.y
    ENDIF
    GOTO LOOP



    Thank you dave for the advice and for also providing the code for me that was kind of you.
    Ill look into it alittle more to determine how you get there and how label each pin

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hello northdlights,
    Welcome,
    Here are some links that are really going to be "assigned reading" because you absolutely need to know this. You would do well to avail yourself of all the links in the <b>FAQ</b> section available from the forum home page. Probably the most difficult thing to learn is how to interpret the data sheets
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    When you go to the FAQ section you may need to set the Display Options at the bottom of the page to show threads from the beginning.
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Hello northdlights,
    Welcome,
    Here are some links that are really going to be "assigned reading" because you absolutely need to know this. You would do well to avail yourself of all the links in the <b>FAQ</b> section available from the forum home page. Probably the most difficult thing to learn is how to interpret the data sheets
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    Hi joe

    thanks for the links,
    yeah i had gotten a start at the data sheet and it gets me lost i have to read it about two times to connect the dots

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. PIC 12F509 begins to heat at power up
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 25th July 2009, 12:11
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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