TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Brian Wang0:
直接用Delay_us()函数就可以实现。
具体参考Control Suite中提供的ADC初始化例程。
InitAdc(void){ extern void DSP28x_usDelay(Uint32 Count);
// // *IMPORTANT* // The ADC_cal function, which copies the ADC calibration values from // TI reserved OTP into the ADCREFSEL and ADCOFFTRIM registers, occurs // automatically in the Boot ROM. If the boot ROM code is bypassed during // the debug process, the following function MUST be called for the ADC to // function according to specification. The clocks to the ADC MUST be // enabled before calling this function. See the device data manual and/or // the ADC Reference Manual for more information. // EALLOW; SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1; ADC_cal(); EDIS;
// // To powerup the ADC the ADCENCLK bit should be set first to enable // clocks, followed by powering up the bandgap, reference circuitry, and // ADC core. Before the first conversion is performed a 5ms delay must be // observed after power up to give all analog circuits time to power up // and settle //
// // Please note that for the delay function below to operate correctly the // CPU_RATE define statement in the DSP2833x_Examples.h file must // contain the correct CPU clock period in nanoseconds. // AdcRegs.ADCTRL3.all = 0x00E0; // Power up bandgap/reference/ADC circuits DELAY_US(ADC_usDELAY); // Delay before converting ADC channels}
自然此时应当有:
#define ADC_usDELAY 5000L
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Frank Lee96:
回复 Brian Wang0:
对,我知道Delay_us()函数,但是这应该只是针对30M外部晶振的情况。如果外部晶振是25M,则#define ADC_usDELAY 5000L就是不对的,满足不了5ms的延时。该如何修改?或者是#define ADC_usDELAY 5000L中的5000L该如何修正?谢谢~
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Frank Lee96:
回复 Brian Wang0:
另外一个问题:TMS320F28335芯片ADC模块的初始化要求5ms延时这是最低要求还是唯一要求?就是说只要大于等于5ms就OK,还是只能是5ms?谢谢
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Brian Wang0:
回复 Frank Lee96:
不好意思有注意25M的前提。
可以注意一下DSP2833x_Example.h中关于DELAY_US()的定义。
#define DELAY_US(A) DSP28x_usDelay(((((long double) A * 1000.0L) / \ (long double)CPU_RATE) – 9.0L) / 5.0L)
当150MHz,程序中定义CPU_RATE=6.67L,也即6.67ns。
您的具体设置我不清楚,当外部晶振是25MHz,相信这个CPU_RATE是多少相信您是能自己算出来的,改成您需要的数就行了
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Brian Wang0:
回复 Frank Lee96:
这肯定是最低要求,确保ADC模块完成上电即可。
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Frank Lee96:
回复 Brian Wang0:
那您说的“当150M”这个前提是在什么条件下满足的?30M和150M又是如何联系上的呢?这一个还没有涉及到您说的“您的具体设置我不清楚”吧?谢谢
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Frank Lee96:
回复 Brian Wang0:
搞明白了,非常感谢!
TMS320F28335芯片的ADC模块要求在初始化ADC的时候要有5ms 的延时,如果外部输入时钟晶振频率为25MHz,该如何配置各项参数来保证ADC模块正常启动?
Frank Lee96:
回复 Brian Wang0:
您好,麻烦能提供一下北京地区TI技术支持的联系方式吗?谢谢