EmbeddedRelated.com
Forums
Memfault State of IoT Report

Low error UART communication MSP430F1611

Started by GB January 28, 2009
> I saw an application note that explains this very clearly, but I
> can't find it now. I'll see if I find it tomorrow.

And here it is, a 2 page Design Note with what you need to know when
designing with crystals:
http://www.foxonline.com/pdfs/xtaldesignnotes.pdf

Michael K.

--- In m..., "tintronic" wrote:
>
> > I haven't been able to find information about the load capacitance.
> > I checked the MSP430F1611 datasheet but all it says is to use
> > capacitors as recommended by crystal manufacturer and that the
> > mp430f1611 has 2pF input capacitance.
>
> Load capacitance is a value given by the crystal manufacturer, not by
> the MSP. It is the capacitance the crystal needs to operate in the
> given frequency. Crystal manufacturers usually provide an application
> note explaining how to calculate the right capacitor values for any
> crystal giving how they are connected (serial or parallel capacitors).
>
> > Do I need any external capacitors?
> Yes, you almos always do. Some chips provide an internal capacitance
> which is high enought for some crystals. For example, the MSP430x1xx
> provides two 12pF capacitors connected serially to the Xin Xout pins
> when in Low Frequency mode, for watch crystals. If your capacitor
> needs a higher value, you have to connect more capacitors.
> But for high frequency crystals the MSP does not provide internal
> capacitors, so you need to connect the right value for the crystal
> you're using, considering track capacitance and crystal port input
> capacitance.
>
> I saw an application note that explains this very clearly, but I can't
> find it now. I'll see if I find it tomorrow.
>
> Michael K.
>
> --- In m..., GB wrote:
> >
> > The code I use uses the 32768Hz crystal to set the DCO. The
> calibration constants are (I believe) on MSP430F2Xxx or so derivatives.
> >
> > I am going to start from the bottoms up, checking my crystal that I
> do have.
> >
> > I did take into account the 6pF load capacitance (I knew one day it
> would be useful to be extra vigilant about things), but I will measure
> the frequency using a good oscilloscope.
> >
> > However, I seem to be set on using the 7.3728MHz crystal which seems
> to be the best solution since power isn't an issue. I haven't been
> able to find information about the load capacitance. I checked the
> MSP430F1611 datasheet but all it says is to use capacitors as
> recommended by crystal manufacturer and that the mp430f1611 has 2pF
> input capacitance.
> >
> > Does anyone know the load capacitance? mouser offers 10,16,18 and 20
> pF .
> > Do I need any external capacitors?
> >
> > Thanks a lot for all your responses.
> >
> > --- On Wed, 1/28/09, tintronic wrote:
> > From: tintronic
> > Subject: [msp430] Re: Low error UART communication MSP430F1611
> > To: m...
> > Date: Wednesday, January 28, 2009, 6:07 PM
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > When I initialize the system I make the clock
> initialize to 4MHz:
> >
> > > TI_SetDCO(TI_ DCO_4MHZ) ;
> >
> > > This is using TI's code, which I'm pretty sure you know.
> >
> >
> >
> > I don't know which code you're referring to. Does it use calibration
> >
> > data stored in flash or does it use the 32,768 Hz crystal to generate
> >
> > the 4,001,792Hz? If it is the latest, did you measure the accuracy of
> >
> > the 32kHz crystal? If you're not using the exact same capacitor load
> >
> > and/or have not taken the 6pf load of the MSP430F16x into account, you
> >
> > won't get the ppm that the crystal vendor specifies, making your baud
> >
> > rate error will be much higher.
> >
> >
> >
> > Can't you use the FT2232 Xout signal and supply it into the MSP Xin?
> >
> > Or maybe better: Use the MSP with the 6MHz crystal and output MCLK to
> >
> > the FT2232. But if cost is not an issue, change the 32kHz to an 8MHz
> >
> > crystal (or add it). You should be able to generate 115200 with 1.6%
> >
> > error easyly.
> >
> >
> >
> > I seem to remember there are USB-232 chips that can optionaly be
> >
> > interfaced by an SPI bus instead of the UART. They are still virtual
> >
> > COM ports on the PC. Some even have JTAG interfaces. Will look into it
> >
> > when I get the time.
> >
> >
> >
> > Michael K.
> >
> >
> >
> > --- In msp430@yahoogroups. com, GB wrote:
> >
> > >
> >
> > > OK. I will explain. perhaps I can correct some things easier.
> >
> > >
> >
> > > I use an MSP430F1611 with a 32kHz crystal.
> >
> > > My UART is @ 115200.
> >
> > >
> >
> > > When I initialize the system I make the clock initialize to 4MHz:
> >
> > > TI_SetDCO(TI_ DCO_4MHZ) ;
> >
> > > This is using TI's code, which I'm pretty sure you know. So it's not
> >
> > 4MHz exactly, it's
> >
> > > DELTA*(4096) = 4001792 Hz.
> >
> > > I used this in the MSPGCC calculator for baud rate , and it tells me
> >
> > max error is 1.37%, but it's more than that.
> >
> > >
> >
> > > One issue is that I also don't have ROSC (and can't install one
> >
> > either so I'm making a new board) to lower the temperature dependence
> >
> > of the DCO.
> >
> > >
> >
> > > My UART routine is:
> >
> > > void UART_0_115200_ Setup()
> >
> > >
> >
> > > {
> >
> > > P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD
> >
> > >
> >
> > > BCSCTL1 |= DIVA_3; // ACLK= LFXT1CLK/8
> >
> > >
> >
> > > ME1 |= UTXE0 + URXE0; // Enabled USART0 TXD/RXD
> >
> > >
> >
> > > UCTL0 |= CHAR; // 8-bit character,
> SWRST = 1
> >
> > >
> >
> > > UTCTL0 |= SSEL1 + SSEL0 ; // UCLK = SMCLK, start edge
detect
> >
> > >
> >
> > > // For UART 0 Calculated using Baud rate generator found in mspgcc
> page
> >
> > >
> >
> > > UBR00 = 0x22;
> >
> > >
> >
> > > UBR10 = 0x00;
> >
> > >
> >
> > > UMCTL0 = 0xDD;
> >
> > >
> >
> > > UCTL0 &= ~SWRST; // Initialize USART state
> >
> > machine
> >
> > > IE1 |= URXIE0; // Enable USART0 RX
> interrupt
> >
> > >
> >
> > >
> >
> > >
> >
> > > }
> >
> > >
> >
> > > My circuitry is not very close to the MSP430. There are a couple of
> >
> > inches of distance.
> >
> > > Can this affect it? I guess crosstalk and other things could.
> >
> > Building a new circuit would allow me to eliminate all of this I
> >
> > guess, but I am always looking to improve my code also.
> >
> > >
> >
> > > RIght now I am not exactly using the telos configuration. I use the
> >
> > FT2232D with its two channels, one for BSL and another for UART.
> >
> > >
> >
> > > Since this board would be USB powered, power consumption isn't a
> >
> > concern.
> >
> > > Do you have any other info about the 7.3728MHz crystal. Do I need a
> >
> > specific load capacitance or ESR?
> >
> > >
> >
> > > Thanks a lot for your replies
> >
> > >
> >
> > > --- On Wed, 1/28/09, Candemir Orsan wrote:
> >
> > > From: Candemir Orsan
> >
> > > Subject: Re: [msp430] Low error UART communication MSP430F1611
> >
> > > To: msp430@yahoogroups. com
> >
> > > Date: Wednesday, January 28, 2009, 4:45 PM
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > You didn't explain the source/type of the errors you are
> >
> > seeing. Software? Hardware? Environment? (e.g temperature, noise,
> >
> > distance)?
> >
> > >
> >
> > >
> >
> > >
> >
> > > Unless you are going very long distances in a very noisy
> >
> > environment, even at 115.2Kb you shouldn't experience 'horrible'
errors.
> >
> > >
> >
> > >
> >
> > >
> >
> > > As A.K. suggested if power is not a concern and for whatever reason
> >
> > you must use an external Xtal, I would suggest going with a 7.3728MHz
> >
> > (or multiple) Xtal for most accurate baud rate generation.
> >
> > >
> >
> > >
> >
> > >
> >
> > > C.
> >
> > >
> >
> > >
> >
> > >
> >
> > > ____________ _________ _________ __
> >
> > >
> >
> > > From: Andreas Kke
> >
> > >
> >
> > > To: msp430@yahoogroups. com
> >
> > >
> >
> > > Sent: Wednesday, January 28, 2009 4:35:29 PM
> >
> > >
> >
> > > Subject: Re: [msp430] Low error UART communication MSP430F1611
> >
> > >
> >
> > >
> >
> > >
> >
> > > If you want to let it sleep but be able to communicate: use 9600
> >
> > bit/s from
> >
> > >
> >
> > > the 32kHz and initiate a handshake, then switch to 115200 from the
> MSPs
> >
> > >
> >
> > > internal oscillator via SMCLK. No extra crystals needed -- the high
> >
> > speed
> >
> > >
> >
> > > types do consume a lot of power.
> >
> > >
> >
> > >
> >
> > >
> >
> > > If power consumption is not an issue (which is likely in your case):
> >
> > leave the
> >
> > >
> >
> > > SMCLK always on at around 1MHz. 1MHz is fine for 115200 -- I had
> >
> > practically no
> >
> > >
> >
> > > errors here so far.
> >
> > >
> >
> > >
> >
> > >
> >
> > > BTW: errors at 115200 bit/s may also be due to the interrupt
> >
> > latency, a telos
> >
> > >
> >
> > > can not use the USART as duplex channel. Go for 57600 bit/s instead,
> >
> > or ensure
> >
> > >
> >
> > > simplex.
> >
> > >
> >
> > >
> >
> > >
> >
> > > Best, Andreas
> >
> > >
> >
> > >
> >
> > >
> >
> > > GB wrote:
> >
> > >
> >
> > > > Hey,
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > After some problems with the UART of 115200 with 32kHz (Yes, I
> >
> > know, it's
> >
> > >
> >
> > > > horrible) I am designing a new circuit to have a 8MHz crystal (or
> >
> > so) since
> >
> > >
> >
> > > > from what I understand that's the only way to really have very low
> >
> > errors.
> >
> > >
> >
> > > > I experienced horrible errors using just the 32kHz crystal. I
> >
> > would like to
> >
> > >
> >
> > > > have your opinions, since many of you are very experienced, what
> >
> > would be
> >
> > >
> >
> > > > the best: 1) Just an 8MHz crystal on the MSP430F1611 is enough?
> if so,
> >
> > >
> >
> > > > which kind (perhaps you know a part number or some technical
> >
> > specifications
> >
> > >
> >
> > > > such as load capacitance, accuracy, etc) 2) Should I just opt for
> >
> > another
> >
> > >
> >
> > > > MSP430 derivative with an FLL or more advanced clocks? Would the
> >
> > MSP430F5xx
> >
> > >
> >
> > > > family be good for this?
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > I really don't want to worry much about errors.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > The reason I am hesitant to leave the MSP430F1611 is because I am
> >
> > using the
> >
> > >
> >
> > > > BSL like a telos mote does: It uses a switch so that I can both
> >
> > use the BSL
> >
> > >
> >
> > > > and UART (it switches between the two). Therefore, would
> upgrading to
> >
> > >
> >
> > > > another MSP430 change my capabilities to use MSPGCC's invert pins
> >
> > and all
> >
> > >
> >
> > > > that that enables to program with BSL and use UART?
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > I realize this might be a bit complex, but any help from you
guys is
> >
> > >
> >
> > > > appreciated. Also, any pointers to any literature discussing
this is
> >
> > >
> >
> > > > appreciated as well.
> >
> > >
> >
> > > >
> >
> > >
> >
> > > > GB
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>

