Results 1 to 10 of 10

Thread: New to PICs, stuck, and need help

  1. #1
    Registered
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    2
    Downloads
    0
    Uploads
    0

    New to PICs, stuck, and need help

    A friend and I were trying to do some very basic things with a couple of 18f452 PICs, like make an LED flash etc and we are now stuck. We programmed it with a simple loop program that turns a port on and off (to make an LED on one of the port's pins flash) and connected a 20MHz resonator with two 22pF capacitors for the oscillator circuit, across OSC1 and 2. Our power source is about 5V but probably has about 2V error.
    The first time we tried it, it worked perfectly. But after that every single thing we've done including using the same LED program has resulted in failure.
    The programmer software has stuff about fuses and as we are new to PICs and applied electronics generally we have no idea what to do. If someone could explain how durable PICs are and how badly they respond to static, varying voltages, anything else that us newbies should be looking out for, we will be seriously grateful! So far its been really frustrating. Thanks!


  2. #2
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,942
    Downloads
    0
    Uploads
    0
    You have to watch out for alot of the PIC series RA4 is an open-collector output, which means it can SINK current, but not source it, and RA5 is input only.
    Also 2v variation on your supply is too much, you should really use a regulated supply from a 7805 or similar.
    Al.
    Last edited by Al_The_Man; 07-14-2005 at 07:20 PM.
    CNC, Mechatronics Integration and Custom Machine Design (Skype Avail).

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  3. #3
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    509
    Downloads
    0
    Uploads
    0
    oops
    Last edited by smarbaga; 07-13-2005 at 10:36 PM.


  4. #4
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    509
    Downloads
    0
    Uploads
    0
    you may want to purchace some of the cheap 8 pin pics to play with untill you get familiar with there general opperation.
    if they fry ... well its no biggie ,
    to transfer the code into bigger ones is a simple task,
    and they are always handy to have around to stick in small places.
    attached is a general setup.
    THANKS . and Sorry ... didn't notice the + and - were reversed on the attachment .
    this attachment is correct.
    Attached Thumbnails Attached Thumbnails New to PICs, stuck, and need help-pic8.jpg  
    Last edited by smarbaga; 07-14-2005 at 08:18 PM. Reason: mistake


  • #5
    Registered
    Join Date
    Mar 2005
    Location
    Sweden
    Posts
    18
    Downloads
    0
    Uploads
    0
    NO NO NO big time!

    smarbaga, Vdd and Vss are reversed on your attached PIC. Please correct it, before people get confused!

    Vdd is +5V
    Vss is 0V

    How to fry a PIC in 5 sec:

    * Reverse Vdd and Vss
    * Exceed absolute maximum voltage (found in datasheet)
    * Ground pins that are set to be high(+5V) and outputs. Default (at boot) is input on most PIC's.


  • #6
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    509
    Downloads
    0
    Uploads
    0
    thanks mk .
    i don't know how that happened. attachment corrected


  • #7
    Registered
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    2
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by mk2lehe
    * Ground pins that are set to be high(+5V) and outputs. Default (at boot) is input on most PIC's.
    I don't understand what you mean about ground pins in the first sentence, could you please explain?
    Thanks a lot for the advice though. I will try some 8 pin pics.
    Incidentally, how do you know when you've fried your pic?
    And as I asked before, are pics that sensitive to static from touch? Do I REALLY have to wear some sort of antistatic device while handlign them?


  • #8
    Registered
    Join Date
    Mar 2005
    Location
    Sweden
    Posts
    18
    Downloads
    0
    Uploads
    0
    One of your first projects should be something like blinking a led. In order to accomplish this, the pin used to do this has to be made an output, so it can shift state from hi (+5V) to low (0V = ground = GND etc etc) and reversed.
    If the program sets an ouput pin high (+5V), and it is directly connected to 0V, a LARGE current will flow inside the PIC (from +5V side to 0V), which in turn generate so much heat locally that the PIC eventally will be destroyed. This of course applies to the reversed condition (output connnected to +5V and pin set low = 0V)

    Regarding static issues - in the real world, among hobbyists, my guess is most people never even seen a antistatic bracelet. But don´t get me wrong, static will kill PIC, just use common sense and keep your PIC away from static things such as your cat, carpets and so on and you will be fine. Verify your PIC after you program it. Spouradic errors, which never used to occur in the past, means the PIC is on its way.


  • #9
    Dream outside the Box frog's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    94
    Downloads
    0
    Uploads
    0
    Make sure all your connections to the pic are good if it worked then your program has been downloaded correct look at if it is a 16f84 look at vss vcc and mclear line make sure there is 5 volts on mclear and vcc make sure vss is grounded as far as static it is important probably not your problem at this point dont touch the pins make sure you are not wearing any type clothing to contribute to static charge there are cheap meters at rshack that have freq on them us on of these to check the oscillator also if it is set up for internal or external osc and the fuses need to left alone when you burn a fuse this is to code protect I did it the first time but does not mess up chip just cant read program or reprogram I am just a hobbiest been messing with pics for 4 years. hope this helps


  • #10
    Registered
    Join Date
    Aug 2005
    Location
    U.S.A
    Posts
    52
    Downloads
    0
    Uploads
    0
    Neidlm did not talk about connecting the MCLR pin to +5volts with a pull-up resistor or installing a current limiting resistor on the LED in his original email.


  • Similar Threads

    1. Mazak 8G M/C,mazatrol eia-t, z axis stuck
      By imwllc in forum Mazak, Mitsubishi, Mazatrol
      Replies: 7
      Last Post: 09-07-2009, 11:48 AM
    2. VFD installation with pics
      By Swede in forum Phase Converters and VFD
      Replies: 36
      Last Post: 12-06-2006, 06:21 PM
    3. Some pics from my fun-fly
      By CNCadmin in forum CNCzone Club House
      Replies: 12
      Last Post: 08-09-2004, 08:48 AM
    4. 7TH Sojourn pics please
      By wedge in forum DIY CNC Router Table Machines
      Replies: 9
      Last Post: 06-13-2004, 01:37 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.