EmbeddedRelated.com
Forums

Multiplexing between SPI/UART on USART0

Started by larstoref March 17, 2005

I am using a MSP430F149 on a Olimex developing board. I have a serial
dataflash and my rs232 connected to the USART0, and i want to
multiplex between those.

Im doing something like this:

initUart0();
uart0_tx();
initSPI0();
spi0_rx();
initUart0();
uart0_tx();

The first transmission on the uart is ok, then i change to spi, and
get some data from the serial flash. Then i switch back to the Uart,
but i only get "junk"....(if i write "hello world" i get
lots of
strange characters....

anyone know what i might do wrong? im not sure the multiplexing have
anything to do with it...but it is strange since the uart works
perfectly well the first time, but not the second time after
multiplexing with the spi...








Beginning Microcontrollers with the MSP430

I've had some quality issues with the manufacturing
of an older version of the Olimex (yet very affordable)
boards...  Crystal leads soldered together drove a newbe
like me insane.

Brad

___

Bradley A. Singletary

On Thu, 17 Mar 2005, larstoref wrote:

>
>
> I am using a MSP430F149 on a Olimex developing board. I have a serial
> dataflash and my rs232 connected to the USART0, and i want to
> multiplex between those.
>
> Im doing something like this:
>
> initUart0();
> uart0_tx();
> initSPI0();
> spi0_rx();
> initUart0();
> uart0_tx();
>
> The first transmission on the uart is ok, then i change to spi, and
> get some data from the serial flash. Then i switch back to the Uart,
> but i only get "junk"....(if i write "hello world" i
get lots of
> strange characters....
>
> anyone know what i might do wrong? im not sure the multiplexing have
> anything to do with it...but it is strange since the uart works
> perfectly well the first time, but not the second time after
> multiplexing with the spi...
>
>
>
>
>
>
>
>
>
> .
>
>
>
>
> 
> click here
> [rand6129355]
>
>
________________________________________________________________________________
> .
>
>




I figured it out myself. It seems like you have to be very careful
when you multiplex using the same registers, because a SWRST when you
reinitiate doesnt clear all register values and you have to clear them
manually so you dont get odd behaviour.

I havent had any problems with the board from olimex yet. im a newbie
too so i might havnt recognized it yet ;)

--- In msp430@msp4..., "<Bradley A. Singletary>"
<bas@c...> wrote:
> 
> I've had some quality issues with the manufacturing
> of an older version of the Olimex (yet very affordable)
> boards...  Crystal leads soldered together drove a newbe
> like me insane.
> 
> Brad
> 
> ___
> 
> Bradley A. Singletary
> 
> On Thu, 17 Mar 2005, larstoref wrote:
> 
> >
> >
> > I am using a MSP430F149 on a Olimex developing board. I have a serial
> > dataflash and my rs232 connected to the USART0, and i want to
> > multiplex between those.
> >
> > Im doing something like this:
> >
> > initUart0();
> > uart0_tx();
> > initSPI0();
> > spi0_rx();
> > initUart0();
> > uart0_tx();
> >
> > The first transmission on the uart is ok, then i change to spi, and
> > get some data from the serial flash. Then i switch back to the Uart,
> > but i only get "junk"....(if i write "hello world"
i get lots of
> > strange characters....
> >
> > anyone know what i might do wrong? im not sure the multiplexing have
> > anything to do with it...but it is strange since the uart works
> > perfectly well the first time, but not the second time after
> > multiplexing with the spi...
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > .
> >
> >
> >
> >
> > 
> > click here
> > [rand6129355]
> >
> >
________________________________________________________________________________
> > Yahoo! Groups Links
> >  *  To visit your group on the web, go to:
> >     http://groups.yahoo.com/group/msp430/
> >
> >  *  .
> >
> >  *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
> >
> >