Beginning Microcontrollers with the MSP430

thanks a lot Michael.

--- On Fri, 1/30/09, tintronic wrote:
From: tintronic
Subject: [msp430] Re: Low error UART communication MSP430F1611
To: m...
Date: Friday, January 30, 2009, 8:34 AM


> I saw an application note that explains this very clearly, but I

> can't find it now. I'll see if I find it tomorrow.

And here it is, a 2 page Design Note with what you need to know when

designing with crystals:

http://www.foxonlin e.com/pdfs/ xtaldesignnotes. pdf

Michael K.

--- In msp430@yahoogroups. com, "tintronic" wrote:

>

> > I haven't been able to find information about the load capacitance.

> > I checked the MSP430F1611 datasheet but all it says is to use

> > capacitors as recommended by crystal manufacturer and that the

> > mp430f1611 has 2pF input capacitance.

>

> Load capacitance is a value given by the crystal manufacturer, not by

> the MSP. It is the capacitance the crystal needs to operate in the

> given frequency. Crystal manufacturers usually provide an application

> note explaining how to calculate the right capacitor values for any

> crystal giving how they are connected (serial or parallel capacitors).

>

> > Do I need any external capacitors?

> Yes, you almos always do. Some chips provide an internal capacitance

> which is high enought for some crystals. For example, the MSP430x1xx

