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.
Hi all,
I have an external oscillator connected to port 2.6-2.7 on msp430g2744 .
The way I configure the clock to be sourced from the external 32k osci is as follows (taken from the sample apps),
I'm wondering where in the code I let it be known that the physical port for the oscillator is 2.6-2.7?
BCSCTL3 |= LFXT1S_0 + XCAP_0; // 32768-Hz crystal on LFXT1 + Oscillator capacitor selection
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
Thanks in advance,
Omri.
Not in the code. The pin is not selectable, it is fixed in the hardware. Therefore the information is found in the device datasheet.Omri Berg1 said:I'm wondering where in the code I let it be known that the physical port for the oscillator is 2.6-2.7?
For details about the clock system and how external oscillators are to be used on software side, see the clock system chapter of the users guide.
In your specific code snippet, the clock system is configures to expect a 32kHz crystal on XT1IN pin. For an external oscillator, the first line should rather read
BCSCTL3 = (BCSCTL3&~XCAP_3)|LFXT1S_3;
Since the power-on default is XCAP_1 (=0x04), performing an OR with XCAP_0 (=0x00) doesn't have any effect and won't clear the default. While LFXT1S_0 (=0x00) is the default, doesn't change anything too even if it were not the default and is wrong, as it selects crystal operation, not digital oscillator input.
Note that 'oscillator' isn't a synonym for 'crystal'. The MSP has an incomplete internal oscillator circuit that requires an external crystal (and either internal or external capacitors that match the crystal requirements). So the external crystal is part of the internal oscillator circuit. And this internal circuit can be bypassed when a complete external oscillator is connected (that means a circuit or chip that produces a digital square-wave clock signal)
**Attention** This is a public forum