2017-08-21 05:58 AM
I'am trying sending speech data between two STM32F4 board with. I take speech data from PCM buffer. But the data that in PCM buffer is 16 bits. I need to send this data with UART. I know that, UART data register is 8bits. How can I split data in PCM buffer.? Other problem about receive side. How can I collect these 2 byte data? And last one, this is a speech data. So Can I transmit and receive them like char data or someting? Or is there any important point about timing for transmitting and receiving datas?
PS: I am using 'STM32CubeExpansion_MEMSMIC1_V2.0.0' application with NUCLEO STM32f401RE board and X-NUCLEO-CCA02M1 MEMs board.
#stm32f401re #cca02m1-memsmic1 #data-register #cca02m12017-08-21 06:35 AM
Ok, so cast the uint16_t pointer in to a uint8_t one?
uint16_t arr[1000];
Send((uint8_t *)arr, sizeof(arr));
The data appears in memory as contiguous bytes, describing the low order, and high order 8-bit that compose the 16-bit word.
When sending you might want to consider how you initially synchronize.
2017-08-22 04:25 AM
Thank you for answer.
So can I send speech data like char or someting ? Aren't there any important point about timing for speech datas?
2017-08-22 06:57 AM
To start, learn to accept 0x00 via UART as data. Everything else will be easy.
2017-08-22 07:07 AM
I will use RS422 to send speech. It will be a fulll dublex communication system. By the way ever interested
X-NUCLEO-CCA02M1 MEMs board before? I can not use it when debugging nucleo board. How can use both of them while debugging evulation board?
2017-08-22 07:45 AM
In memory it is a collection of bytes, review memory representation of data.
Speech and Audio data are going to have hard timing deadlines, you must have sufficient bandwidth to transmit the data you are generating. Presumably you have a fixed frequency for the sample rate. Clocks on two independent systems are likely to have some drift with respect to each other. If this is sufficiently large you might have to insert or remove samples to maintain synchronization, or change the sample clock slightly.
2017-08-22 10:06 AM
The interface is not important. You need to learn how to generate data at the package level.
The simplest option is to take the ready standard, but it's boring. It is much more fascinating to invent your own bicycle, and heroically overcome difficulties.The 'data package' in the simplest form is a two-way agreement on the transmission and reception of data. Try to create a structure using a union, two options for presenting data-a data type for internal use and for a physical layer.Have you already managed to send several 0x00 parcels via UART?
2017-08-23 01:02 AM
I can send data via uart. But I should take data from PCM buffer, devide this data and send it in a synchronous timing. These 3 issues are base problem.
2017-08-23 08:27 AM
There may be a translation error ...
Are you sure that you can send a data string via uart? :0x01.0x00.0x00.0x00.0x01.It looks simple at first sight, before the first real attempt.You can send such data. To see the result, more precisely - to fix the coincident result is much more difficult.You will have to abandon the existing software shell, and write your own - which is able to accept null data.Combine the format of the data can be through the union, read the rules of the C language, there it is written.
2017-08-24 01:03 AM
Remember to divide and conquer. It seems to me that the problem can be broken down into smaller, simpler problems.
1. You want to transmit audio data with low latency. You need a control and timing strategy for this. You could send individual PCM samples as they are generated or you can buffer multiple samples before transmitting them as a block. The bigger you make your buffer, the longer your latency becomes.
2. You need to transmit a packet of data. You can design your own packet format or you can pick a standard.
3. You need to hook up the UART.
I hope that helps.