> provides two 12pF capacitors connected serially to the Xin Xout pins

> when in Low Frequency mode, for watch crystals. If your capacitor

> needs a higher value, you have to connect more capacitors.

> But for high frequency crystals the MSP does not provide internal

> capacitors, so you need to connect the right value for the crystal

> you're using, considering track capacitance and crystal port input

> capacitance.

>

> I saw an application note that explains this very clearly, but I can't

> find it now. I'll see if I find it tomorrow.

>

> Michael K.

>

> --- In msp430@yahoogroups. com, GB wrote:

> >

> > The code I use uses the 32768Hz crystal to set the DCO. The

> calibration constants are (I believe) on MSP430F2Xxx or so derivatives.

> >

> > I am going to start from the bottoms up, checking my crystal that I

> do have.

> >

> > I did take into account the 6pF load capacitance (I knew one day it

> would be useful to be extra vigilant about things), but I will measure

> the frequency using a good oscilloscope.

> >

> > However, I seem to be set on using the 7.3728MHz crystal which seems

> to be the best solution since power isn't an issue. I haven't been

> able to find information about the load capacitance. I checked the

> MSP430F1611 datasheet but all it says is to use capacitors as

> recommended by crystal manufacturer and that the mp430f1611 has 2pF

> input capacitance.

