How do I program a pic to accept inputs?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    Hi, thank you Electromark for your time and your answer. I probably did not explain my self clear enough. I apology my English is not the best, it's my second language. Anyway, let me put it this way: you buy let say a coffee maker. First time you use it you must key in the time; when you want it to star brewing the coffee every morning; how do you like the coffee, light or bold and few other things. All of these instructions I supposed goes into the data eeprom or somewhere like that and the processor read these instructions and follow these every day until they are changed. I understand I'll need some extra electronics to do the job but that is part of learning this process. Only I need is someone that had that experience and lead me to books or places or his own knowledge on how to be able to accomplish this. Thanks a lot.

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


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    Seems like you just answered your own question... Do you need help with reading and writing to the EEPROM?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2012
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    Ok, that's a good start point! But any where to go on line? Any good book, Any program that does something alike. Thanks.

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


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    This page has links to examples for using the internal EEPROM and for using an external via I2C.
    Depending on the amount of data you need to store and the frequency will probably determine if you use an internal or external solution.

    I will suggest starting with the internal for practice.
    http://melabs.com/samples/PBP-mixed/ee.htm
    and
    http://melabs.com/samples/PBP-mixed/eeword.htm

    Once the examples are working then add an input button. Try increasing the data stored at a location by 1 every time the button is pressed.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2012
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    Thank you Mackrackit, now I can get the taste of it. I also have found some other examples and I think that that's the way to go. I'll report back. Thanks to all of you!

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


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    I would ask you what your expectations are for your controller to do. Do you want it to interpret G code, or do you only expect it to act as a stepper motor controller/interpreter under the control of Mach III or similar?
    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.

  7. #7
    Join Date
    Nov 2012
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Re: How do I program a pic to accept inputs?

    No, I think that once I have the control program burned on the Pic it will control the projector and the stepper motor with pulses from within. The projector will need a digital pulse to advance the slide show for a number of milliseconds and the controller will count the slides to 0 and stop. The stepper motor will control the thickness of every slice and keep the resin in motion. I wanted to write the initial numbers at the eeprom en case the power is lost the program will read the number of slices and subtract a unit every time it read it and remember the thickness also. One print will take hours to make and you don't want to trash an almost finished part because of power failure. The program will have that contingency on it. I think the rest will be very easy once I finished the programming and test it for bugs. Thanks

Similar Threads

  1. Single PIC to Blink 5 LEDs Independently?
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 68
    Last Post: - 18th July 2015, 17:56
  2. Replies: 7
    Last Post: - 20th November 2012, 20:41
  3. Which pic? up to date basic chip for 16f877
    By tasmod in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th November 2012, 12:26
  4. How not to prototype your next PIC project
    By SteveB in forum General
    Replies: 3
    Last Post: - 12th November 2012, 10:35
  5. PortA as Inputs in PIC16F628A program
    By JackBauer2424 in forum mel PIC BASIC
    Replies: 12
    Last Post: - 1st June 2006, 09:34

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