Add a different battery to BASS

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
thomas.linder
Offline
Last seen: 1 year 2 months ago
Joined: 2017-04-20 13:50
Add a different battery to BASS

Hi

I am currently trying to interface a smart battery (SMBus) to a DA14531 module. I started from the barebone template and added the BAS service which appears to be working (I get 100% of charge but well, I don't care about that yet - at least the service is listed correctly).

Now, the SDK provides two different methods to retrieve the battery charge, I'd need a third, different one. What is the correct way to set this up? Do I need to change the battery.c driver to include my battery or does the SDK offer a more future-proof solution (because if the SDK is updated, this will overwrite my changes to the battery.c file). What would be the correct way to do this without "hacking" into the SDK source files?

Thanks in advance

Thomas

PM_Dialog
Offline
Last seen: 2 months 2 weeks ago
Staff
Joined: 2018-02-08 11:03
Hi thomas.linder,

Hi thomas.linder,

Thanks for your question online. The application files of the BAS profile ( app_bass_task.c/ .h and app_bass.c / .h ) are using the battery driver to sample the ADC and measure the battery level.

The battery driver supports a CR2032 lithium and an Alkaline cell battery – please see batt_t structure.

If you don’t want to modify the SDK driver, a possible solution might be to do a custom implementation for the application of the BAS profile. With other words, I mean to create your own app_bass_task.c/ .h and app_bass.c / .h file – for example app_custom_bas_task.c/ .h and app_custom_bass.c / .h and implement your own application based on the battery that you would like to use. Hope this helps!

Thanks, PM_Dialog

thomas.linder
Offline
Last seen: 1 year 2 months ago
Joined: 2017-04-20 13:50
Thanks, I hoped that there

Thanks, I hoped that there was an easier solution but that's fine with me :-).