> >

> > Does anyone know the load capacitance? mouser offers 10,16,18 and 20

> pF .

> > Do I need any external capacitors?

> >

> > Thanks a lot for all your responses.

> >

> > --- On Wed, 1/28/09, tintronic wrote:

> > From: tintronic

> > Subject: [msp430] Re: Low error UART communication MSP430F1611

> > To: msp430@yahoogroups. com

> > Date: Wednesday, January 28, 2009, 6:07 PM

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> > > When I initialize the system I make the clock

> initialize to 4MHz:

> >

> > > TI_SetDCO(TI_ DCO_4MHZ) ;

> >

> > > This is using TI's code, which I'm pretty sure you know.

> >

> >

> >

> > I don't know which code you're referring to. Does it use calibration

> >

> > data stored in flash or does it use the 32,768 Hz crystal to generate

> >

> > the 4,001,792Hz? If it is the latest, did you measure the accuracy of

> >

> > the 32kHz crystal? If you're not using the exact same capacitor load

> >

> > and/or have not taken the 6pf load of the MSP430F16x into account, you

> >

> > won't get the ppm that the crystal vendor specifies, making your baud

> >

> > rate error will be much higher.

> >

> >

> >

> > Can't you use the FT2232 Xout signal and supply it into the MSP Xin?

> >

> > Or maybe better: Use the MSP with the 6MHz crystal and output MCLK to

> >

> > the FT2232. But if cost is not an issue, change the 32kHz to an 8MHz

> >

> > crystal (or add it). You should be able to generate 115200 with 1.6%

> >

> > error easyly.

> >

> >

> >

> > I seem to remember there are USB-232 chips that can optionaly be

> >

> > interfaced by an SPI bus instead of the UART. They are still virtual

> >

> > COM ports on the PC. Some even have JTAG interfaces. Will look into it

> >

> > when I get the time.

> >

> >

> >

> > Michael K.

> >

> >

> >

> > --- In msp430@yahoogroups. com, GB wrote:

> >

> > >

> >

> > > OK. I will explain. perhaps I can correct some things easier.

> >

> > >

> >

> > > I use an MSP430F1611 with a 32kHz crystal.

> >

> > > My UART is @ 115200.

> >

> > >

> >

> > > When I initialize the system I make the clock initialize to 4MHz:

> >

> > > TI_SetDCO(TI_ DCO_4MHZ) ;

> >

> > > This is using TI's code, which I'm pretty sure you know. So it's not

> >

> > 4MHz exactly, it's

> >

> > > DELTA*(4096) = 4001792 Hz.

> >

> > > I used this in the MSPGCC calculator for baud rate , and it tells me

> >

> > max error is 1.37%, but it's more than that.

> >

> > >

> >

> > > One issue is that I also don't have ROSC (and can't install one

> >

> > either so I'm making a new board) to lower the temperature dependence

> >

> > of the DCO.

> >

> > >

> >

> > > My UART routine is:

> >

> > > void UART_0_115200_ Setup()

> >

> > >

> >

