586,047 active members*
3,896 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > PIC Programing / Design > New to PICs, stuck, and need help
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2005
    Posts
    2

    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
    Join Date
    Dec 2003
    Posts
    24221
    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.
    CNC, Mechatronics Integration and Custom Machine Design

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

  3. #3
    Join Date
    Mar 2005
    Posts
    523
    oops

  4. #4
    Join Date
    Mar 2005
    Posts
    523
    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 pic8.jpg  

  5. #5
    Join Date
    Mar 2005
    Posts
    18
    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. #6
    Join Date
    Mar 2005
    Posts
    523
    thanks mk .
    i don't know how that happened. attachment corrected

  7. #7
    Join Date
    Jul 2005
    Posts
    2
    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. #8
    Join Date
    Mar 2005
    Posts
    18
    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. #9
    Join Date
    Jun 2005
    Posts
    87
    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. #10
    Join Date
    Aug 2005
    Posts
    52
    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, 04:48 PM
  2. VFD installation with pics
    By Swede in forum Phase Converters
    Replies: 36
    Last Post: 12-07-2006, 12:21 AM
  3. Some pics from my fun-fly
    By cncadmin in forum Community Club House
    Replies: 12
    Last Post: 08-09-2004, 01:48 PM
  4. 7TH Sojourn pics please
    By wedge in forum DIY CNC Router Table Machines
    Replies: 9
    Last Post: 06-13-2004, 06:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •