Hi dialog,
I am currently working on a project which use a DA 14580. The goal of my system simple : i send data ( packet of 20 octets ) through an SPI link to the DA14580. Then i use the beacon mode to send this data ( placing the data from the SPI reads in the advertising string ) and i am able to receive all that data with my mobile phone's bluetooth scanner. I work on IAR for the global code ( collect data from sensor and send them to SPI flash link ), and i load a binary file for the Bluetooth configuration. The binary file is created when i build my Bluetooth program on U vision ( I use basic program provide by Dialog Semiconductor for the beacon mode ).
My problem is that since a frequency, the device transmit only half the data.
Indeed, for example, i would like to transmit one packet ( so 20 bit with the SPI ) each 1 second, 6 time. So i put on my IAR code a timer of 1 second between each send_payload ( which is the function that send data through the SPI flash to the BLE), and with my BLE scanner i am able to see a different data each 1 second 6 times in a row. But if i go under 1 second the system send only half of the data ( in the last example the number of data was 6) : for example if i put a timer of 0,5 second between each send of data through the SP, and i keep 6 dat to send, i can see on my BLE scanner that i receive only 3 data in a row ( so the half of what I expected ) and with an interval irregular.
With debug, I saw that the 6 data are effectively send to the SPI link, so it means that the problem is the BLE code. I tried to modified a lot of parameter like for example the intv_min and intv_max value, but i doesn't work and the problem stay the same. The fact is that i am able to receive a lot of data quickly, because i tested without regulation timer, and i saw on my scanner a data each 0,2 second approximately.
问题是,在1秒计时器,和only receive on my BLE scanner half of the data that i want to send. So obviously i can double the number of the data tjhat i want to send to have my result, but it's tricky.
Any idea to solve this let me know.
Best regards,
Florent
Hi florent,
I dont quite understand what the setup is, you read data from the spi flash, and then you mention that you use the beacon mode. What exactly you mean by beacon mode ? Are you placing the data from the SPI reads in the advertising string ? If that is what you are doing then:
There is no 2 seconds limitation in how often you can change the advertising string, and offcourse since its advertising there is no ack from the master that your data are received, since the advertising are data send through the air with no ack anything can happen and the central for for quite a few reasons might not get the advertising string. So, you wont be able to send and an advertising string from your peripheral and be certain that the central will capture it. Also that 2 seconds you get, what is the advertising interval that your device has. The advertising occurs over a fixed period, that period can be manipulated through the user_config.h file in the user_adv_conf struct and the .intv_min and the .intv_max. If the interval of the device is set into 2 seconds then the device will emmit data every 2 seconds. Also in order to change the advertising string please be aware that you will have to stop the advertising procedure, change the advertising data and restart the advertising with the new data in the advertising string.
Let me know if i understood your issue properly.
Thanks MT_dialog
Hi MT_dialog,
I found the problem in my code. Indeed, i had to change intv_min and intv_max value to speed up the transmission of the data.
Thanks for your help.
Florent