> > > {

> >

> > > P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD

> >

> > >

> >

> > > BCSCTL1 |= DIVA_3; // ACLK= LFXT1CLK/8

> >

> > >

> >

> > > ME1 |= UTXE0 + URXE0; // Enabled USART0 TXD/RXD

> >

> > >

> >

> > > UCTL0 |= CHAR; // 8-bit character,

> SWRST = 1

> >

> > >

> >

> > > UTCTL0 |= SSEL1 + SSEL0 ; // UCLK = SMCLK, start edge

detect

> >

> > >

> >

> > > // For UART 0 Calculated using Baud rate generator found in mspgcc

> page

> >

> > >

> >

> > > UBR00 = 0x22;

> >

> > >

> >

> > > UBR10 = 0x00;

> >

> > >

> >

> > > UMCTL0 = 0xDD;

> >

> > >

> >

> > > UCTL0 &= ~SWRST; // Initialize USART state

> >

> > machine

> >

> > > IE1 |= URXIE0; // Enable USART0 RX

> interrupt

> >

> > >

> >

> > >

> >

> > >

> >

> > > }

> >

> > >

> >

> > > My circuitry is not very close to the MSP430. There are a couple of

> >

> > inches of distance.

> >

> > > Can this affect it? I guess crosstalk and other things could.

> >

> > Building a new circuit would allow me to eliminate all of this I

> >

> > guess, but I am always looking to improve my code also.

> >

> > >

> >

> > > RIght now I am not exactly using the telos configuration. I use the

> >

> > FT2232D with its two channels, one for BSL and another for UART.

> >

> > >

> >

> > > Since this board would be USB powered, power consumption isn't a

> >

> > concern.

> >

> > > Do you have any other info about the 7.3728MHz crystal. Do I need a

> >

> > specific load capacitance or ESR?

> >

> > >

> >

> > > Thanks a lot for your replies

> >

> > >

> >

> > > --- On Wed, 1/28/09, Candemir Orsan wrote:

> >

> > > From: Candemir Orsan

> >

> > > Subject: Re: [msp430] Low error UART communication MSP430F1611

> >

> > > To: msp430@yahoogroups. com

> >

> > > Date: Wednesday, January 28, 2009, 4:45 PM

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > > You didn't explain the source/type of the errors you are

> >

> > seeing. Software? Hardware? Environment? (e.g temperature, noise,

> >

> > distance)?

> >

> > >

> >

> > >

> >

> > >

> >

> > > Unless you are going very long distances in a very noisy

> >

> > environment, even at 115.2Kb you shouldn't experience 'horrible'

errors.

> >

> > >

> >

> > >

> >

> > >

> >

> > > As A.K. suggested if power is not a concern and for whatever reason

> >

> > you must use an external Xtal, I would suggest going with a 7.3728MHz

> >

> > (or multiple) Xtal for most accurate baud rate generation.

> >

> > >

> >

> > >

> >

> > >

> >

> > > C.

> >

> > >

> >

> > >

> >

> > >

> >

> > > ____________ _________ _________ __

> >

> > >

> >

> > > From: Andreas Kke

> >

> > >

> >

> > > To: msp430@yahoogroups. com

> >

> > >

> >

> > > Sent: Wednesday, January 28, 2009 4:35:29 PM

> >

> > >

> >

> > > Subject: Re: [msp430] Low error UART communication MSP430F1611

> >

> > >

> >

> > >

> >

> > >

> >

> > > If you want to let it sleep but be able to communicate: use 9600

> >

> > bit/s from

> >

> > >

> >

> > > the 32kHz and initiate a handshake, then switch to 115200 from the

> MSPs

> >

> > >

> >

> > > internal oscillator via SMCLK. No extra crystals needed -- the high

> >

> > speed

> >

> > >

> >

> > > types do consume a lot of power.

> >

> > >

> >

> > >

> >

> > >

> >

> > > If power consumption is not an issue (which is likely in your case):

> >

> > leave the

> >

> > >

> >

> > > SMCLK always on at around 1MHz. 1MHz is fine for 115200 -- I had

> >

> > practically no

> >

> > >

> >

> > > errors here so far.

> >

> > >

> >

> > >

> >

> > >

> >

> > > BTW: errors at 115200 bit/s may also be due to the interrupt

> >

> > latency, a telos

> >

> > >

> >

> > > can not use the USART as duplex channel. Go for 57600 bit/s instead,

> >

> > or ensure

> >

> > >

> >

> > > simplex.

> >

> > >

> >

> > >

> >

> > >

> >

> > > Best, Andreas

> >

> > >

> >

> > >

> >

