TI中文支持网
TI专业的中文技术问题搜集分享网站

CC1310 AD采集和定时器问题

刚接触CC1310,很多问题不明白,望解答。

1、CC1310的AD采集频率最小可以设为多少呢,是不是1s?如果想设为分钟级别的采集,该如何实现,使用Timer还是RTC实现?

2、定时器Timer的最大定时可以是多少呢?TimerConfigure(GPT0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC | TIMER_CFG_B_PERIODIC);这句中TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC | TIMER_CFG_B_PERIODIC是什么意思呢?

修改TimerLoadSet(GPT0_BASE, TIMER_A, 1); 中的初值对定时时间没有影响,为什么呢?

希望TI工程师能帮忙解答,谢谢。

Felix ZF:

CC1310的AD的最大采样频率是200k,小于等于这个频率的都是可以实现的。

关于TimerConfigure()中参数的含义,可在timer.h中看到,如下所示。

//*****************************************************************************////! \brief Configures the timer(s).//!//! This function configures the operating mode of the timer(s). The timer//! module is disabled before being configured and is left in the disabled//! state.//!//! The timers are comprised of two 16-bit timers that can//! operate independently or be concatenated to form a 32-bit timer.//!//! \note If the timers are used independently the length of timer can be//! extended to 24 bit by use of an 8 bit prescale register set using//! \ref TimerPrescaleSet().//!//! When configuring for full-width timer \c ui32Config is set//! as one of the following values://! – \ref TIMER_CFG_ONE_SHOT : Full-width one-shot timer.//! – \ref TIMER_CFG_ONE_SHOT_UP : Full-width one-shot timer that counts up//! instead of down.//! – \ref TIMER_CFG_PERIODIC : Full-width periodic timer.//! – \ref TIMER_CFG_PERIODIC_UP : Full-width periodic timer that counts up//! instead of down.//!//! When configuring for a pair of half-width timers, each timer is separately//! configured. The timers are configured by setting \c ui32Config to//! the bitwise OR of one of each of the following three://! – Use half-width timers://! – \ref TIMER_CFG_SPLIT_PAIR//! – Timer A://! – \ref TIMER_CFG_A_ONE_SHOT : Half-width one-shot timer//! – \ref TIMER_CFG_A_ONE_SHOT_UP : Half-width one-shot timer that counts up//! instead of down.//! – \ref TIMER_CFG_A_PERIODIC : Half-width periodic timer//! – \ref TIMER_CFG_A_PERIODIC_UP : Half-width periodic timer that counts up//! instead of down.//! – \ref TIMER_CFG_A_CAP_COUNT : Half-width edge count capture//! – \ref TIMER_CFG_A_CAP_COUNT_UP : Half-width edge count capture that counts//! up instead of down.//! – \ref TIMER_CFG_A_CAP_TIME : Half-width edge time capture//! – \ref TIMER_CFG_A_CAP_TIME_UP : Half-width edge time capture that counts up//! instead of down.//! – \ref TIMER_CFG_A_PWM : Half-width PWM output//! – Timer B://! – Same as Timer A but using TIMER_CFG_B_* instead.//!//! \param ui32Base is the base address of the timer module.//! \param ui32Config is the configuration for the timer.//!//! \return None////*****************************************************************************extern void TimerConfigure(uint32_t ui32Base, uint32_t ui32Config);

user4934300:

回复 Felix ZF:

您好,感谢您的回复。我问的是最小的采集频率,我想实现的是几分钟采集一次?adcBuf采集例程中adcBufParams.samplingFrequency 最小只能是1吧?分钟级别的采集该如何设置?

Felix ZF:

回复 user4934300:

将adcBufParams.samplingFrequency设置为1,是ADCBuf_RECURRENCE_MODE_CONTINUOUS模式下最小采样频率,即最大采样间隔。

如果需要采样间隔更大,可以参照adcsinglechannel示例,在你希望进行采样的时间点,通过调用ADC_convert()触发一次采样。

user4934300:

回复 Felix ZF:

您好,感谢您的回复。我先试试,那我应该怎样延时呢?用Timer还是RTC呢?Timer的最大定时时间是多少呢?

Felix ZF:

回复 user4934300:

你可以使用Clock module,默认时间精度是10us,定时时长为32位无符号整形数。

赞(0)
未经允许不得转载:TI中文支持网 » CC1310 AD采集和定时器问题
分享到: 更多 (0)