資源簡介
低成本的TI公司的piccolo系列的DSP開發(fā)例程

代碼片段和文件信息
?//?TI?File?$Revision:?/main/4?$
//?Checkin?$Date:?January?26?2009???13:41:55?$
//###########################################################################
//
//?FILE: DSP2802x_Adc.c
//
//?title: DSP2802x?ADC?Initialization?&?Support?Functions.
//
//###########################################################################
//?$TI?Release:?2802x?C/C++?Header?Files?and?Peripheral?Examples?V1.21?$
//?$Release?Date:?October?24?2009?$
//###########################################################################
#include?“DSP2802x_Device.h“?????//?DSP2802x?Headerfile?Include?File
#include?“DSP2802x_Examples.h“???//?DSP2802x?Examples?Include?File
#define?ADC_usDELAY??1000L
//---------------------------------------------------------------------------
//?InitAdc:
//---------------------------------------------------------------------------
//?This?function?initializes?ADC?to?a?known?state.
//
//?NOTE:?ADC?INIT?IS?DIFFERENT?ON?2802x?DEVICES?COMPARED?TO?OTHER?28X?DEVICES
//
void?InitAdc(void)
{
????extern?void?DSP28x_usDelay(Uint32?Count);
????//?*IMPORTANT*
//?The?Device_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;
(*Device_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?DSP2802x_Examples.h?file?must
//?contain?the?correct?CPU?clock?period?in?nanoseconds.
EALLOW;
AdcRegs.ADCCTL1.bit.ADCBGPWD??=?1; //?Power?ADC?BG
AdcRegs.ADCCTL1.bit.ADCREFPWD?=?1; //?Power?reference
AdcRegs.ADCCTL1.bit.ADCPWDN???=?1; //?Power?ADC
AdcRegs.ADCCTL1.bit.ADCENABLE?=?1; //?Enable?ADC
AdcRegs.ADCCTL1.bit.ADCREFSEL?=?0; //?Select?interal?BG
EDIS;
????DELAY_US(ADC_usDELAY);?????????//?Delay?before?converting?ADC?channels
}
void?InitAdcAio()
{
???EALLOW;
/*?Configure?ADC?pins?using?AIO?regs*/
//?This?specifies?which?of?the?possible?AIO?pins?will?be?Analog?input?pins.
//?NOTE:?AIO1357-9111315?are?analog?inputs?in?all?AIOMUX1?configurations.
//?Comment?out?other?unwanted?lines.
????GpioCtrlRegs.AIOMUX1.bit.AIO2?=?2;????//?Configure?AIO2?for?A2?(analog?input)?operation
????GpioCtrlRegs.
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2010-04-16?17:27??DSP2802x\
?????目錄???????????0??2010-04-16?17:27??DSP2802x\v121\
?????目錄???????????0??2010-04-16?17:27??DSP2802x\v121\doc\
?????文件??????599194??2009-10-21?18:24??DSP2802x\v121\doc\DSP2802x_HeaderFiles_Quickstart_Readme.pdf
?????文件???????41417??2008-11-10?11:49??DSP2802x\v121\doc\Example_ISRPriorities.pdf
?????文件???????66585??2009-10-01?15:48??DSP2802x\v121\doc\Internal_Oscillator_Compensation_Functions.pdf
?????文件???????33754??2009-10-01?15:48??DSP2802x\v121\doc\SFO_Library_V6_Errata.pdf
?????目錄???????????0??2010-04-16?17:27??DSP2802x\v121\DSP2802x_common\
?????目錄???????????0??2010-04-16?17:27??DSP2802x\v121\DSP2802x_common\cmd\
?????文件????????5882??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\280200_RAM_lnk.cmd
?????文件????????6410??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\28020_RAM_lnk.cmd
?????文件????????6410??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\28021_RAM_lnk.cmd
?????文件????????6410??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\28022_RAM_lnk.cmd
?????文件????????6410??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\28023_RAM_lnk.cmd
?????文件????????6410??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\28026_RAM_lnk.cmd
?????文件????????6410??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\28027_RAM_lnk.cmd
?????文件????????8218??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F28020.cmd
?????文件????????7695??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F280200.cmd
?????文件????????8214??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F28021.cmd
?????文件????????8220??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F28022.cmd
?????文件????????8216??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F28023.cmd
?????文件????????8219??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F28026.cmd
?????文件????????8227??2009-10-21?17:12??DSP2802x\v121\DSP2802x_common\cmd\F28027.cmd
?????目錄???????????0??2010-04-16?17:27??DSP2802x\v121\DSP2802x_common\gel\
?????目錄???????????0??2010-04-16?17:27??DSP2802x\v121\DSP2802x_common\gel\ccsv4\
?????文件???????19602??2009-10-19?16:54??DSP2802x\v121\DSP2802x_common\gel\ccsv4\f28020.gel
?????文件???????19319??2009-10-19?16:54??DSP2802x\v121\DSP2802x_common\gel\ccsv4\f280200.gel
?????文件???????19602??2009-10-19?16:54??DSP2802x\v121\DSP2802x_common\gel\ccsv4\f28021.gel
?????文件???????19604??2009-10-19?16:54??DSP2802x\v121\DSP2802x_common\gel\ccsv4\f28022.gel
?????文件???????19604??2009-10-19?16:54??DSP2802x\v121\DSP2802x_common\gel\ccsv4\f28023.gel
?????文件???????19602??2009-10-19?16:54??DSP2802x\v121\DSP2802x_common\gel\ccsv4\f28026.gel
............此處省略539個文件信息
評論
共有 條評論