> > >

> >

> > > GB wrote:

> >

> > >

> >

> > > > Hey,

> >

> > >

> >

> > > >

> >

> > >

> >

> > > > After some problems with the UART of 115200 with 32kHz (Yes, I

> >

> > know, it's

> >

> > >

> >

> > > > horrible) I am designing a new circuit to have a 8MHz crystal (or

> >

> > so) since

> >

> > >

> >

> > > > from what I understand that's the only way to really have very low

> >

> > errors.

> >

> > >

> >

> > > > I experienced horrible errors using just the 32kHz crystal. I

> >

> > would like to

> >

> > >

> >

> > > > have your opinions, since many of you are very experienced, what

> >

> > would be

> >

> > >

> >

> > > > the best: 1) Just an 8MHz crystal on the MSP430F1611 is enough?

> if so,

> >

> > >

> >

> > > > which kind (perhaps you know a part number or some technical

> >

> > specifications

> >

> > >

> >

> > > > such as load capacitance, accuracy, etc) 2) Should I just opt for

> >

> > another

> >

> > >

> >

> > > > MSP430 derivative with an FLL or more advanced clocks? Would the

> >

> > MSP430F5xx

> >

> > >

> >

> > > > family be good for this?

> >

> > >

> >

> > > >

> >

> > >

> >

> > > > I really don't want to worry much about errors.

> >

> > >

> >

> > > >

> >

> > >

> >

> > > > The reason I am hesitant to leave the MSP430F1611 is because I am

> >

> > using the

> >

> > >

> >

> > > > BSL like a telos mote does: It uses a switch so that I can both

> >

> > use the BSL

> >

> > >

> >

> > > > and UART (it switches between the two). Therefore, would

> upgrading to

> >

> > >

> >

> > > > another MSP430 change my capabilities to use MSPGCC's invert pins

> >

> > and all

> >

> > >

> >

> > > > that that enables to program with BSL and use UART?

> >

> > >

> >

> > > >

> >

> > >

> >

> > > > I realize this might be a bit complex, but any help from you

guys is

> >

> > >

> >

> > > > appreciated. Also, any pointers to any literature discussing

this is

> >

> > >

> >

> > > > appreciated as well.

> >

> > >

> >

> > > >

> >

> > >

> >

> > > > GB

> >

> > >

> >

> > > >

> >

> > >

> >

> > > >

> >

> > >

> >

> > > >

> >

> > >

> >

> > > >

> >

> > >

> >

> > > >

> >

> > >

> >

> > > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> > >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

> >

>
















Candemir,
I below you mentioned you used an msp430 at 4MHz. Which MSP430 derivative did you use?

Thank you
--- On Thu, 1/29/09, Candemir Orsan wrote:
From: Candemir Orsan
Subject: Re: [msp430] Re: Low error UART communication MSP430F1611
To: m...
Date: Thursday, January 29, 2009, 12:08 PM


I'm still not convinced the 32K crystal is the source of your problems. You didn't explain the nature of the errors..(bit errors, frame errors?)

One project that I finished recently has exactly the same setup you have: MSP430 hooked up to 32K crystal used to lock the DCO to ~4MHz and UART comm at 115.2K to a USB-to-VCOM IC. No noticable errors. This system streams out data continiously; as well as being able to upload MBs of logged data to the PC.

Have you confirmed the DCO frequency out of the micro by bringing out the MCLK signal to one of the pins?

When I needed to use the extarnal XTAL2 crystal, I've used the 7.3728 MHz part from DigiKey. I don't remember the part number, but the spec'ed load capacitance was 20pf. And I used 33pf caps on both sides of the actual xtal.

C.

____________ _________ _________ __

From: GB

To: msp430@yahoogroups. com

Sent: Wednesday, January 28, 2009 6:22:40 PM

Subject: Re: [msp430] Re: Low error UART communication MSP430F1611

The code I use uses the 32768Hz crystal to set the DCO. The calibration constants are (I believe) on MSP430F2Xxx or so derivatives.

I am going to start from the bottoms up, checking my crystal that I do have.

I did take into account the 6pF load capacitance (I knew one day it would be useful to be extra vigilant about things), but I will measure the frequency using a good oscilloscope.

However, I seem to be set on using the 7.3728MHz crystal which seems to be the best solution since power isn't an issue. I haven't been able to find information about the load capacitance. I checked the MSP430F1611 datasheet but all it says is to use capacitors as recommended by crystal manufacturer and that the mp430f1611 has 2pF input capacitance.

