Newbie to pic but not electronics


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    67

    Default Newbie to pic but not electronics

    Hi I have stepped into the world of the pics

    basicly I have a knowledge of electronics but I just started out using pic micro controllers.

    I wanted to use a pic 16f84a to control leds and servos wirelessly

    now I know I need a transmitter and a receiver but for the programing what codes would be used to press a button or turn a potentiometer and have a servo move or leds turn on or do a sequence I programed for the leds or the servo.

    Would this have to be done through serial and if so is there any other ways?

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Check out Bruce's Website

    http://www.rentron.com

    or more specifically, pages like this

    http://www.rentron.com/ruf-bot.htm
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Thank you for replying but I did try that website already the ruf bot source code was not functional. I tryed entering it in microcode studio and it gave me a list of things that were wrong.

  4. #4
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    I'm sure you will hear this eventually from someone, so I might was well be the one to say it:

    Have you got just a simple LED blinking? Did you get it responding to your button? Have you got the PIC to read the POT and output the value in some way (like a LCD)? Have you been able to TX/RX serial over normal lines, like with a PC?

    Here is the point. As most of us have discovered, there is a bit of a learning curve, both with the hardware portion of PICs as well as the firmware. So start small. Take it a one part at a time. Once all the individual parts are functioning, start assembling the parts into a whole application to meet your needs.

    In this process you will get a lot of help from the folks on this forum.

    SteveB
    Last edited by SteveB; - 6th July 2007 at 20:54. Reason: Typo

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Techbuilder View Post
    Thank you for replying but I did try that website already the ruf bot source code was not functional. I tryed entering it in microcode studio and it gave me a list of things that were wrong.
    That 'ruf bot' code has been posted at that site for quite some time, and I don't think the author would intentionally leave it posted if it didn't work.
    So, since you are just beginning in PICs...
    Do you have a PIC programmer? Which one?
    Do you have PicBasic or PicBasicPro from MeLabs or one of their distributors? Which version?
    Which errors did Microcode Studio give you? Which version of MCS are you using?
    Have you built a plain ol' 'Blinky LED' type thing yet?
    Have you tried to build anything more complicated than that? More than one LED? Pushbuttons lighting LEDs? Pushbuttons controlling servo's?

    Don't try and tackle the whole thing at once from the get-go...you'll get discouraged and quit before you even get started... You didn't learn how to drive in a high-performance sports car...

    Break it down, simple stuff first, combine the simple stuff into not-so-simple stuff, then put it all together...

    EDIT: In other words, just what SteveB said (which I would've had notice had I bothered reading...)
    Last edited by skimask; - 6th July 2007 at 20:24. Reason: DOH!

  6. #6
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    I have done the blinking led and I own picbasic pro that I got from microengineering labs. My programmer I bought from ebay and I do not remember what errors I got since it has been months since I tried it.

    How do you know rentron didn't just put it on with out trying the firmware out?

    Who knows

    But anyway I don't get how reading the inputs work yet.


    Let's start simple say I wanted two leds to chase eachother

    I connect led 1 to RB0and led 2 to RB1

    and I guess I would connect the switch to RB2

    but would I have to read RB2 Input
    then send and output to RB0 and RB1 when RB2 makes contact?

    The PIC I am using is a 16F84A
    Last edited by Techbuilder; - 6th July 2007 at 21:06.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Techbuilder View Post
    How do you know rentron didn't just put it on with out trying the firmware out?
    And throw ANY credibility out the window? I don't think so... Besides, I've seen their work, I've used their products and software. Good stuff...

    But anyway I don't get how reading the inputs work yet.
    Let's start simple say I wanted two leds to chase eachother
    I connect led 1 to RB0and led 2 to RB1
    and I guess I would connect the switch to RB2
    but would I have to read RB2 Input
    then send and output to RB0 and RB1 when RB2 makes contact?
    The PIC I am using is a 16F84A
    Good example of how to use a button and the BUTTON command in Section 5.2 of the PBP manual. But that's probably too much for your example...
    To read a pin, you have to set it to an input (as the datasheet states), you may also need a variable to store the state of that pin so you can work with it elsewhere.

    input_pin var portb.2
    input input_pin
    temp var byte
    temp = input_pin

    Now "temp" has the state of PortB.2.
    Again, break it down to the simplest possible level...
    Write a program that reads the portb.2, and have the LED on portb.0 light up if the button on portb.2 is pressed, and the LED on portb.1 light if the button is released.

Similar Threads

  1. 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
  2. Replies: 14
    Last Post: - 26th September 2007, 05:41
  3. PIC to PC newbie
    By Michael in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 19th June 2007, 01:07
  4. PIC Newbie
    By azmax100 in forum Schematics
    Replies: 7
    Last Post: - 23rd February 2007, 04:52
  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