This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

external 8mhz crystal oscillator problem?

Other Parts Discussed in Thread: MSP430F155

hi all,

  am a beginner  and am trying to configure my msp430f155 controller to operate at 8 mhz speed..so i purchased a external 8 mhz crystal with a load capacitance of 20pf.. so i connected c1=33pf,c2=33pf externally with a oscilator pin xta1 and xta2.. now i need to know whether my c1,c2, value are wright and how can i check my controller speed by means of coding...

  • Hi,

    I think the values are ok, both 33pf parallel plus 2 x 2pf give a effective load capacitance of 20.5pF. On your device you can use port P5.4 (set P5SEL.4 accordingly) to route MCLK to this pin and measrure it there directly. Do not measure at the crystal directly as any probe brings it's own capacitance influences the oscillation.

    To check from a running program you can use the (S)MCLK as input for a timer and count pulses for a known interval, using ACLK to have a different timing base.

    Hope that helps,

    Jan

  • Jan Kesten said:
    I think the values are ok, both 33pf parallel plus 2 x 2pf give a effective load capacitance of 20.5pF.

    Where did you get the 2x2 from and how do your add it up to 20.5?

    33||33 gives 16.5, and the 1pF parasitic pin capacitance adds another 0.5, adding up to 17. Which might be a little low for a nice oscillation, but might work okay. I'd recommend 39pF capacitors instead of 33pF. And of the NP0 type, as teh standard caps have extremely large tolerance that makes all the math obove void.

    The fastest way to check the crystal speed is to source SMCLK by the crystal and enable the SMCLK output pin, then check the signal with a scope (you shouldn't do microcontroller work without a scope, it's like building furnitures without a carpenters rule) or a precision counter (if available).

  • Hi,

    thanks for that hint, simple mistake from my side. The calculation should be 33pF || 33pF + 2pF || 2 pF = 17,5 pF - which indeed is a bit too low. One can easily calculate the requiered external load caps with

    C_ext = 2*C_load - C_pin

    which is here with C_pin = 2pF in XT mode according to the datasheet and 20pF load capacitance

    C_ex = 2*20pF - 2pF = 38p

    But 39pF would also work, but for every oscillator one should choose low tolerance caps - building a good an stable osciallator is always challenging task.

**Attention** This is a public forum