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
Keywords:
Device:
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
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.
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
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?
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