Jump to content
manro

CC1310 / CC1350 (sensortag) VCC (battery) monitor

Recommended Posts

Hi everyone,

how can i read VCC on cc1310 launchpad respectively cc1350 sensortag with energia?

I tried this, but without success:

int getVCC() {
  
 analogReference(INTERNAL2V5);
 int data = (int)map(analogRead(A0), 0, 1023, 0, 5000);
  
 return data;  
}

@Rei Vilo what do you think?

Share this post


Link to post
Share on other sites

just like this?

#include <driverlib/aon_batmon.h>
...
  
void setup() {

  AONBatMonEnable();
  ...
}
  
void loop() {
  int BATstatus = AONBatMonBatteryVoltageGet();
  ...
}

 

Share this post


Link to post
Share on other sites

yes, i forgot convert value to millivolts, whole code is:

#include <driverlib/aon_batmon.h>
...
  
void setup() {

  AONBatMonEnable();
  ...
}
  
void loop() {
  int BATstatus = AONBatMonBatteryVoltageGet();
  BATstatus = (BATstatus * 125) >> 5;
  ...
}

so I started researching libraries in ...\power\hardware\cc13xx\4.9.1\system\source folder. I know that even you @Rei Vilo,are the author of libraries for several sensors, but I tried to import #include <ti/mw/sensors/SensorBmp280.h> and then call SensorBmp280_init() in setup function but something is wrong: undefined reference to `SensorBmp280_init'

Share this post


Link to post
Share on other sites

@Rei Vilo as i wrote, i know about Weather Sensors Library and implementing communication with i2c sensors is straightforward.

I was just wondering why I'm getting this error.

Share this post


Link to post
Share on other sites

Possible reasons:

  • The ti/mw/sensors/SensorBmp280.h library is not designed for Energia.
  • Other files may be needed.

That's why I've recommended the Weather Sensors Library designed for Energia. I haven't read any mention to the Weather Sensors Library library before on this thread.

For the ti/mw/sensors/SensorBmp280.h library, you may ask the E2E forum directly.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...