UART communications problem.
Company  
ST Home | Microcontrollers

Index  »  ARM7 STR7  »  UART communications problem.
     
   UART communications problem.
 Moderated by :   »  AnisAS  -  coucou

Author
beginning argument    ( Replies received: 1 )
daniel1   Posted 29-09-2008 at 09:38   



Registered on :
11-14-2009

Messages : 8

 OFF-Line

UART communications problem.
Hi.
I have a little strange problem with my STR750 evaluation board. I have connected the UART0 with a null modem to my computer. Made a simple code for sending data through UART but after a few ms I can’t receive anything but zeroes on my computer.

My code:
int main()
{
#ifdef DEBUG
debug();
#endif

/* Configure the system clocks */
MRCC_Configuration();

/* Configure the GPIO ports */
GPIO_Configuration();

/* UART0 configuration ----*/
UART_InitStructure.UART_WordLength = UART_WordLength_8D;
UART_InitStructure.UART_StopBits = UART_StopBits_1;
UART_InitStructure.UART_Parity = UART_Parity_No;
UART_InitStructure.UART_BaudRate = 9600;
UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_CTS;
UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx;
UART_InitStructure.UART_FIFO = UART_FIFO_Enable;
UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */

UART_Init(UART0, &UART_InitStructure);

UART_Cmd(UART0, ENABLE);

//Send 0x44
SendData(0x44);
while(1){
if (!GPIO_ReadBit(GPIO1, GPIO_Pin_5)) { //If button down

//Send data
SendData(0x55);
delays(100000);
}
}
}



//Send function:
void SendData(u8 Data){
UART_SendData(UART0, Data);
while(UART_GetFlagStatus(UART0, UART_FLAG_TxFIFOFull) != RESET);

}

Can anyone see what’s wrong?
I’m using Keil µVision, and have tried some examples but with same outcome.

[ This message was edited by: daniel1 on 29-09-2008 09:41 ]



 Profile   Quote  
daniel1   Posted 01-10-2008 at 13:12   



Registered on :
11-14-2009

Messages : 8

 OFF-Line

I found the solution.
I have included the wrong library...



 Profile   Quote  
On Top

Search in the forums
 
Jump To