Battery Charger And USB CDC

⚠️
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//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
techteh
Offline
Last seen:3 months 2 weeks ago
加入:2018-07-16 12:09
Battery Charger And USB CDC

Hi dialog,
我设计了一个自定义PCBDA14682 that uses USB CDC as a battery charger and data communication interface. In some cases I have a battery and i want to charge it with USB BUS, and in the other ones, I haven't any battery but still i want to use USB and communicate data. Is there any way to use USB CDC without battery presence?
Here is some config that I am using in custom_config_qspi.h:

#define dg_configUSE_HW_USB 1
#define dg_configUSE_USB 1
#define dg_configUSE_USB_CHARGER 1
#define dg_configALLOW_CHARGING_NOT_ENUM 1
#define dg_configUSE_NOT_ENUM_CHARGING_TIMEOUT 0
#define dg_configUSE_USB_ENUMERATION 1
#define dg_configUSB_SUSPEND_MODE 1

Device:
PM_Dialog
Offline
Last seen:9 hours 17 min ago
Staff
加入:2018-02-08 11:03
Hi techteh,

Hi techteh,

Could you please clarify what you are trying to accomplish? The charging procedure is independent from the USB. Do you want to configure your application in order to charge the battery when you have the battery connected? Please, indicate us what you are trying to implement in order to provide you the correct guidelines.

Thanks, PM_Dialog

techteh
Offline
Last seen:3 months 2 weeks ago
加入:2018-07-16 12:09
Hi,

Hi,
My problem is when I set "dg_configUSE_USB_CHARGER" define to "1" then USB CDC doesn't work without battery presence, otherwise it works normally.

PM_Dialog
Offline
Last seen:9 hours 17 min ago
Staff
加入:2018-02-08 11:03
Hi techteh,

Hi techteh,

If I understood correctly from what you mentioned in your first post, you haven’t the battery attached, so the dg_configUSE_USB_CHARGER definition should be set to ‘0’. Please, have a look at the
UM-B-044 User Manual: DA1468x Software Platform Reference (HTML)user manual from our support portal. The dg_configUSE_USB_CHARGER either enables or disables the usage of the charger from the application level. The charger’s configuration should be disabled when no battery is attached to you board. To enable the “No Charging” configuration, you should dset dg_configUSE_USB_CHARGER = 0 in theproject’s config/custom_config_qspi.h file. It is very important to use this configuration when no battery is attached to avoid any unwanted behavior.

Thanks, PM_Dialog

techteh
Offline
Last seen:3 months 2 weeks ago
加入:2018-07-16 12:09
Hi,

Hi,
I have a custom board that sometimes user wants to connect to board without battery presence and sometimes he wants to connect to board with battery and charge that.
Is it possible to use USB CDC in both situations (Battery exists or not) in One micro program?

PM_Dialog
Offline
Last seen:9 hours 17 min ago
Staff
加入:2018-02-08 11:03
Hi techteh,

Hi techteh,

You are not able to change dynamically the definition dg_configUSE_USB_CHARGER, because it’s something static. That is the concept if the definitions. A possible solution would be to follow both of the paths of dg_configUSE_USB_CHARGER definition and implement you own functionality.

Thanks, PM_Dialog