Hi,
I want to use and change wireless uart program to get some data from ADC and send it through BLE to phone. Is there anyone to help me? I do not know what I should change in the program.
Thanks
qn9080-dk blutooth ADC uart
How to receive data, through USART, when run private_profile_server project??
Yes, you can make to a macro definition gSerialManagerMaxInterfaces_c, then through a serial port input and output, reference w_uart project.
Hi,
I use this to send data over USART and works OK: USART_WriteBlocking(DEMO_USART, g_tipString, sizeof(g_tipString) / sizeof(g_tipString[0]));
How can I receive data from another device like Arduino over USART? Which part of w_uart project I need copy into private_profile_server project?
Hi Michalis,
You can register the callback function with Serial_SetRxCallBack(gAppSerMgrIf, Uart_RxCallBack, NULL) and then process the received data in the callback function 'Uart_RxCallBack'.
Hi Michalis,
I think the private_profile_server project is better for you, all you need to do is change the data that Qpp_SendData is sending.
result = Qpp_SendData(mPeerInformation[i].deviceId, service_qpps, mQppsTestDataLength, tx_data);
Simply replace tx_data with ADC data.
Hi,
I have a similar problem of Get ADC value and send through BLE by QN9080-DK
I want to ask for
I set the sample rate = 250 Hz in ADC function.
Then I want to set up a timer in the BLE Code that can call the ADC Function by interrupt every 1/250 sec to get the ADC value.
How to create this timer?
I have found like SysTick, CTimer, ... But I didn't know how to use it
If someone knows, please tell me,
Thanks.
The fastest way to do this is to refer to the battery measurement timer in the BLE routine and define a timer yourself,
like this:
static tmrTimerID_t mBatteryMeasurementTimerId; mBatteryMeasurementTimerId = TMR_AllocateTimer(); TMR_StartLowPowerTimer(mBatteryMeasurementTimerId, gTmrLowPowerIntervalMillisTimer_c, TMR_StopTimer(mBatteryMeasurementTimerId); |
Details are available in the documentation "Connectivity Framework Reference Manual" section 3.4 "Timer's Manager",
at dir "SDK\docs\wireless\Common".
Hi,
I use DMA Controller to get the ADC value and then send through BLE
I want to merge 2 sample code - adc_dma & private_profile_server
I add dma.c and dma.h file to private_profile_server project, but it didn't work.
Where is suggest to add the function in the code?
Now I put adc_dma project main function as a function in the private_profile_server.c
But the DMA controller didn't work, and the setting in Peripheral - DMA0 didn't change.
Hi Wei-Min,
Have you set the corresponding pin to ADC function?
Like this,
Header 1 |
---|
const uint32_t portA_pin8_config = ( IOCON_FUNC1 | /* Selects pin function 1 */ IOCON_MODE_HIGHZ | /* Selects High-Z function */ IOCON_DRIVE_LOW /* Enable low drive strength */ ); IOCON_PinMuxSet(IOCON, PORTA_IDX, PIN8_IDX, portA_pin8_config); /* PORTA PIN8 (coords: 46) is configured as ADC4 */ |
Hi Michalis,
You can do type conversion like this:
float adc_mv = 1.1; result = Qpp_SendData(mPeerInformation[i].deviceId, service_qpps, sizeof(float), (uint8_t*)&adc_mv); |
Thanks! Data send in ADC driver example are float. But private_profile_server project send uint8_t data. I use ADC driver example functions inside private_profile_server project. I need convert float to uint8_t data before send ADC data to QPP phone app ? If so is there an instruction I can use to convert float to uint8_t ?
How to create multicore project with wirless_uart project as master and ADC driver example as slave? So can read ADC data, using ADC driver SDK example, and send over BLE using wirless_uart SDK project?
Hi Michalis,
Are you using QN9080? If yes, but the QN9080 is a single core chip.
Hi Ashkan,
Maybe you can make the following changes in the wirless_uart project:
static void BleApp_ReceivedUartStream(deviceId_t peerDeviceId, uint8_t *pStream, uint16_t streamLength)
{
...
//FLib_MemCpy(pBuffer + messageHeaderSize, pStream, streamLength - messageHeaderSize);
//Serial_AsyncWrite(gAppSerMgrIf, pBuffer, streamLength, Uart_TxCallBack, pBuffer);
if(FLib_MemCmp(pStream, "command A", sizeof("command A")))
{
//do something
}
I think this function use for receiving data. But I want to send the result of the ADC to phone. So I think I should change
"static void BleApp_FlushUartStream(void *pParam)..." function.
Am I correct? if yes, how? if no, please explain more.
Thanks
Yes,
Simply send the data you want to send through the BleApp_SendUartStream function.
However, I think the private_profile_server project might be more suitable for you, which includes a process for sending data at regular intervals.
Hello Ashkan Rezaee,
I recommend running the ADC driver example applications included with the QN908x SDK, so you get familiar with the ADC SDK driver and then add the required functionality to the BLE Wireless UART application. For example, in MCUXpresso IDE, you can import the ADC basic driver example (next image) and go through the doc\readme.txt file for a description of the application.
Let me know if you have any question.
Regards,
Gerardo