The array ResultReg contain the converted results from ADC channel scan that you have incude in the channel list register. For example if you want to get the ADC read of input AN0, AN1, AN5 you must include three samples in appconfig.h: #define INCLUDE_ADCA_SAMPLE_0 #define INCLUDE_ADCA_SAMPLE_1 #define INCLUDE_ADCA_SAMPLE_2 and configure the channels in "open" function assigning the appropriate SampleMask to any channel. SampleMask=0x0001 correspond to &ArchIO.AdcA.ResultReg[0], SampleMask=0x0002 correspond to &ArchIO.AdcA.ResultReg[1], SampleMask=0x0004 correspond to &ArchIO.AdcA.ResultReg[2],etc.. Here is an initalization example with channel AN0,AN1 and AN5: void ADC_Init(void) { const adc_sState sadc0 = { /* AnalogChannel = */ ADC_CHANNEL_0, /* motor current phase U */ /* SampleMask = */ 0x0001, /* OffsetRegister = */ 0, /* LowLimitRegister = */ 0, /* HighLimitRegister = */ 0xffff, /* ISR limit checking not activated */ /* ZeroCrossing = */ 0, }; const adc_sState sadc1 = { /* AnalogChannel = */ ADC_CHANNEL_1, /* motor current phase W */ /* SampleMask = */ 0x0002, /* OffsetRegister = */ 0, /* LowLimitRegister = */ 0, /* HighLimitRegister = */ 0xffff, /* ISR limit checking not activated */ /* ZeroCrossing = */ 0, }; const adc_sState sadc2 = { /* AnalogChannel = */ ADC_CHANNEL_5, /* dc-bus voltage */ /* SampleMask = */ 0x0004, /* OffsetRegister = */ 0, /* LowLimitRegister = */ FRAC16(BRAKE_LOW_LIMIT/APP_VOLT_MAX), /* Brake - Low limit */ /* HighLimitRegister = */ FRAC16(BRAKE_HIGH_LIMIT/APP_VOLT_MAX), /* Brake - High limit */ /* ZeroCrossing = */ 0, }; /* open adc power module PM001 channels */ ADC0_Handle = open(BSP_DEVICE_NAME_ADC_0, 0, &sadc0); ADC1_Handle = open(BSP_DEVICE_NAME_ADC_0, 0, &sadc1); ADC2_Handle = open(BSP_DEVICE_NAME_ADC_0, 0, &sadc2); } After ADC scan, you will find read result in &ArchIO.AdcA.ResultReg[0]=> result of conversion AN0 &ArchIO.AdcA.ResultReg[1]=> result of conversion AN1 &ArchIO.AdcA.ResultReg[2]=> result of conversion AN5 but you can read the result of conversion with: read(ADC0_Handle, &ph_U_curr, sizeof(ph_U_curr)); read(ADC1_Handle, &ph_W_curr, sizeof(ph_W_curr)); read(ADC2_Handle, &u_dc_bus, sizeof(u_dc_bus)); Best regards, --------\ -------- Marco Pellizzaro QEM srl S.S. 11 Km 339 LocalitSignolo 36054 Montebello Vic.no - VI - ITALY Phone +39-0444-440061 Fax. +39-0444-440229 e-mail: http://www.qem.it --------\ -------- "chrisaustin2003" <chrisaustin2003@ Per: yahoo.com> Cc: Oggetto: [motoroladsp] 805 ADC current readings 22/11/02 20.32 Hi there. I'm trying to find out how to read the DC bus current from the ADC. I know that you can read the DC bus voltage by using periphMemRead(&ArchIO.AdcA.ResultReg[0]). I'm assuming that there is a way to read current from the ADC with a similar call. Does anyone know were i can find a list of outputs for ResultReg, ie if i change 0 to 1, what am i getting? This will help a lot. Thanks - Chris _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/motoroladsp More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/ |
Rif: 805 ADC current readings
Started by ●November 23, 2002