想读CC1310 LaunchPad的内部电压,用什么方法,有什么函数可以用么?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
想读CC1310 LaunchPad的内部电压,用什么方法,有什么函数可以用么?
可以读取下面三个内部信号。
可以参考SDK中的adcbufcontinuous和adcsinglechannel例程,按你的需求调整一下ADC channel就可以了。
* # Supported Internal Signals #
* Below is a table of internal signals that can be measured using the ADC.
* Since we are not connecting to a DIO, there is no DIO to internal signal mapping. The DIO field in the channel lookup table should be marked PIN_UNASSIGNED.
* This table can be used to create virtual channel entries in the ADCBufCC26XX_adcChannelLut table in the board file.
*
* | DIO | Internal Signal CompBInput |
* |--------------------|-------------------------------|
* | PIN_UNASSIGNED | ADC_COMPB_IN_DCOUPL |
* | PIN_UNASSIGNED | ADC_COMPB_IN_VSS |
* | PIN_UNASSIGNED | ADC_COMPB_IN_VDDS |
一种用ADC,精度高点,参考ADC single channel例程
http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20CC13x0%20SDK%2FExamples%2FDevelopment%20Tools%2FCC1310%20LaunchPad%2FTI%20Drivers%2Fadcsinglechannel%2FTI-RTOS%2FCCS%20Compiler%2Fadcsinglechannel
另外一种方法用Battery monitor,精度低,只有6位ADC
#include <ti\devices\cc13x0\driverlib\aon_batmon.h>
static
uint8_t GetBatteryVoltage(
void
)
{
// Return the battery voltage loosing some precision to fit in 8 bits
return
(uint8_t)((AONBatMonBatteryVoltageGet()) >> 3);
}