AnsweredAssumed Answered

STM32F103 USB communication

Question asked by jeanot1314 on Mar 7, 2014
Latest reply on Mar 7, 2014 by sung.chen_chung
Hi Hi, 

I have done some test using the USART1 PA9 and PA10 pin to communicate with my arduino board, i made some basic configuration like this : 

USART_InitTypeDef USART1_Init;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);

USART1_Init.USART_BaudRate = 19200;
USART1_Init.USART_WordLength = USART_WordLength_8b ;
USART1_Init.USART_StopBits = USART_StopBits_1;
USART1_Init.USART_Parity = USART_Parity_No;
USART1_Init.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART1_Init.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(USART1, &USART1_Init);

USART_Cmd(USART1, ENABLE);
USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
NVIC_EnableIRQ(USART1_IRQn);

It work very good ^^ but there is something i don't understand : 

  I guess i could use this USART1 to communicate with a computer via FTDI chip, but the STMf103 has two pins PA11 and PA12 (usbdm and usbdp) which should be made to be directly connected to the usb. So how can i use PA11 and PA12 to send and receive data from my computer? Is there any documentation on this or library?

 If i use also PA9 and PA10 for other purpose (like connecting USART to my GPRS shield) would the usb/computer connection PA11 and PA12 be affected as they are on the RTS and CTS of the USART1?

thanks a lot for your help :)

Outcomes