Question
Recieve more then 1 Byte over USART
Posted on August 31, 2012 at 20:51
Hi,
at the moment I'm using the following code to recieve a byte:char
ReceivedData = NULL;
void
main() {
.
.
.
while
(1){
/* Wait until a byte is received */
while
(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET)
{
}
/* read byte and print via usart2 it */
ReceivedData = USART_ReceiveData(USART2);
printf
(
''Positionen: %d \r\n''
, ReceivedData);
//abbort if 3 received
if
(ReceivedData == 3)
break
;
}
.
.
}
I now want to recieve more then 1 byte and store it an recieve Buffer ''RXBUFF[]''.
Because I want to send a byte array from my pc to the controller and then I want to deserialze the data to int16 or int32 ...
How can i achieve that?
how can I recieve my bytearray with the stm32f103 ?
WR
Alex
#usart-stm32-loopback #usart-stm32