EmbeddedRelated.com
Forums

UART0 with (8bit data+stop bit) protocol

Started by joseramonsg_2 October 13, 2003
Hi all!
I'm using UART0 to stablish a serial communication between my 
MSP430F149 and an external GPS chip. This chip needs a (8-bit 
data+1stop bit) protocol at 19200 bps (my MCLK=SMCLK clock is 8MHz). 
I've configured the UART0 to this rate, but now I have a doubt when 
transmitting a data string using it. TXBUF0 transmits packets of 
8bits maximum, isn't it? Then, shall I divide my string in 7-bit 
groups, add a stop bit at each group, and transmit the 8-bit packets? 
But, would de external chip understand this if it needs a 8-bit+1stop 
bit protocol?
Please, could you help me? I'm new to UART use and I don't know how 
to do it. Have you got any example?
Here I add my configuration code.
Thank you very much!
Jose R.

void UART0_configuracion (void)
{
  
  WDTCTL = WDTPW + WDTHOLD;
  UCTL0 |= SWRST;   
  ME1 |= UTXE0 + URXE0;      
  UCTL0 = CHAR;       
  UTCTL0 = SSEL1;  
  UBR00 = 0xA0;	
  UBR10 = 0x01;           
  UMCTL0 = 0x5B;   
  P3SEL |= 0x30
  P3DIR |= 0x10
  UCTL0 &= ~SWRST
}


Beginning Microcontrollers with the MSP430

Hi Jose,
please find below code examples from ti web site,
fet140_uart01_02400.s43 - USART0 UART 2400 Ultra-low
Power Echo ISR, 32kHz ACLK 
fet140_uart01_09600.s43 - USART0 UART 9600 Echo ISR,
HF XTAL ACCLK 
fet140_uart01_19200.s43 - USART0 UART 19200 Echo ISR,
HF XTAL ACLK 
fet140_uart01_0115k.s43 - USART0 UART 115200 Echo ISR,
HF XTAL ACLK 
fet140_uart11_02400.s43 - USART1 UART 2400 Ultra-low
Power Echo ISR, 32kHz ACLK 
fet140_uart11_09600.s43 - USART1 UART 9600 Echo ISR,
HF XTAL ACCLK 
fet140_uart11_19200_2.s43 - USART1 UART 19200 Echo
ISR, XT2 HF XTAL SMCLK 
fet140_uart11_0115k_2.s43 - USART1 UART 115200 Echo
ISR, XT2 HF XTAL SMCLK 

and link is
http://focus.ti.com/analog/docs/analoggencontent.tsp?templateIdR46&navigationId032&familyId42&path=templatedata/cm/general/data/200209msp430codeexamples

you can find 8data bit mode code examples from here.

i hope this will help you.

rgds....
naveena


--- joseramonsg_2 <joseramonsg_2@jose...> wrote:
> Hi all!
> I'm using UART0 to stablish a serial communication
> between my 
> MSP430F149 and an external GPS chip. This chip needs
> a (8-bit 
> data+1stop bit) protocol at 19200 bps (my MCLK=SMCLK
> clock is 8MHz). 
> I've configured the UART0 to this rate, but now I
> have a doubt when 
> transmitting a data string using it. TXBUF0
> transmits packets of 
> 8bits maximum, isn't it? Then, shall I divide my
> string in 7-bit 
> groups, add a stop bit at each group, and transmit
> the 8-bit packets? 
> But, would de external chip understand this if it
> needs a 8-bit+1stop 
> bit protocol?
> Please, could you help me? I'm new to UART use and I
> don't know how 
> to do it. Have you got any example?
> Here I add my configuration code.
> Thank you very much!
> Jose R.
> 
> void UART0_configuracion (void)
> {
>   
>   WDTCTL = WDTPW + WDTHOLD;
>   UCTL0 |= SWRST;   
>   ME1 |= UTXE0 + URXE0;      
>   UCTL0 = CHAR;       
>   UTCTL0 = SSEL1;  
>   UBR00 = 0xA0;	
>   UBR10 = 0x01;           
>   UMCTL0 = 0x5B;   
>   P3SEL |= 0x30
>   P3DIR |= 0x10
>   UCTL0 &= ~SWRST
> }
> 
> 
> ------------------------ Yahoo! Groups Sponsor
> 
> .
> 
>  
> 
> ">http://docs.yahoo.com/info/terms/ 
> 
> 


