oscillator problem


Closed Thread
Results 1 to 28 of 28
  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429

    Lightbulb oscillator problem

    I'm running an 18f1320 at 40mhz using a 10mhz crystal with PLL enabled.

    The oscillator worked fine on a breadboard, but when I built a PCB for it, it worked for a while and then stopped working.

    It works again for a little while if I melt the solder points for the oscillator with my soldering iron, but 20 mins later it stops working again.

    Ive attached the PCB design. Anyone have ideas?
    Attached Images Attached Images  
    Last edited by Acetronics2; - 4th September 2010 at 10:55. Reason: reset original post
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Melt the solder where?

    But what if you try MCLR as an input? Or are you?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Melt the solder where?

    But what if you try MCLR as an input? Or are you?
    If I melt the solder that connects the crystal's pins to the pcb it works for a while. I assume it's because it's heating up the crystal?.

    Currently I have MCLR enabled, and have a 10k resistor pulling it high.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    If I melt the solder that connects the crystal's pins to the pcb it works for a while. I assume it's because it's heating up the crystal?.

    Currently I have MCLR enabled, and have a 10k resistor pulling it high.
    Hi, Kamikaze

    No decoupling capacitors anywhere ??? ... especially the magic 0.1µF between supply pins ???

    Further ... having your config header could have helped, but surely "Top secret matter"

    Waiting for more infos ...

    Alain
    PS : sorry for the first post ... I've hit the wrong button ...
    ************************************************** ***********************
    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 " !!!
    *****************************************

  5. #5
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    No decoupling capacitors anywhere ??? ... especially the magic 0.1µF between supply pins ???
    Further ... having your config header could have helped, but surely "Top secret matter"
    Yes there is a 0.1uF cap close to the VCC pin from there to ground. There is also a 100uF cap at the point that the supply enters the board (board is supplied by an external 5v source).

    config:
    Code:
            __CONFIG    _CONFIG1H, _HSPLL_OSC_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _LVP_OFF_4L
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  6. #6
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Just to be sure, I just added another 0.1uF cap directly across the supply pins of the pic and it didnt help.

    I've also turned off MCLR, but also no luck.

    I've also just tried replacing the PIC but same issue.

    I'm stumped.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  7. #7
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    OP should read:

    I'm running an 18f1320 at 40mhz using a 10mhz crystal with PLL enabled.

    The oscillator worked fine on a breadboard, but when I built a PCB for it, it worked for a while and then stopped working.

    It works again for a little while if I melt the solder points for the oscillator with my soldering iron, but 20 mins later it stops working again.

    Ive attached the PCB design. Anyone have ideas?
    Acetronics, can you edit it? I dont seem to be able to any more.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    Yes there is a 0.1uF cap close to the VCC pin from there to ground. There is also a 100uF cap at the point that the supply enters the board (board is supplied by an external 5v source).

    config:
    Code:
            __CONFIG    _CONFIG1H, _HSPLL_OSC_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _LVP_OFF_4L
    Could you try

    Code:
    @ __CONFIG _CONFIG1H, _IESO_OFF_1H & _FSCM_OFF_1H & _HSPLL_OSC_1H
    @ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _BORV_27_2L
    @ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_32K_2H
    @ __CONFIG _CONFIG3H, _MCLRE_ON_3H
    @ __CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_OFF_4L
    @ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
    @ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L
    @ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    @ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L
    @ __CONFIG _CONFIG7H, _EBTRB_OFF_7H
    as a config , to be sure of.

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

  9. #9
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Could you try
    ...
    Unfortunately, no difference.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  10. #10
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    Unfortunately, no difference.
    did you clean the board carefully with acetone to wipe off any solder stripper ??? especially under the caps ...

    next step will be verify your caps value ( SMD not marked ...) and Xtal data ...

    may be could we have an eye on your program ??? ...

    Alain

    BTW ... could you try to run the PIC @ 10 mhz ( HS_OSC ) ... just to see if any life aboard.
    Last edited by Acetronics2; - 4th September 2010 at 12:12.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  11. #11
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    did you clean the board carefully with acetone to wipe off any solder stripper ??? especially under the caps ...

    next step will be verify your caps value ( SMD not marked ...) and Xtal data ...

    may be could we have an eye on your program ??? ...

    Alain

    BTW ... could you try to run the PIC @ 10 mhz ( HS_OSC ) ... just to see if any life aboard.
    I did clean the board thoroughly with alcohol to get rid of flux, etc.

    Ive tried every cap value I have. At the moment I've actually replaced the SMD caps with 22pF thru-hole caps soldered onto the SMD pads as a test, but that didn't help either.

    Unfortunately I dont have data on my crystal. The place I bought it didn't supply data or a specific manufacturer/model number.

    When this started happening I reduced my program to a bare minimum to test if it is running. After trying 10mhz with HS_OSC (which didnt make a difference), the code im using is:

    Code:
    DEFINE OSC 10
    
    ADCON1=%01111111
    
    LCD_DB4         VAR PORTA.4
    LCD_DB5         VAR PORTA.2
    LCD_DB6         VAR PORTA.3
    LCD_DB7         VAR PORTB.0
    LCD_RS          VAR PORTA.0
    LCD_E           VAR PORTA.1
    LCD_Lines       CON 2    
    LCD_DATAUS      CON 50 
    LCD_COMMANDUS   CON 2000
    
    INCLUDE "LCD_AnyPin.pbp"
    
    PAUSE 200
    
    LCDOUT $FE,1,$FE,2,"Hello World!"
    
    END
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  12. #12
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Try a simple BLINKY on a non ADC pin for a test.
    Tooo many things could be wrong with the other stuff.
    Dave
    Always wear safety glasses while programming.

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post

    didnt make a difference), the code im using is:

    Code:
    DEFINE OSC 10
     
    ADCON1=%01111111
     
    LCD_DB4         VAR PORTA.4
    LCD_DB5         VAR PORTA.2
    LCD_DB6         VAR PORTA.3
    LCD_DB7         VAR PORTB.0
    LCD_RS          VAR PORTA.0
    LCD_E           VAR PORTA.1
    LCD_Lines       CON 2    
    LCD_DATAUS      CON 50 
    LCD_COMMANDUS   CON 2000
     
    INCLUDE "LCD_AnyPin.pbp"
     
    PAUSE 200
     
    LCDOUT $FE,1,$FE,2,"Hello World!"
     
    END
    Do you remember PORTA.4 is an open collector pin ... ???

    ... and you could use pause 500+ instead of 200. some displays are a bit lazy ...
    Last edited by Acetronics2; - 4th September 2010 at 12:44.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  14. #14
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Do you remember PORTA.4 is an open collector pin ... ???

    ... and you could use pause 500+ instead of 200. some displays are a bit lazy ...
    I added a pullup resistor to PORTA.4

    It's definitely the osc because if I leave it running for 15 mins or so it does eventually display "Hello World!" extremely slowly.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    I added a pullup resistor to PORTA.4

    It's definitely the osc because if I leave it running for 15 mins or so it does eventually display "Hello World!" extremely slowly.
    I think so ... now.
    Xtals also can be a bit lazy ... depends on the " cut "

    don't you have a 12 or 16 Mhz Xtal ... ( I recently saw a 18F overclocked @ 80 Mhz !!! ... ) 48 Mhz is easy, 64 might work.

    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
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    I think so ... now.
    Xtals also can be a bit lazy ... depends on the " cut "

    don't you have a 12 or 16 Mhz Xtal ... ( I recently saw a 18F overclocked @ 80 Mhz !!! ... ) 48 Mhz is easy, 64 might work.

    Alain
    I just replaced it with a 16mhz which is working but that could just be because of the heating up. The test will be leaving it for half an hour and see if it still works. I'll post again then
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  17. #17
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    it seems to be running happily at 64hmz

    i dont understand why since i tried 2 different 10mhz crystals
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    it seems to be running happily at 64hmz

    i dont understand why since i tried 2 different 10mhz crystals
    To be really quiet with that ...

    I only buy my Xtals from Farnell, now ... per 100, price is nice.

    Never more from a local dealer ...

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

  19. #19
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    The only thing to watch when overclocking is that things like serial comms ad the like often wont work. I had an 18F4580 running on a 20Mhz xtal with the HS_PLL setting - whilst it wasn't probably running at 80Mhz, it was dammed fast - but non of my serial comms would work until I replaced the 20Mhz xtal with a 12Mhz one. (as spotted by Alain)

    I was going to suggest that you tried using the xtal from the breadboard that you know was a proven crystal... but now you seem to of resolved the problem. - I have to agree with Alain, I would only purchase from a large component retailer (RS in my case).

  20. #20
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I'm still noticing something strange.

    When I turn it on for the first time in half an hour, it takes about 3 seconds to start running.

    If I then turn it off, and back on it starts right away.

    Still something strange going on.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  21. #21
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    The only thing to watch when overclocking is that things like serial comms ad the like often wont work. I had an 18F4580 running on a 20Mhz xtal with the HS_PLL setting - whilst it wasn't probably running at 80Mhz, it was dammed fast - but non of my serial comms would work until I replaced the 20Mhz xtal with a 12Mhz one. (as spotted by Alain)

    I was going to suggest that you tried using the xtal from the breadboard that you know was a proven crystal... but now you seem to of resolved the problem. - I have to agree with Alain, I would only purchase from a large component retailer (RS in my case).
    Hi, Malc

    your problem was setting correctly the OSC related registers ... not a Xtal problem ...
    as you were running @ ... 4x 12 Mhz !!!

    for PBP ... it is not overclocking, as those frequencies are in the compiler's list ...

    @ Kamikaze

    looks there's a supply stability or glitches problem that doesn't allow the PLL to stabilize quickly ... add a 10/22 µF Tantalum bead as close as possible to the PIC !!!

    You also can poll for the PLL stability flag before allowing your program to run ... ( for execution sake )

    Alain
    Last edited by Acetronics2; - 4th September 2010 at 15:55.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  22. #22
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    looks there's a supply stability or glitches problem that doesn't allow the PLL to stabilize quickly ... add a 10/22 µF Tantalum bead as close as possible to the PIC !!!
    The only SMD tantalum cap I had handy was 1uF so I soldered it as close to the pic's supply pins as possible and it seems to have fixed the issue.

    I'll know for sure once I've left it off night and turn it back on.

    Thanks heaps for your help.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  23. #23
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    The only SMD tantalum cap I had handy was 1uF so I soldered it as close to the pic's supply pins as possible and it seems to have fixed the issue.

    I'll know for sure once I've left it off night and turn it back on.

    Thanks heaps for your help.
    Glad you finally see the end ...

    Et ... YES, PLL's are very sensitive to supply !!!
    ************************************************** ***********************
    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 " !!!
    *****************************************

  24. #24
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    still no luck unfortunately

    when i turned it on after it being off over night, it took 3 mins to start running.

    once it was running it seems to work fine, and turning it off and back on results in a quick start up.

    the time it takes to start seems to be proportional to the time that it's been off.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  25. #25
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    644


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    still no luck unfortunately

    when i turned it on after it being off over night, it took 3 mins to start running.

    once it was running it seems to work fine, and turning it off and back on results in a quick start up.

    the time it takes to start seems to be proportional to the time that it's been off.
    I am not sure if you have mentioned this before. Are you using a voltage regulator? Where are you getting your supply voltage from?

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  26. #26
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    A few pointers:
    • Can you make a simple program to just blink an output - nothing more?
    • Can you make this simple program run with; (1) internal 8MHz osc and x4 PLL [32MHz], (2) external 10MHz osc and x4 PLL [40MHz]?
    • Your ground return lines on the PCB look questionable. Looks like you could've used a ground plane, but you chose to run lines back to the connectors. The crystal capacitors are expected to have good ground connections and the PCB does not appear to accomplish this.
    • Simple code and possibly a schematic would go a long way to help troubleshoot this. Best guess at the moment is that the PCB is not close to ideal.

  27. #27
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    To be honest I'm finding it hard to work that PCB out - I guess the copper is the top layer as it's surface mount ? - without the component overlay we could make assumptions that the two large components are capacitors and the component that sits over the top of what looks like capacitors could be a regulator..... just guessing

    To the OP - you stated the circuit worked fine when breadboarded - try re-building it on vero strip board using descrete components (possibly the ones used on the breadboard) and see if that works. If it does then it would suggest that the problem is with either the PCB design or the SM components.

  28. #28
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rsocor01 View Post
    I am not sure if you have mentioned this before. Are you using a voltage regulator? Where are you getting your supply voltage from?
    I have tried 2 difference sources. Firstly a computer power supply's 5v rail, and ive also tried the 5v source on the pickit2. No regulator.

    Quote Originally Posted by malc-c View Post
    To be honest I'm finding it hard to work that PCB out - I guess the copper is the top layer as it's surface mount ?...
    The blue is bottom layer - all surface mount components are on the bottom layer. The through-hole components are on the top layer. Even though it looks like components are on top of each other, they are actually on opposite sides of the board.

    I realise that the PCB isn't self explanatory, sorry.

    Quote Originally Posted by languer View Post
    A few pointers:
    • ...
    I will try the things you suggested and post back.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

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