您好!
我们在 cc1310中实现了基站无线电模块、该模块可连接到许多对等器件(所有 cc1310)。 我们发现、我们对基站的调优越准确、通信就越好。
对等器件能够使用 OSC_AdjustxoscHfCapArray 功能设置其电容阵列增量、这些器件切换到低功耗模式、从而关闭 HS XOSC; 从低功耗模式唤醒时、HS XOSC 再次打开、以假定新的电容阵列增量。 这很好。
基站器件不需要进入低功耗模式、因此无需低功耗 OSC (使用 HS XOSC 进行低速时钟)即可构建。 这对于他们的大部分日常功能来说似乎是不错的、除了即时调整 CAP 阵列增量。 如果器件未挂起、我们无法关闭和打开 HS XOSC、或者切换从未真正发生、因为切换没有发生。
在播放一些代码片段时、我设法获得了其中的一部分、它似乎改变了电容阵列增量、但在器件的功率周期内它并不总是稳定、并且传输频率可能会变化3-4kHz -如果发生这种情况、它就不会改变 在 ccfg 部分中手动设置电容阵列增量。
是否有办法可靠地实现这一目标?
似乎主要起作用的代码位于此处(主要来自 OSC_AdjustXoscHfCapArray):
void set_cap_array_delta(int8_t capArrDelta)
{
uint32_t ccfg_ModeConfReg;
if (capArrDelta < -20)
capArrDelta = -20;
if (capArrDelta > 20)
capArrDelta = 20;
// read the MODE_CONF register in CCFG
ccfg_ModeConfReg = HWREG( CCFG_BASE_DEFAULT + CCFG_O_MODE_CONF );
ccfg_ModeConfReg &= CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA_M;
ccfg_ModeConfReg >>= CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA_S;
//
// No change, then no need to update
//
if (( int8_t ) ccfg_ModeConfReg != capArrDelta )
{
uint32_t ccfg_Mod;
// read the MODE_CONF register in CCFG
// Clear CAP_MODE and the CAPARRAY_DELATA field
ccfg_ModeConfReg = HWREG( CCFG_BASE_DEFAULT + CCFG_O_MODE_CONF );
ccfg_ModeConfReg &= ~( CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA_M |
CCFG_MODE_CONF_XOSC_CAP_MOD_M );
// Insert new delta value
ccfg_Mod = ( uint8_t ) capArrDelta;
ccfg_Mod <<= CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA_S;
ccfg_Mod &= CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA_M;
ccfg_ModeConfReg |= ccfg_Mod;
//
// Update the HW register with the new delta value
// Can't seem to use DDI32RegWrite here, call hangs otherwise
//
HWREG( AUX_DDI0_OSC_BASE + DDI_0_OSC_O_ANABYPASSVAL1 ) = SetupGetTrimForAnabypassValue1( ccfg_ModeConfReg );
//
// Disable Interrupts
//
bool fIntDisabled = IntMasterDisable( );
// Force power on AUX to ensure CPU has access
AONWUCAuxWakeupEvent( AONWUC_AUX_WAKEUP );
while( !( AONWUCPowerStatusGet( ) & AONWUC_AUX_POWER_ON )){ }
// Enable the AUX domain OSC clock and wait for it to be ready
AUXWUCClockEnable( AUX_WUC_OSCCTRL_CLOCK );
while( AUXWUCClockStatus( AUX_WUC_OSCCTRL_CLOCK ) != AUX_WUC_CLOCK_READY ){ }
//
// Turn Xosc off and on again, while it doesn't actually do this, the
// calls still seem to be required
//
OSCHF_SwitchToRcOscTurnOffXosc( );
OSCHF_TurnOnXosc( );
while ( !OSCHF_AttemptToSwitchToXosc( ));
// Disable clock for OSC_DIG
AUXWUCClockDisable( AUX_WUC_OSCCTRL_CLOCK );
// Release the 'force power' on AUX
AONWUCAuxWakeupEvent( AONWUC_AUX_ALLOW_SLEEP );
//
// Retrim XOSC
// This is required otherwise the cap array delta is not assumed correctly.
// after this call, new value is assumed.
//
SetupTrimDevice( );
// Reenable IRQs
if ( !fIntDisabled )
{
IntMasterEnable( );
}
}
}
问题可能是 SetupTrimDevice 被多次调用?
感谢你的任何帮助。
此致、
-奥利弗