Does anyone know the load capacitance? mouser offers 10,16,18 and 20 pF .

Do I need any external capacitors?

Thanks a lot for all your responses.

--- On Wed, 1/28/09, tintronic wrote:

From: tintronic

Subject: [msp430] Re: Low error UART communication MSP430F1611

To: msp430@yahoogroups. com

Date: Wednesday, January 28, 2009, 6:07 PM

> When I initialize the system I make the clock initialize to 4MHz:

> TI_SetDCO(TI_ DCO_4MHZ) ;

> This is using TI's code, which I'm pretty sure you know.

I don't know which code you're referring to. Does it use calibration

data stored in flash or does it use the 32,768 Hz crystal to generate

the 4,001,792Hz? If it is the latest, did you measure the accuracy of

the 32kHz crystal? If you're not using the exact same capacitor load

and/or have not taken the 6pf load of the MSP430F16x into account, you

won't get the ppm that the crystal vendor specifies, making your baud

rate error will be much higher.

Can't you use the FT2232 Xout signal and supply it into the MSP Xin?

Or maybe better: Use the MSP with the 6MHz crystal and output MCLK to

the FT2232. But if cost is not an issue, change the 32kHz to an 8MHz

crystal (or add it). You should be able to generate 115200 with 1.6%

error easyly.

I seem to remember there are USB-232 chips that can optionaly be

interfaced by an SPI bus instead of the UART. They are still virtual

COM ports on the PC. Some even have JTAG interfaces. Will look into it

when I get the time.

Michael K.

--- In msp430@yahoogroups. com, GB wrote:

>

> OK. I will explain. perhaps I can correct some things easier.

>

> I use an MSP430F1611 with a 32kHz crystal.

> My UART is @ 115200.

>

> When I initialize the system I make the clock initialize to 4MHz:

> TI_SetDCO(TI_ DCO_4MHZ) ;

> This is using TI's code, which I'm pretty sure you know. So it's not

4MHz exactly, it's

> DELTA*(4096) = 4001792 Hz.

> I used this in the MSPGCC calculator for baud rate , and it tells me

max error is 1.37%, but it's more than that.

>

> One issue is that I also don't have ROSC (and can't install one

either so I'm making a new board) to lower the temperature dependence

of the DCO.

>

> My UART routine is:

> void UART_0_115200_ Setup()

>

> {

> P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD

>

> BCSCTL1 |= DIVA_3; // ACLK= LFXT1CLK/8

>

> ME1 |= UTXE0 + URXE0; // Enabled USART0 TXD/RXD

>

> UCTL0 |= CHAR; // 8-bit character, SWRST = 1

>

> UTCTL0 |= SSEL1 + SSEL0 ; // UCLK = SMCLK, start edge detect

>

> // For UART 0 Calculated using Baud rate generator found in mspgcc page

>

> UBR00 = 0x22;

>

> UBR10 = 0x00;

>

> UMCTL0 = 0xDD;

>

> UCTL0 &= ~SWRST; // Initialize USART state

machine

> IE1 |= URXIE0; // Enable USART0 RX interrupt

>

>

>

> }

>

> My circuitry is not very close to the MSP430. There are a couple of

inches of distance.

> Can this affect it? I guess crosstalk and other things could.

Building a new circuit would allow me to eliminate all of this I

guess, but I am always looking to improve my code also.

>

> RIght now I am not exactly using the telos configuration. I use the

FT2232D with its two channels, one for BSL and another for UART.

>

> Since this board would be USB powered, power consumption isn't a

concern.

> Do you have any other info about the 7.3728MHz crystal. Do I need a

specific load capacitance or ESR?

>

> Thanks a lot for your replies

>

> --- On Wed, 1/28/09, Candemir Orsan wrote:

> From: Candemir Orsan

> Subject: Re: [msp430] Low error UART communication MSP430F1611

> To: msp430@yahoogroups. com

> Date: Wednesday, January 28, 2009, 4:45 PM

>

>

>

>

>

>

>

>

>

>

>

> You didn't explain the source/type of the errors you are

seeing. Software? Hardware? Environment? (e.g temperature, noise,

distance)?

>

>

>

> Unless you are going very long distances in a very noisy

environment, even at 115.2Kb you shouldn't experience 'horrible' errors.

>

>

>

> As A.K. suggested if power is not a concern and for whatever reason

you must use an external Xtal, I would suggest going with a 7.3728MHz

