Anonymous
Not applicable
May 23, 2013
11:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 23, 2013
11:21 PM
Hi,
Im trying to build 1 wire communication through UART 2.
Protocol should have two modes as seen below.
1- Receiving Mode
2- Transmitting Mode
943362WCD4 will be opened in receiving mode so UART 2 is initilizated and tx pin is switched to input as seen below.
wiced_uart_init( WICED_UART_2, &uart_config, &rx_buffer );
wiced_gpio_init( WICED_GPIO_3, INPUT_HIGH_IMPEDANCE );
It works properly, all data is received smoothly. For transmitting mode WICED_GPIO_3 pin should be reconfigured to UART2.tx, is UART2 initilization necessary ? Do you have any suggestion that switches WICED_GPIO_3 from INPUT_HIGH_IMPEDANCE to WICED_UART_2.tx ?
BR
Solved! Go to Solution.
Labels
- Labels:
-
UART
- Tags:
- &rx_buffer
- &uart_config
- 943362wcd4
- build
- communication
- data
- initilizated
- initilization
- input
- input_high_impedance
- mode
- modes
- opened
- properly
- protocol
- received
- receiving
- reconfigured
- smoothly
- suggestion
- switched
- switches
- transmitting
- uart
- uart-
- uart2
- uart2.tx
- wiced_gpio_3
- wiced_gpio_init
- wiced_uart_2
- wiced_uart_2.tx
- wiced_uart_init
- wire
- works
1 Solution
Anonymous
Not applicable
May 24, 2013
12:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 24, 2013
12:21 AM
Take a look at inside platform_uart_init() in stm32f2xx_platform.c. I believe you can re-purpose the WICED_GPIO_3 back to UART by re-setting the GPIO to UART alternate function. I copied the code pertaining to your question below. Hope that helps.=========================================================================================== /* Configure USART TX Pin */ gpio_init_structure.GPIO_Pin = (uint32_t) ( 1 << uart_mapping[uart].pin_tx->number ); gpio_init_structure.GPIO_Mode = GPIO_Mode_AF; gpio_init_structure.GPIO_OType = GPIO_OType_PP; gpio_init_structure.GPIO_PuPd = GPIO_PuPd_NOPULL; gpio_init_structure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init( uart_mapping[uart].pin_tx->bank, &gpio_init_structure ); GPIO_PinAFConfig( uart_mapping[uart].pin_tx->bank, uart_mapping[uart].pin_tx->number, uart_mapping[uart].gpio_af );===========================================================================================
1 Reply