EmbeddedRelated.com
Forums
Memfault Beyond the Launch

MSP430 Clock module

Started by ti2tt February 7, 2009
That's weird.
I recently pointed that out (that SMCLK can only be sourced from XT2) and
OCY argued that you can do this on F13X and F14X parts ? I'd still like to
see how.
I recall this because when I designed the PCB for TI's wireless headset
reference design w/ TRF6900, I used XT2 (design used an F135). I was
requested to re-route it using XT1 for code reasons. I pointed out that you
can't use SMCLK then, but that was the request, so I changed it to use XT1.
Afterwards a kynar link had to be inserted on the F135 to produce SMCLK
from XT1.....
That's how I distinctly remember that SMCLK needs XT2 on F13X parts.

Best regards,
Kris

On Wed, 11 Feb 2009 10:22:52 -0000, "ti2tt" wrote:
> Dear members,
>
> Yes.......It is true that SMCLK is available only from DCO or XT2 (if
> XT2 is present on chip). The word "on chip" is very important here. I
> also tested this by connecting a XTAL to XT2 and outputting SMCLK as
> previous and it works.
>
> Thank you very much for your kind support particularly
> Old_Cow_Yellow. Keep supporting....
>
> ti2tt
> --- In m..., "Jim Smith" wrote:
>>
>> ti2tt,
>>
>> OCY is correct. The spec isn't clear on this matter, but I just
> tried
>> commenting out the code for "Activate the XT2 XTAL" in the
> following code,
>> and did not get anything on the ACLK output pin (P5.6). I read the
> spec and
>> interpreted it the same as you did. I thought that you should be
> able to
>> route ACLK (or VLOCLK) to SMCLK, but it appears that is only true
> if the
>> MSP430 chip does NOT support the XT2 crystal. I tried this on a
> F2618 chip
>> mounted in TI's 64-pin socket board, which came with the 32 kHz
> LFXT1, and
>> on which I mounted a 3.8684 mHz XT2.
>>
>> After spending some time learning how to use the serial port, my
> project is
>> now moving along pretty rapidly. I'm now up to 30K of Flash usage
> and 7K of
>> RAM, on a data collection project. The product that I am upgrading
> was
>> originally done on a 8051 variant, using the Keil Compiler. Even
> though the
>> original code was in C, it isn't a trivial task to move that to
> another
>> embedded controller chip using a different brand of compiler. And,
> to take
>> advantage of the MSP430's lower-power features -- well, that's
> another story
>> (and learning curve!). Anybody tried using buffered, interrupt-
> driven serial
>> output, using DMA to transfer from buffer to serial port? I'm also
> looking
>> at an interrupt triggering A/D conversion, which, when complete,
> utilizes
>> DMA to move the results into place.
>>
>> Jim Smith
>>
>> void Clocks_init(void) {
>> //***** Activate the XT2 Xtal (3.8684mHz)
>> **************************************
>> BCSCTL1 &= ~XT2OFF; // Activate XT2 high freq xtal
>> BCSCTL3 |= XT2S_2; // 3 16MHz crystal or
> resonator
>> do {
>> IFG1 &= ~(OFIFG); // Clear OSCFault flag
>> for (i = 0xFF; i > 0; i--); // Time for flag to set
>> } while (IFG1 & OFIFG); // Loop until OSCFault flag
> stays Clear
>> //***** Choose the Clocks
>> ******************************************************
>> // Defaults under current settings:
>> // ACLK = LFXT1 = 32 kHz Default when LFXT1 XTAL installed
>> // MCLC = DCO = 1 mHz Defaults to DCO, which defaults to
> 1mHz
>> // SMCLK = DCO = 1 mHz Defaults to DCO
>> BCSCTL2 |= (SELS); // SMCLK = XT2 HF XTAL if activated (safe)
>> // (LFXT1CLK or VLOCLK when XT2 osc not
> present)
>> // We now have Clocks set to:
>> // ACLK = LFXT1 = 32 kHz We will use this for Timer_B
> clock
>> // MCLK = DCO = 1 mHz CPU Clock (Defaults to DCO)
>> // SMCLK = XT2 = 3.6864 mHz We will use this for Timer_A
> clock
>> //***** Send Clocks to port pins for viewing with scope
>> ************************
>> P5SEL |= (BIT4 | BIT5 | BIT6); // P5.6,5,4 options (ACLK,
> SMCLK, MCLK)
>> } // End Clocks_init()
>>
>> _____
>>
>> From: m... [mailto:m...] On
> Behalf Of
>> old_cow_yellow
>> Sent: Monday, February 09, 2009 3:17 AM
>> To: m...
>> Subject: [msp430] Re: MSP430 Clock module
>>
>> You misread or misinterpreted that statement in the User's Guide.
>>
>> For MSP430F2418, there is a XT2 oscillator. Thus the phase "XT2
>> oscillator present" is TRUE.
>>
>> --- In msp430@yahoogroups.
> com, "ti2tt"
>> wrote:
>> >
>> > Hello,
>> >
>> > But the user guide for MSP430F2xxx (slau144e.pdf) says that if
> XT2CLK
>> > is not present on XT2 oscillator, LFXT1CLK or VLOCLK can be used.
>> > Please refer to page no. 300 (BCSCTL2 register settings for
> SMCLK).
>> > It is not mentioned that only XT2 source is available for SMCLK.
>> >
>> > --- In msp430@yahoogroups. com,
>> "old_cow_yellow"
>> > wrote:
>> > >
>> > > If you want to use external XTAL to source SMCLK, you have to
>> > connect
>> > > it to XT2IN and XT2OUT, not XTIN and XTOUT.
>> > >
>> > > --- In msp430@yahoogroups.
> com,
>> "ti2tt" wrote:
>> > > >
>> > > > Hello forum members,
>> > > >
>> > > > I am using MSP430F2418 with CrossStudio. I am outputting all
> the
>> > > > three clocks - MCLK, SMCLK and ACLK. When I use DCO, I am
> able to
>> > > > output MCLK and SMCLK as ACLK is not available for DCO. But
> when
>> > I
>> > > > use external XTAL (LFXT1), I am able to output only MCLK and
>> > ACLK.
>> > > > There is no output on SMCLK pin. Has anyone experienced this
>> > issue
>> > > > with SMCLK? Here I am giving the code used, please suggest
> the
>> > > > modifications in this if any for SMCLK.
>> > > >
>> > > > __SelectCrystalOsc proc
>> > > > BIC #OSCOFF+SCG1+SCG0+CPUOFF,SR // Turn on osc.
>> > > > BIS.B #XTS+DIVA_1+XT2OFF,BCSCTL1 //ACLK Divide by 2
>> > > > BIC.B #LFXT1S1,&BCSCTL3
>> > > > BIS.B #LFXT1S0,&BCSCTL3
>> > > > BIC.B #XCAP1+XCAP0,&BCSCTL3
>> > > > L1 BIC.B #OFIFG,&IFG1 // Clear OFIFG
>> > > > MOV #0FFh,R15 // Delay
>> > > > L2 DEC R15
>> > > > JNZ L2
>> > > > BIT.B #OFIFG,&IFG1 // Re?test OFIFG
>> > > > JNZ L1 // Repeat test if needed
>> > > > BIS.B #SELM1+SELM0,&BCSCTL2 // Select LFXT1CLK for MCLK
>> > > > BIS.B #DIVM_2,&BCSCTL2 // Mclk divide by 4
>> > > > BIS.B #SELS,&BCSCTL2 // Select LFXT1CLK for SMCLK
>> > > > BIS.B #DIVS_3,&BCSCTL2 // SMClk divide by 8
>> > > > ret
>> > > > endproc
>> > > >
>> > > > Thanks in advance.
>> > > >
>> > >
>> >
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.0.233 / Virus Database: 270.10.19/1940 - Release Date:
> 02/08/09
>> 17:57:00
>>
>>
>

Beginning Microcontrollers with the MSP430

--- In m..., wrote:
>
> That's weird.
> I recently pointed that out (that SMCLK can only be sourced
> from XT2) and OCY argued that you can do this on F13X and
> F14X parts ? I'd still like to see how.
> ......

I recall that we had the following exchange.

-----Original Message-----
From: old_cow_yellow
Sent: Thursday, 25 December 2008 6:11 PM
To: m...
Subject: [msp430] Re: Crystal question

That is more or less correct. But dozens of the old F1xx and
F2xx can use XT1 to source SMCLK.

All the current six members of F54xx can use XT1 to source SMCLK.
(I do not know about F3xx, F4xx, etc.)

--- "Microbit_P43000" wrote:
>
> Perhaps one other important difference to point out is that
> SMCLK can only be sourced from XT2, not XT1. (unless there's
> newer devices I haven't tracked anymore). This can be
> important in some cases.
>


Memfault Beyond the Launch