The PIC does not start its program.


Closed Thread
Results 1 to 37 of 37
  1. #1
    Ted's's Avatar
    Ted's Guest

    Lightbulb The PIC does not start its program.

    I assembled my new pic 16f628a circuitry. The PIC does not start its program.

    My checklist:

    Voltage: +5V Pin 14, Mass Pin 5 OK
    Osc 20Mhz quarz: Pin 15 and Pin 16 OK - I only have a multimeter, so what I found is that values change between 0 and +5V, I assume a sine wave.
    Program: PIC is being programmed well according to software. As usual.

    PIC Program
    Code:
    @ DEVICE MCLR_OFF
    @ DEVICE hs_osc
    @ DEVICE wdt_off
    @ DEVICE lvp_off
    @ DEVICE protect_off
    
    Define OSC 20
    INTCON = 0
    CMCON = 7
    TRISB = %00100100
    TRISA = %11111100
    
    LED_Kalib VAR PORTB.7
    LED_Halb VAR PORTB.4
    LED_Voll VAR PORTB.6
    LED_Besch VAR PORTA.0
    LED_OK VAR PORTB.0
    
    Low LED_Kalib
    Low LED_Halb
    Low LED_Voll
    Low LED_Besch
    Low LED_OK
    High LED_Kalib
    High LED_Halb
    High LED_Voll
    High LED_Besch
    High LED_OK
    Pause 500
    Low LED_Kalib
    Low LED_Halb
    Low LED_Voll
    Low LED_Besch
    Low LED_OK
    Anything missing in the checklist? Any ideas on how to solve the issue?
    Last edited by Ted's; - 26th July 2008 at 20:18.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    So, you're switching on 5 LED's then switching them off again. That routine will run only once, and in fairness, there is in theory only half a second between the ON and OFF sequence. Do you have 5V on the MCLR pin?

  3. #3
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    There is a 22kOhms resistor from +5V to RA5 and from RA5 to Mass is a push-button. So without pressing the button it is +5V. But that shouldn't be important because of "@ DEVICE MCLR_OFF".

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


    Did you find this post helpful? Yes | No

    Default

    You might try using upper case letters in those DEVICE STATEMENTS and DEFINE. http://www.picbasic.co.uk/forum/showthread.php?t=558
    Last edited by Archangel; - 26th July 2008 at 22:44.
    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.

  5. #5
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    I did. This did not change anything.

    I used this code before and it worked with exactly this chip.

    I replaced the pic and it still did not work.

    Do you know a better way of measuring the pic's quarz using a multimeter? I presume that having a 20Mhz Quarz is way out of this device's possibilities.
    Last edited by Ted's; - 26th July 2008 at 23:18.

  6. #6
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    *deleted****
    Last edited by Ted's; - 26th July 2008 at 23:19.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Get back to basics...
    For on thing...

    Code:
    .......DEVICE statements, PIC Setup statements etc.
    All LEDs are set OFF
    All LEDs are set ON
    Wait for 1/2 second
    Turn all LEDs all
    It runs one time, and one time only. Don'tcha think it would be better to continuously blink the LEDs so you have time to probe around and see what's going on?
    Code:
    @ DEVICE MCLR_OFF
    @ DEVICE hs_osc
    @ DEVICE wdt_off
    @ DEVICE lvp_off
    @ DEVICE protect_off
    Define OSC 20
    INTCON = 0 : CMCON = 7 : TRISB = %00100100 : TRISA = %11111100
    LED_Kalib VAR PORTB.7 : LED_Halb VAR PORTB.4 : LED_Voll VAR PORTB.6
    LED_Besch VAR PORTA.0 : LED_OK VAR PORTB.0
    main: Low LED_Kalib : Low LED_Halb : Low LED_Voll : Low LED_Besch : Low LED_OK
    pause 500
    High LED_Kalib : High LED_Halb : High LED_Voll : High LED_Besch : High LED_OK
    Pause 500
    goto main
    END

  8. #8
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Not right now, skimask.

    The issue is that the pic is not even starting its programme.

    I want to give you more information. When voltage is being applied to the circuitry, these levels are given on the pic's socket:

    RA3 = Undefined, Floating
    RA4,RA5,RB2,Vdd,RB5 = 5.01 Volts
    RA7,RA7 = OSC

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Not right now, skimask.
    The issue is that the pic is not even starting its programme.
    I want to give you more information. When voltage is being applied to the circuitry, these levels are given on the pic's socket:
    RA3 = Undefined, Floating
    RA4,RA5,RB2,Vdd,RB5 = 5.01 Volts
    RA7,RA7 = OSC
    That's EXACTLY the issue. If you break it down into it's simplest form, you can probe around, put parts in, pull parts out, play around, without worrying about anything.
    And again, YOUR program only execute ONE TIME. Are you going to sit there and keep pressing RESET while you mess around trying to probe?

  10. #10
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Do you recommend soldering on a running system?

    To me it is about what is given the first time when voltage is being applied. Or will it work if I replace the quarz while there is already voltage applied to vdd and vss? I doubt so.
    Last edited by Ted's; - 26th July 2008 at 23:42.

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Do you recommend soldering on a running system?
    If it's only 5v and you've only got a PIC, an LED, a resistor, and the rest of the glue that goes with, sure...why not?

  12. #12
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    It is not. Just look at the voltage levels being applied. There need to be outside devices which apply the voltage to the pic.

    skimask, the main issue is that the device is not starting. I want to solely focus on that.

    I know four main error sources: The pic's hardware, the pic's software, the quarz and voltage applied to vdd and vss.

    Right now I suspect the quarz to be faulty.
    Last edited by Ted's; - 26th July 2008 at 23:47.

  13. #13
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    It is not. Just look at the voltage levels being applied. There need to be outside devices which apply the voltage to the pic.
    skimask, the main issue is that the device is not starting. I want to solely focus on that.
    I know four main error sources: The pic's hardware, the pic's software, the quarz and voltage applied to vdd and vss.
    Right now I suspect the quarz to be faulty.
    Ok, fine. Let us know what you did to troubleshoot the problem and what you did to fix it.

  14. #14
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    I replaced the quarz -> No change.

    I saw some soldering issues, fixed them and connected some solder points with others having the same potential via wire to make sure that there are no facers. I measured using my multimeter and the connection was there. I switched on and again, nothing.

    For other measurements refer to my previous posts in this thread.

  15. #15
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Some photos of the setup. Quarz currently removed.
    Attached Images Attached Images     
    Last edited by Ted's; - 27th July 2008 at 08:07.

  16. #16
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Some photos of the setup. Quarz currently removed.
    Wow! A bit of a mess to contend with...
    Are you sure you don't have any unseen solder bridges anywhere?
    Are you sure you don't have any open traces anywhere?
    I see a LOT of little solder balls floating around the circuit board. Any shorts?
    Invest in a small brush and some 'rubbing alcohol' and clean up that PCB.
    How do you program the PIC? How do you know that you are actually programming the PIC?
    Does it read back with the same code you programmed it with?
    Have you even considered changing the program to the one I suggested? Or are you still running the same 'one-shot' 'turn the leds on once then turn them off' program?
    Do you have a decent cap across Vdd and Vss on the PIC itself?
    Is the power supply stable enough? Does it rise to +5v smoothly? Does Vpp come up to +5v before Vdd?
    Do you have a 'solderless breadboard' to pull the PIC out of that circuit board and try it elsewhere?
    Is the PIC installed in the correct orientation?

  17. #17
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    How do you program the PIC? How do you know that you are actually programming the PIC?
    Does it read back with the same code you programmed it with?
    Exactly. I worked fine so far therefor there are no issues here.

    Have you even considered changing the program to the one I suggested? Or are you still running the same 'one-shot' 'turn the leds on once then turn them off' program?
    Yes, I have already considered your program and I decided to stick to my program.

    Do you have a decent cap across Vdd and Vss on the PIC itself?
    I just connected a 100nF capacitor in between Vdd and Vss. Nothing.

    Is the power supply stable enough? Does it rise to +5v smoothly? Does Vpp come up to +5v before Vdd?
    I am using a 13.8 volts dc regulated power supply aswell as 3 times 7805. One 7805 for the pic itself and two parallel for other items like leds.

    Do you have a 'solderless breadboard' to pull the PIC out of that circuit board and try it elsewhere?
    Yes. I just did. It is working there.

    Is the PIC installed in the correct orientation?
    Yes.

  18. #18
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Yes, I have already considered your program and I decided to stick to my program.
    And that, along with reading your previous posts, tells me that you are so sure of yourself that you can also figure it out yourself...because rewriting that program could take as much as 2 minutes, and you don't wish to spend that time to help solve your problem.

    Yes. I just did. It is working there.
    And that tells me that you are so sure of your hardware that you can find your own opens and shorts...which judging from those pictures, there are probably more than one of each faults floating around in there somewhere. But you'll most likely never find it by running that 'single shot' program of yours.

    I...am...out...

  19. #19
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Jeez, go get your lollipop or soother.
    Last edited by Ted's; - 27th July 2008 at 10:42.

  20. #20
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    Jeez, go get a lollipop.
    I'll get a truckload of lollipops...and I'll eat them...all of them...while I await your 'solution' to your 'problem'. And worry not! I'll brush after each one to keep away the tooth decay.

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


    Did you find this post helpful? Yes | No

    Default

    Egads! You must be using lead free solder to get results like that. Funny thing about tin is it grows whiskers. Do you have a 3 terminal resonator ? At this point I would probably bend the 2 legs of the PIC associated to the OSC. and attach them to a resonator with a point to point ground wire, or use an external OSC. Check the 2 pins of the board with PIC removed for capacitance, I would bet it is loading down the PIC's OSC until it does not work. Why would it run once ? Maybe in initializing it gets more power than after it starts. I am thinking there is such low impedance on the OSC circuit that it does not run.
    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.

  22. #22


    Did you find this post helpful? Yes | No

    Exclamation I would try......

    Get some breadboard and stick your PIC on that. Your circuit MAY have worked before, but solder dries up after a while. It may be worth your while re-soldering (neatly) every join you've made on that board and starting again. The circuit you want to build......it's SOOOOOO easy, but you have made it sooooooo complicated.
    TRY the following. With your multimeter check the outputs on PORTB.7 , PORTB.4, PORTB.6, PORTA.0, PORTB.0, PORTA.5, but check them ON THE CHIP. This will discard hardware error. If your PIC is programmed as per previous posts, then you will get 5V on these outputs - albeit for just half a second. It may be worth your while making that program a loop so your LED's oscilate between OFF and ON and not just ON for 500mS. That really doesn't help you none.

    IF you have 5V on all those pins above, your PCB needs to be re-done. It may work for programming, but...........

    IF you have breadboard, then do the following. 5V on pins 4 and 14, GND on pin 5, your XTAL on pins 15 and 16, the ANODE of your LED's on PINS 13, 12, 4, 17 and 6, the CATHODES connected to GND via a 4k7 resistor. You will need nothing else for this to work (for now). Don't bother with your reset switch just yet. Get the basics going first.





    AND SKI, it's not just the sugar that will decay your teeth, the acid from your saliva will eat through the enamal and calcium, so use a calcium replacing toothpaste. I personally like the green lollipops best
    Last edited by gringobomba14; - 27th July 2008 at 10:49.

  23. #23
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    The circuit you want to build......it's SOOOOOO easy, but you have made it sooooooo complicated.
    Dude, get a life.

  24. #24


    Did you find this post helpful? Yes | No

    Default

    I've gotta say Ted, you ask for help, and when we actually try to give it, you diss us off. Did you expect that we would drop everything and just run over to your house and make it work? I'm sorry mate, but I think you have no concept of how help is given. I took to time to MAKE your circuit on breadboard, make it work, then write you how to do it, and your reply is "Get a life". I would say this to you. UNSUBSCRIBE, you are not worth the effort

  25. #25
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    You see, if you had worked on your manners when it comes to respect you wouldn't have created it ineffectually.

  26. #26


    Did you find this post helpful? Yes | No

    Thumbs down

    And if you weren't ungrateful you would accept help in whatever form it's offered, and thank those who take the time to work on a solution. I am following Ski's lead. as far as you are concerned, I AM OUT.
    Last edited by gringobomba14; - 27th July 2008 at 13:14.

  27. #27
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    gringobomba14, you should work on your manners. You are given important information about your behaviour and you are not accepting it. I do not want to help you any further.
    Last edited by Ted's; - 27th July 2008 at 17:32.

  28. #28
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Check the 2 pins of the board with PIC removed for capacitance, I would bet it is loading down the PIC's OSC until it does not work. Why would it run once ? Maybe in initializing it gets more power than after it starts. I am thinking there is such low impedance on the OSC circuit that it does not run.
    I do not know how to do that practically.

  29. #29
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Why would it run once ?
    Because that's the way his program is written...

    Quote Originally Posted by gringobomba14 View Post
    Get the basics going first.
    But the circuit/program is so far beyond the basics!!!

    AND SKI, it's not just the sugar that will decay your teeth, the acid from your saliva will eat through the enamal and calcium, so use a calcium replacing toothpaste. I personally like the green lollipops best
    And I'm sure it's not doing the wires and brackets any good either (I wish there was a little green smiley face with braces out there somewhere)

  30. #30
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    The circuitry is actually far beyond basics. There is even a IR receiver + software decoding included aswell as some other modern items.

    I excluded anything being unimportant for this issue.

  31. #31
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ted's View Post
    The circuitry is actually far beyond basics. There is even a IR receiver + software decoding included as well as some other modern items.
    See! What did I say! It's so very complicated! IR receivers...firmware decoding... So much going on!

    But...like anything else...
    If the car won't start, how do you know the automatic transmission will upshift or the anti-lock brakes actually work?

  32. #32
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default This PC Board's Got it All

    I think you've certainly covered the bases on what NOT to do with a PC board.



    Throw that one out. Get a new soldering iron, some 60/40 solder, some liquid flux, and a large pencil eraser. And try again.
    DT

  33. #33
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Also, from the 2 indentations on the melted transistor, it looks like you are soldering with something like this ...



    You really need something smaller. A 40W pencil type will do.
    DT

  34. #34
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I think you've certainly covered the bases on what NOT to do with a PC board.
    ....
    Throw that one out. Get a new soldering iron, some 60/40 solder, some liquid flux, and a large pencil eraser. And try again.
    It might've been easier to show the GOOD solder joints and the 'finer' points of this PCB.
    Nothing like a properly tinned, properly cleaned, fully dewetted pad with a proper concave fillet between the lead and the pad connecting the 2 parts...
    I saved those 4 pictures and I sent them to the instructors at the 2M-CCR class I took last year as examples of what NOT to do.
    (BTW - I saw 2 pads that would pass at that 2M-CCR course as 'acceptable' in the upper left corner of the 3rd picture, the rest....fail.)
    Last edited by skimask; - 28th July 2008 at 02:36.

  35. #35
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Darrel Taylor, it is much better to circle them on the picture instead of cutting them out.

    As you are admin, I want you to increase the maximum picture size to 4MB for me to be able to upload high quality pictures.
    Last edited by Ted's; - 28th July 2008 at 09:14.

  36. #36
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    DT

  37. #37
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Question

    Can I help you?

Similar Threads

  1. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  2. Replies: 14
    Last Post: - 26th September 2007, 05:41
  3. Pic16f84 and RC5 kode
    By terminator in forum Bluetooth
    Replies: 5
    Last Post: - 18th June 2007, 21:40
  4. Pic Start Plus Help
    By shawn in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2007, 03:47
  5. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10

Members who have read this thread : 1

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