2011-12-12 08:44 AM
Hi,
I'd like to connect STM32VLDiscovery to my laptop USB via USART.Everywhere I see that to have RS232 on board it is not sufficient to connect USART pins with DB9 connector. RS232 <-> TTL converter is needed (like MAX3232). But if I want connect only to laptop USB (don't need higher voltage than 5V) and I have USB<-> RS232 cable based on Prolific PL-2303. Isn't it enough to connect DB9 directly to Discovery?#rs232-discovery-max3232-usart
2011-12-12 11:13 AM
You need something like this, which does CMOS SERIAL, not RS232
http://www.dlpdesign.com/usb/txrx.shtml2011-12-12 11:34 AM
2011-12-12 12:09 PM
It base on FT232R, which converts RS232 to USB, PL-2303 do the same. Why I need exactly FT232R ?
IT DOES NOT DO RS232 LEVEL SIGNALLING, AND CAN USE 3V SIGNALLING, I DO NOT KNOW WHAT YOUR CABLE DOES, YOU HAVE NOT PROVIDED A SPECIFIC CITE OR DATASHEET. THE STANDALONE PL-2303 ALSO DOES NOT DO RS232 LEVEL SIGNALLING EITHER, AND COULD BE ''LIKE'' THE BOARD I SUGGESTED, WHICH IS ''KNOWN TO WORK''.
2011-12-12 01:48 PM
2011-12-13 02:43 PM
''there is no documentation''
If there is no documentation, and you are unable to test it yourself, then just get rid of it - it is worthless junk. Get one that is properly documented so that you know for sure what it does! eg, one like this: Be sure to choose the appropriate voltage version!2011-12-28 11:59 AM
Finally I bought
http://gostmblogspot.com/2010/09/getting-voltages-right.html
IC - MAX3232 and still have problem. I have connected Discovery <-> MAX3232 <-> RS232 <-> USB. When I made loopback by connection 11 and 12 pin, echo test was OK. So MAX3232<->RS232<->USB is OK. Still have problem with transfer data from/to board. My simple code (I think it should resend data sended from laptop):
#include ''stm32F10x.h''
#include ''STM32vldiscovery.h''
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
u8 USART_data;
int
main(
void
)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA, ENABLE);
//A.9 USART_1 TX
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
//A.10 USART_1 RX
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
USART_InitStructure.USART_BaudRate = 57600;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
//USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
USART_Init(USART1, &USART_InitStructure);
USART_Cmd(USART1, ENABLE);
while
(1)
{
while
(USART_GetFlagStatus(USART1, USART_FLAG_TXE)== RESET)
{
}
USART_SendData(USART1, USART_data);
USART_ClearFlag(USART1, USART_FLAG_TXE);
while
(USART_GetFlagStatus(USART1, USART_FLAG_RXNE) == RESET)
{
}
USART_data = USART_ReceiveData(USART1);
USART_ClearFlag(USART1, USART_FLAG_RXNE);
}
}
Any advice?
2012-01-05 11:58 PM
Hello!
Have You initialized the RCC unit?