Can't get blink circuit to work :(


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    67

    Default Can't get blink circuit to work :(

    Hi
    I was hoping someone can help me with this.

    I want to start using pics but I can't even get my blink circuit to work.

    I have PIC basic pro
    and I use micro code studio.

    My programmer is from ebay

    I have knowledge in electronics but little knowledge in Micro controllers.

    So I have done my board over and over again and nothing no led blinking

    I have tried this

    @ DEVICE pic16F84, XT_OSC

    @ DEVICE pic16F84, WDT_OFF
    ' Watchdog Timer

    @ DEVICE PIC16F84, PWRT_ON
    ' Power-On Timer

    DEFINE OSC 4


    TrisB = %00000000 ' Sets all bits portb as outputs

    loop:
    High PORTB.0 ' Turn on LED connected to PORTB.0
    Pause 1500 ' Delay for 1.5 seconds

    Low PORTB.0 ' Turn off LED connected to PORTB.0
    Pause 1500 ' Delay for 1.5 seconds

    Goto loop ' Go back to loop and blink LED forever
    End


    and this

    ' Example program to blink an LED connected to PORTB.0 about
    ' once a second

    loop:
    High 0 ' Turn on LED connected to PORTB.0
    Pause 500 ' Delay for .5 seconds

    Low 0 ' Turn off LED connected to PORTB.0
    Pause 500 ' Delay for .5 seconds

    Goto loop ' Go back to loop and blink LED forever
    End


    and nothing

    I have re done my circuit over and over again and nothing

    On my bread board I didn't use any filters on the 78L05
    would that really matter and not make it blink?

    Ps: the pictures of my programmer software and settings they are on are in the attachments
    Attached Images Attached Images   
    Last edited by Techbuilder; - 20th January 2008 at 03:48. Reason: Forgot to add something

  2. #2
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile Some things to check...

    Hi Techbuilder,

    1) Do you have a resistor pull-up on PIC MCLR to Vdd (+)?

    2) Are you using a PIC16F84 (as written in the code) or a 16F84A (as listed in your programmer jpg)?
    There is a big difference between the PIC16F84 and the PIC16F84A to the compiler, software, and programmer.

    3) You should have a capacitor at the input to the regulator if the unregulated filter capacitor is over three inches away from it.

    4) Do you have a 4 MHz crystal with capacitors to ground or a ceramic resonator with center tap to ground on the osc pins?

    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  3. #3
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Yep I have a resistor there

    Yep I have a 16F84A

    As for the 78L05 That doesn't have a cap
    but can it stop the circuit from working?

    I have a 4mhz resonator with the middle going to ground

  4. #4
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile More stuff...

    Quote Originally Posted by Techbuilder View Post
    Yep I have a resistor there

    Yep I have a 16F84A

    As for the 78L05 That doesn't have a cap
    but can it stop the circuit from working?

    I have a 4mhz resonator with the middle going to ground
    The “DEVICE” in your code is listed as a “@ DEVICE pic16F84

    See this thread:
    Novice 16F84A BLINK LED program help
    http://www.picbasic.co.uk/forum/showthread.php?t=6763

    The 78L05 or any three terminal linear regulator needs an “input capacitor”, if it is a distance from the rectifier filter capacitor.
    If you don’t have a rectifier filter capacitor, THAT is a problem.

    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  5. #5
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Ohh opps even when I reprogrammed it still nothinghttp://www.picbasic.co.uk/forum/images/icons/icon9.gif
    Unhappy

    The link you gave me was different from mine.

    His at least turned on

    mine doesn't even do that

    Shouldn't the sample program work from pbp?

  6. #6
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile don’t give up...

    Quote Originally Posted by Techbuilder View Post
    Ohh opps even when I reprogrammed it still nothinghttp://www.picbasic.co.uk/forum/images/icons/icon9.gif
    Unhappy

    The link you gave me was different from mine.

    His at least turned on

    mine doesn't even do that

    Shouldn't the sample program work from pbp?
    Hi Techbuilder,

    You are right, the other poster had a slightly different problem, with the PIC16F84A not blinking correctly, than you have.
    But, if you could read some of the parts that MIGHT apply to your general problem, that would save the people trying to help, from repeating the same information.
    It is a little easier to read than to type, and it is the reader needing the information not the person helping. This reduces the burden on the people helping, so that they do not get burned out and stop trying to help.
    In fact it is considered good forum practice to search diligently, for any answered problem, that could contain a clue, before asking.

    Some of the parts that MIGHT apply:
    But, you may be trying too hard. Most of the defines are already supplied by the default *.INC file (16F84A.INC).
    In Microcode Studio make sure you are using the button for Compile(ing) AND Program(ing), NOT the button for just Compile(ing).
    See this microEngineering Labs web page:

    Specifying configuration bit settings in PICBASIC PRO programs.
    If you add a configuration directive to your program file, you are actually replacing the default configuration that the compiler would otherwise include. The easiest way to determine the correct syntax is to get examples from the compiler and assembler's built-in resource files. To that end, it's best to understand how the compiler determines the config defaults....

    ....The first thing the compiler looks for is a file in the PBP folder that matches the targeted PIC. If you tell it to compile for a 16F84A, it reads the file "16F84A.INC". The contents of this file are divided into 2 sections, one for each assembler. An internal variable, "PM_USED", tells the compiler which section of the file to use. In the following example, you will see that the top section ("ifdef" to "else") is meant for the PM assembler and the bottom section ("else" to "endif") is meant for the MPASM assembler.

    http://www.melabs.com/support/config_defaults.htm
    This might mean that if you refer to a different device in your code, compiler or programmer, you may run into trouble.

    Let us know if you have tried any of our posted suggestions.
    Did you add the capacitor to the 78L05?
    Did you change the DEFINES in your code to @ DEVICE pic16F84A

    The sample PBP program should work for your project, don’t give up.

    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  7. #7
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    Hi Techbuilder,

    1) Do you have a resistor pull-up on PIC MCLR to Vdd (+)?

    2) Are you using a PIC16F84 (as written in the code) or a 16F84A (as listed in your programmer jpg)?
    There is a big difference between the PIC16F84 and the PIC16F84A to the compiler, software, and programmer.

    3) You should have a capacitor at the input to the regulator if the unregulated filter capacitor is over three inches away from it.

    4) Do you have a 4 MHz crystal with capacitors to ground or a ceramic resonator with center tap to ground on the osc pins?

    -Adam-

    A capacitor between the output of the regulator and ground is *very* important to stop the device oscillating at high frequency. Try a value of 100nF.

    Andy

  8. #8
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Andy Wood View Post
    A capacitor between the output of the regulator and ground is *very* important to stop the device oscillating at high frequency. Try a value of 100nF.

    Andy
    Would that be necessary though if I used a power supply instead of a voltage regulator?

  9. #9
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Also,

    How did you connect your LED to PORTB.0 ?

    Usually, people make simple mistakes about it, and connect it WRONG.

    ___________________________________
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  10. #10
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Well I connected it the positive side to PortB and connected the other side to ground.

    If I didn't use a resistor would that stop the circuit from working just wondering?

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Techbuilder View Post
    Hi
    I was hoping someone can help me with this.

    I want to start using pics but I can't even get my blink circuit to work.

    I have PIC basic pro
    and I use micro code studio.

    My programmer is from ebay
    Hi Techbuilder,
    ebay programmer is not too descriptive, which one, which software are you using. I use the cheapest ebay programmer, a JDM clone with Ponyprog(free). It came bundled with winpc or winpic, I do not remember, only that I couldn't get it to work with that programmer, although it rang all the bells and blew all the whistles . . . my point is , maybe you really are not programming the PIC at all. After programming, read the program back and see if it is there, if not maybe you are not connected to the port your programmer thinks it is.
    Now if you are programming, then next check your hardware, use a DVM, VOM or VTVM, an led or any other suitable method to check the pin connection of your PIC to the wires you have pushed into the proto board, I have been tripped up numerous times due to defective proto boards, after taking one apart I understood why, wear and corrosion made the connections bad.
    JS
    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.

  12. #12
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    I did read it I found some parts useful

    I haven't got the chance to get the capacitors but I used my friends variable power supply and adjusted it to 5 volts and still nothing.

    As for my programmer software

    It's Micro Pro

    I don't know if you had seen the picture attachments of the screen shots I did but that is how it looks.

    It's K149-BC

    I don't if that matters but that is what model it is

    I can't compile and program because It doesn't download the new hex file I created
    gary goddard had went through this problem that I had.

    The solution is to compile then go into the programmer software and load the hex file.

    I believe it's programming though because it's reading from the pic

  13. #13
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default Yay!!!!!!!!!!!!

    I got it to work!!!

    You guys are the best and females (if there are any)



    Cool now I can start some projects

  14. #14
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Techbuilder View Post
    ...and females (if there are any)
    ...
    I know one so far.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Talking

    Hi, Sayzer

    Quote Originally Posted by sayzer View Post
    I know one so far.
    We suspected it a bit ... AND, Of course it is yours !!!

    But do not worry ... we all say "she" 's the one, even under torture !

    She also always claim "he" 's the one ... buuuut, never tells who is "he" !!!

    Have a nice day ... LOL.

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

  16. #16


    Did you find this post helpful? Yes | No

    Default What was the problem?

    fried LED?
    unfiltered regulator?

    curious minds would like to know..
    (as well as the next person with the same/similar problem)


  17. #17
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Sayzer



    We suspected it a bit ... AND, Of course it is yours !!!

    But do not worry ... we all say "she" 's the one, even under torture !

    She also always claim "he" 's the one ... buuuut, never tells who is "he" !!!

    Have a nice day ... LOL.

    Alain

    Alain,

    Are you saying what I think you are saying about her?

    "She" is actually an imaginary person then, isn't she?


    _____________________
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by sayzer View Post
    Alain,

    Are you saying what I think you are saying about her?

    "She" is actually an imaginary person then, isn't she?


    _____________________
    YESSSS, of course ...

    All the women we're in love with are imaginary persons .... Thanks to god !!!

    re- LOL

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

Similar Threads

  1. Simple Blink program doesnt work.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st March 2009, 20:30
  2. Can't get POT work on P12f675 - Newbie
    By berslan in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th March 2008, 21:22
  3. Circuit reliability issues
    By hkpatrice in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd November 2007, 14:55
  4. Replies: 3
    Last Post: - 29th October 2006, 09:16
  5. Pin RA4 doesn't work
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 15th July 2004, 12:03

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