__________________________________


Hi, Naveena.
Thank you for your answer, but I had already seen those files. The 
problem is that in them, the UART is used in an echo mode... the 
reception is replicated in the transmission. But they don't show any 
example on how to fill the Tx with "8-bit data+1 stop bit"
packets, 
which was the subject of my question.
Have you got any other example?
Thenk you very much!
Jose R.



--- In msp430@msp4..., Naveena Padmaraju <naveenap007@y...> 
wrote:
> Hi Jose,
> please find below code examples from ti web site,
> fet140_uart01_02400.s43 - USART0 UART 2400 Ultra-low
> Power Echo ISR, 32kHz ACLK 
> fet140_uart01_09600.s43 - USART0 UART 9600 Echo ISR,
> HF XTAL ACCLK 
> fet140_uart01_19200.s43 - USART0 UART 19200 Echo ISR,
> HF XTAL ACLK 
> fet140_uart01_0115k.s43 - USART0 UART 115200 Echo ISR,
> HF XTAL ACLK 
> fet140_uart11_02400.s43 - USART1 UART 2400 Ultra-low
> Power Echo ISR, 32kHz ACLK 
> fet140_uart11_09600.s43 - USART1 UART 9600 Echo ISR,
> HF XTAL ACCLK 
> fet140_uart11_19200_2.s43 - USART1 UART 19200 Echo
> ISR, XT2 HF XTAL SMCLK 
> fet140_uart11_0115k_2.s43 - USART1 UART 115200 Echo
> ISR, XT2 HF XTAL SMCLK 
> 
> and link is
> http://focus.ti.com/analog/docs/analoggencontent.tsp?
templateIdR46&navigationId032&familyId42&path=templatedata/cm/g
eneral/data/200209msp430codeexamples
> 
> you can find 8data bit mode code examples from here.
> 
> i hope this will help you.
> 
> rgds....
> naveena
> 
> 
> --- joseramonsg_2 <joseramonsg_2@y...> wrote:
> > Hi all!
> > I'm using UART0 to stablish a serial communication
> > between my 
> > MSP430F149 and an external GPS chip. This chip needs
> > a (8-bit 
> > data+1stop bit) protocol at 19200 bps (my MCLK=SMCLK
> > clock is 8MHz). 
> > I've configured the UART0 to this rate, but now I
> > have a doubt when 
> > transmitting a data string using it. TXBUF0
> > transmits packets of 
> > 8bits maximum, isn't it? Then, shall I divide my
> > string in 7-bit 
> > groups, add a stop bit at each group, and transmit
> > the 8-bit packets? 
> > But, would de external chip understand this if it
> > needs a 8-bit+1stop 
> > bit protocol?
> > Please, could you help me? I'm new to UART use and I
> > don't know how 
> > to do it. Have you got any example?
> > Here I add my configuration code.
> > Thank you very much!
> > Jose R.
> > 
> > void UART0_configuracion (void)
> > {
> >   
> >   WDTCTL = WDTPW + WDTHOLD;
> >   UCTL0 |= SWRST;   
> >   ME1 |= UTXE0 + URXE0;      
> >   UCTL0 = CHAR;       
> >   UTCTL0 = SSEL1;  
> >   UBR00 = 0xA0;	
> >   UBR10 = 0x01;           
> >   UMCTL0 = 0x5B;   
> >   P3SEL |= 0x30
> >   P3DIR |= 0x10
> >   UCTL0 &= ~SWRST
> > }
> > 
> > 
> > ------------------------ Yahoo! Groups Sponsor
> > 
> > .
> > 
> >  
> > 
> > ">http://docs.yahoo.com/info/terms/ 
> > 
> > 
> 
> 
> __________________________________
>