Shop OBEX P1 Docs P2 Docs Learn Events
Help, Crystal issues — Parallax Forums

Help, Crystal issues

steprogsteprog Posts: 227
edited 2014-04-04 21:10 in Propeller 1
Hello,
I think my crystal is not working on my board and I need a crystal tomorrow. I am in Salem, Oregon this weekend trying to use the propeller for fire suppresson control and detection in vehicles. However I used some digikey crystals and i think they are not working for my prototype. Does anyone out there know where I may pick up some tomorrow up here ?
Greg
«1

Comments

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 17:32
    However I used some digikey crystals

    Can you post the Digikey part number so we can tell you if they should work?

    Also , it's a good idea to post a picture of your prototype if you can.
  • steprogsteprog Posts: 227
    edited 2014-03-28 17:38
    Yes, thanks good ideal to check 5 MHz 20 pf X410-ND
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 17:45
    From the Prop manual Page 29:

    OSCMx
    1 0
    _CLKMODE
    Setting
    XOUT
    Resistance
    XIN/XOUT
    Capacitance Frequency Range
    0 0 XINPUT Infinite 6 pF (pad only) DC to 80 MHz Input
    0 1 XTAL1 2000 Ω 36 pF 4 to 16 MHz Crystal/Resonator
    1 0 XTAL2 1000 Ω 26 pF 8 to 32 MHz Crystal/Resonator
    1 1 XTAL3 500 Ω 16 pF 20 to 60 MHz Crystal/Resonator


    http://www.parallaxsemiconductor.com/sites/default/files/parallax/Web-PropellerManual-v1.2_0.pdf
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 17:48
    18-20pF is the correct crystal spec@ 5 MHZ

    The 20 pf capacitance rating you have is ok.


    I'll have a look at X410-ND on the Digikey site.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 17:58


    X410-ND leaf-alt.png
    ECS-50-20-4
    ECS Inc
    CRYSTAL 5MHZ 20PF THRU
    3,652 - Immediate

    0.97000
    1
    Bulk xWMXhLo0k.webp
    HC-49US


















  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 17:59


    X410-ND


    HC-49US

    T
    hat should work fine.
  • steprogsteprog Posts: 227
    edited 2014-03-28 18:02
    thats it, but it is so flaky on my board. I talked to Chris at Parallax and discussed possible problems, but I think my power is rock solid lots of bypass. My crystal is not far away, one or two vias. Driving me crazy. Never had this problem in all the projects I have had before. If anyone has anything like this nearby, would love to get my hands on some extra.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 18:09
    Did you test your design with some basic spin code from the library first to see if everything works first?

    I guess we need to see pictures to help you.

    My experience with xtals is that they usually work or not, nothing in between unless they are affected by temperature or stray capacitance.
  • David CarrierDavid Carrier Posts: 294
    edited 2014-03-28 18:20
    Try running it without the PLL, e.g. with:
    _clkmode = xtal1
    

    If it works, then the issue may be with the PLL, and not the crystal. It is the most sensatvie part of the Propeller microcontroller to conditions outside of the absolute maximum conditions, so if the Propeller microcontroller was exposed to ESD, excessive current on a supply rail, or reverse or under-voltage conditions, a bad PLL is a likely outcome.

    — David Carrier
    Parallax Inc.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-03-28 19:11
    steprog wrote:
    My crystal is not far away, one or two vias.
    Are we taliking about a PCB here or a solderless breadboard? If the latter, that could be your problem:
    1. Crystal wires are very skinny and may not make good contact with the solderless terminals.
    2. The extra stray capacitance of the breadboard could impact reliability.

    -Phil
  • LawsonLawson Posts: 870
    edited 2014-03-28 19:34
    Another thing to check is how clean you board is. While I haven't had flux deposits shut down the crystal, I have had the crystal temporarily stop running on several boards after I washed the PCB. (they always start running once they're bone dry though) I assume that leakage currents though the last bits of moisture were messing with the crystal oscillator. Note: I've always used PCB sockets for the crystal. directly soldering the crystal is more likely to trap flux and have leakage problems.

    How long are the wires to and from the crystal? Do you have a ground-plain under the crystal and the wires to/from it? On my boards so-far I've used <1cm wires to the crystal and a ground-plane under everything with rock-solid results.

    Marty
  • steprogsteprog Posts: 227
    edited 2014-03-28 19:54
    Hi Guys,
    It is just crazy. It is a PCB circuit. I built 4 boards and switched crystals and prop chips sometimes the boards work other times they don't. Something is just irratic I think. Coffee and another late night of troubleshooting I think. When I get something that makes sense I will report back.
    Greg
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-03-28 20:32
    Greg,

    Bob Lawrence suggested posting a picture of your board. Please do. Include both a photo and your layout artwork. David Carrier suggested running the Prop without the PLL. Have you tried that yet? We're trying to help, but if you don't follow our suggestions, there's not much we can do.

    -Phil
  • steprogsteprog Posts: 227
    edited 2014-03-28 21:18
    Sorry Phil,
    I am out of town sitting in hangar in Oregon. I don't have a way to send my board layout or schematic. I did try running without the pll but I can't say I understand my results yet. Part of the problem is I am running on fumes. I decided I need to go slow and think through everything. Thanks Phil I know you guys are the best. Unfortunately, I really messed up and didn't bring my latest schematics with me.
  • steprogsteprog Posts: 227
    edited 2014-03-28 21:28
    Is it possible to have a memory problem and the program still shows that the eeprom is programmed? I found I had a short on a bypass cap for the eeprom fixed it but didn't solve my problem. Thinking of replacing the chip. Any thoughts?
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 21:41
    The other thing was to determine if it's a Hardware or Software Problem. "Did you test your design with some basic spin code from the library first to see if everything works first?"

    Just write some code to flash a LED or 2 and see if it's stable.

    Do you have access to an Oscilloscope , where you are?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-03-28 21:52
    It just could be added capacitance in the board construction. Maybe a different drive setting for the crystal will bring it to life.

    In other words, i suspect that you should work through the other Propeller OSCMx settings regardless of it merely being a 5Mhz xtal.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 21:54
    Can you post your code on here?
  • steprogsteprog Posts: 227
    edited 2014-03-28 21:57
    Yes, Bob, tried a simple on/off loop with the spin code and nothing. However I had more sophisticated code working and then it goes away. I think maybe going through a simple program and going through the crystal settings will tell me something. If your able to program your memory, that means that rcfast is working true?
    Greg
  • steprogsteprog Posts: 227
    edited 2014-03-28 22:01
    _clkmode = rcfast
    _xinfreq = 5_000_000
    _stack = 2000

    CON
    i2cSCL = 28

    ' Card Type
    Under = TRUE
    ' CardNum = 2 'Under
    ' Sensor = True
    ' Mister = False
    ' Foamer = False

    'Set pins for MosFet Drivers
    FOAM_Pin = 17
    MIST_Pin = 16

    'Set pins and Baud Rate for USB comms
    pcDebugRX = 31
    pcDebugTX = 30
    pcDebugBaud = 115200
    Mode = 0

    'Set Pins and Baud Rate for XBee comms
    XB_Sleep = 26
    XB_Reset = 27
    XB_Rx = 24 'XB DOUT
    XB_Tx = 25 'XB DIN
    XB_Baud = 9600

    'Count for A/D
    num = 8

    DAT
    start byte "start",0 ' start processing command
    Hello byte "hello",0 'send command
    stop byte "stop",0 ' same as "reset"
    space byte " ",0





    VAR
    byte command[128] ' store command from PC
    byte V[8]
    long OverPressure 'OverPressure Flag
    long RfOverPressure 'OverPressure Flag from external
    long GoodSwitch 'Switch Flag
    long RfGoodSwitch 'Switch Flag from external
    long Flame 'Flame Flag
    long RfFlame 'Flame Flag from external
    long RfFoam 'Foam Flag from external
    long HiTemp 'High Temperature Flag
    long RfHiTemp 'High Temperature Flag
    long FlameTimeout 'FlameTimeOut Flag
    word FlameCnt 'Flame time out counter

    byte SetPoint,Upper,Lower,MaxThreshold
    byte Sensor1_T2, Sensor1_T1, Sensor2_T2, Sensor2_T1
    byte MaxTherm
    byte Therm1, Therm2
    word Sensor,n,ix,Timer,CheckWord
    long Cog, TestVar
    byte comd,Value

    OBJ

    USB : "FullDuplexSerialPlus"
    getadc : "ad7829"
    XB : "XBee_Object_2"
    OP : "OverP2"
    SW : "GoodSW"

    pub main
    Initialize
    USB.start(pcDebugRX,pcDebugTX,Mode,pcDebugBaud) ' start the PC debug object
    ' XB.start(XB_Rx,XB_Tx,0,XB_Baud) 'initialize and start up the XB object
    ' XB.AT_Init ' Initialize for fast AT command use - 5 second delay to perform
    ' XB.Delay(1000)
    ' getadc.start(@V[1],num)
    ' OP.start(@OverPressure)
    ' SW.start(@GoodSwitch)
    ' display(string("Online ")) ' this string goes to PC for display
    ' USB.tx("O") 'Transmit Overpressure signal


    repeat
    display(string("Online ")) ' this string goes to PC for display
    outa [MIST_Pin] := 1 'Activate Mist
    outa [FOAM_Pin] := 1 'Activate Foam
    waitcnt(clkfreq/10 + cnt) 'wait 1/5 sec to repeat writs
    outa [MIST_Pin] := 0 'Activate Mist
    outa [FOAM_Pin] := 0 'Activate Foam
    waitcnt(clkfreq/10 + cnt) 'wait 1/5 sec to repeat writs
    {
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 22:02
    Yes, Bob, tried a simple on/off loop with the spin code and nothing.
    As in no problems or nothing is working?
    I had more sophisticated code working and then it goes away
    Are you using multiple cogs? Is your stack space correct?
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 22:06
    [PHP]Thinking of replacing the chip. Any thoughts?[/PHP]

    David Carrier suggested that it may be a bad PLL and swamping out the Propeller chip for another one will determine that.

    Why aren't you able to use a cell phone to snap a few pictures of your board and load them here?
  • steprogsteprog Posts: 227
    edited 2014-03-28 22:09
    As in signals don't oscillate. Swapped memory- no difference, commented out all objects still no oscillation
  • steprogsteprog Posts: 227
    edited 2014-03-28 22:09
    Sorry Bob, no smart phone here
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 22:10
    When your testing with the xtal , don't forget to set it back to :

    _clkmode = xtal1 + pll16x 'Standard clock mode * crystal frequency = 80 MHz
    _xinfreq = 5_000_000
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-03-28 22:11
    Greg,

    attachment.php?attachmentid=78421&d=1297987572

    -Phil
  • steprogsteprog Posts: 227
    edited 2014-03-28 22:16
    '_clkmode      = xtal1 + pll16x
    _clkmode = xtal1
    _xinfreq      = 5_000_000
    _stack        = 2000
    
    CON    
      i2cSCL        = 28
    
    ' Card Type
      Under = TRUE
    '  CardNum = 2     'Under
    '  Sensor = True
    '  Mister = False
    '  Foamer = False
    
    'Set pins for MosFet Drivers  
       FOAM_Pin            = 17
       MIST_Pin            = 16
    
    'Set pins and Baud Rate for USB comms
      pcDebugRX       = 31
      pcDebugTX       = 30
      pcDebugBaud     = 115200
      Mode = 0
    
    'Set Pins and Baud Rate for XBee comms
      XB_Sleep        = 26
      XB_Reset        = 27
      XB_Rx           = 24  'XB DOUT
      XB_Tx           = 25  'XB DIN
      XB_Baud         = 9600
    
    'Count for A/D 
      num           =  8
    
    DAT
      start  byte "start",0          ' start processing command
      Hello   byte "hello",0             'send command
      stop    byte "stop",0           ' same as "reset"
      space   byte " ",0
    
    
        
      
      
    VAR
      byte command[128]             ' store command from PC
      byte V[8]
      long OverPressure   'OverPressure Flag
      long RfOverPressure 'OverPressure Flag from external
      long GoodSwitch     'Switch Flag
      long RfGoodSwitch   'Switch Flag from external
      long Flame          'Flame Flag
      long RfFlame        'Flame Flag  from external
      long RfFoam         'Foam Flag  from external
      long HiTemp         'High Temperature Flag
      long RfHiTemp       'High Temperature Flag
      long FlameTimeout   'FlameTimeOut Flag
      word FlameCnt       'Flame time out counter
      
      byte SetPoint,Upper,Lower,MaxThreshold
      byte Sensor1_T2, Sensor1_T1, Sensor2_T2, Sensor2_T1
      byte MaxTherm
      byte Therm1, Therm2
      word Sensor,n,ix,Timer,CheckWord                                                                         
      long Cog, TestVar
      byte comd,Value
      
    OBJ
    
    '  USB            : "FullDuplexSerialPlus"
    '  getadc         : "ad7829"
    '  XB             : "XBee_Object_2"
    '  OP             : "OverP2"
    '  SW             : "GoodSW"
       
    pub main
        Initialize
    '    USB.start(pcDebugRX,pcDebugTX,Mode,pcDebugBaud) ' start the PC debug object
    '    XB.start(XB_Rx,XB_Tx,0,XB_Baud) 'initialize and start up the XB object
    '    XB.AT_Init                     ' Initialize for fast AT command use - 5 second delay to perform
    '   XB.Delay(1000)
    '    getadc.start(@V[1],num)
    '    OP.start(@OverPressure)
    '    SW.start(@GoodSwitch)
    '    display(string("Online ")) ' this string goes to PC for display
    '            USB.tx("O")   'Transmit Overpressure signal
    
                                       
        repeat
    '       display(string("Online ")) ' this string goes to PC for display
               outa [MIST_Pin] := 1  'Activate Mist
               outa [FOAM_Pin] := 1  'Activate Foam
               waitcnt(clkfreq/10 + cnt)                 'wait 1/5 sec to repeat writs
               outa [MIST_Pin] := 0  'Activate Mist
               outa [FOAM_Pin] := 0  'Activate Foam
               waitcnt(clkfreq/10 + cnt)                 'wait 1/5 sec to repeat writs
    
    {
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 22:19
    _clkmode = rcfast

    I don't see how you can test your code above with _clkmode = rcfast.

    _clkmode = rcfast is ok for testing the PLL but you have to use simple code such as flash a LED.


  • steprogsteprog Posts: 227
    edited 2014-03-28 22:26
    I changed it to xtal1, and I use a logic probe on the input to two mosfet drivers
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-03-28 22:27
    but it is so flaky on my board.

    Which part of your program doesn't work? Serial comms? XBee comms/ bad data etc, Please provide more details.

Sign In or Register to comment.