(or multiple) Xtal for most accurate baud rate generation.

>

>

>

> C.

>

>

>

> ____________ _________ _________ __

>

> From: Andreas Kke

>

> To: msp430@yahoogroups. com

>

> Sent: Wednesday, January 28, 2009 4:35:29 PM

>

> Subject: Re: [msp430] Low error UART communication MSP430F1611

>

>

>

> If you want to let it sleep but be able to communicate: use 9600

bit/s from

>

> the 32kHz and initiate a handshake, then switch to 115200 from the MSPs

>

> internal oscillator via SMCLK. No extra crystals needed -- the high

speed

>

> types do consume a lot of power.

>

>

>

> If power consumption is not an issue (which is likely in your case):

leave the

>

> SMCLK always on at around 1MHz. 1MHz is fine for 115200 -- I had

practically no

>

> errors here so far.

>

>

>

> BTW: errors at 115200 bit/s may also be due to the interrupt

latency, a telos

>

> can not use the USART as duplex channel. Go for 57600 bit/s instead,

or ensure

>

> simplex.

>

>

>

> Best, Andreas

>

>

>

> GB wrote:

>

> > Hey,

>

> >

>

> > After some problems with the UART of 115200 with 32kHz (Yes, I

know, it's

>

> > horrible) I am designing a new circuit to have a 8MHz crystal (or

so) since

>

> > from what I understand that's the only way to really have very low

errors.

>

> > I experienced horrible errors using just the 32kHz crystal. I

would like to

>

> > have your opinions, since many of you are very experienced, what

would be

>

> > the best: 1) Just an 8MHz crystal on the MSP430F1611 is enough? if so,

>

> > which kind (perhaps you know a part number or some technical

specifications

>

> > such as load capacitance, accuracy, etc) 2) Should I just opt for

another

>

> > MSP430 derivative with an FLL or more advanced clocks? Would the

MSP430F5xx

>

> > family be good for this?

>

> >

>

> > I really don't want to worry much about errors.

>

> >

>

> > The reason I am hesitant to leave the MSP430F1611 is because I am

using the

>

> > BSL like a telos mote does: It uses a switch so that I can both

use the BSL

>

> > and UART (it switches between the two). Therefore, would upgrading to

>

> > another MSP430 change my capabilities to use MSPGCC's invert pins

and all

>

> > that that enables to program with BSL and use UART?

>

> >

>

> > I realize this might be a bit complex, but any help from you guys is

>

> > appreciated. Also, any pointers to any literature discussing this is

>

> > appreciated as well.

>

> >

>

> > GB

>

> >

>

> >

>

> >

>

> >

>

> >

>

> >

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>




















GB,

I agree with Candemir. If you use software FLL to constantly adjust
the DCO to a multiple of the 32.768kHz crystal, you should not have
any problem with high BAUD. I have used this method for many different
MSP430, including F1611; they all work very well.

I use 32.768*225s72.8kHz. But if you do not have Rosc, you could use
(32.768/2)*225686.4kHz

Note that if you only setup DCO to a multiple of the crystal clock
instead of constantly adjust it, the DCO frequency may drift away
afterwords.

==OCY

--- In m..., GB wrote:
>
> Candemir,
> I below you mentioned you used an msp430 at 4MHz. Which MSP430
derivative did you use?
>
> Thank you
>
> --- On Thu, 1/29/09, Candemir Orsan wrote:
> From: Candemir Orsan
> Subject: Re: [msp430] Re: Low error UART communication MSP430F1611
> To: m...
> Date: Thursday, January 29, 2009, 12:08 PM
>
> I'm still not convinced the 32K crystal is the source of
your problems. You didn't explain the nature of the errors..(bit
errors, frame errors?)
>
> One project that I finished recently has exactly the same setup you
have: MSP430 hooked up to 32K crystal used to lock the DCO to ~4MHz
and UART comm at 115.2K to a USB-to-VCOM IC. No noticable errors. This
system streams out data continiously; as well as being able to upload
MBs of logged data to the PC.
>
> Have you confirmed the DCO frequency out of the micro by bringing
out the MCLK signal to one of the pins?
>
> When I needed to use the extarnal XTAL2 crystal, I've used the
7.3728 MHz part from DigiKey. I don't remember the part number, but
the spec'ed load capacitance was 20pf. And I used 33pf caps on both
sides of the actual xtal.
>
> C.
> ____________ _________ _________ __


Memfault State of IoT Report