AnsweredAssumed Answered

problem with BF506f ADC

Question asked by tornado on Feb 8, 2012
Latest reply on Feb 1, 2014 by Prashant

i have a problem with getting correct digital input from ACM

i get 0x2000 for 0v

but from the ezkit lite it should be 0x1000

here is the config of the acm...

 

for vref using the default 2.5v single ended two complement

 

void Init_ACM( void )
{
//***************************SETTING FOR ALL CHANNEL EVENTS************************************
//CH1 and CH2 event
*pACM_ET12 = EVENT_TIMING;  //500-2
*pACM_ER12=0x30;    //Single End, Vref, Channel Va1 & Channel Vb1, Disable

//CH3 and CH4 event
*pACM_ET13 = EVENT_TIMING;  //Event Timing
*pACM_ER13=0x32;    //Single End, Vref, Channel Va2 & Channel Vb2, Disable

//GYRO event
*pACM_ET14 = EVENT_TIMING;  //Event Timing
*pACM_ER14=0x3A;    //Single End, Vref, Channel Va3 & Channel Vb3, Disable **Channel Vb3 Didnt use so far...

//*********************************************************************************************

*pACM_EMSK=0x0000;  //Disable All ACM Event COMPLETED interrupt
*pACM_IMSK=0x0000;  //Disable All ACM Event MISSED interrupt

/*Set proper frame sync polarity, ADC drive edge, trigger selects and Sport Unit select before enabling SPort.*/
*pACM_TC1=0x880f;  //write(ACM_TC1, 0x8810, 16bit); //Tcsw = 'd10, Th = 'd15, Tz = 'd2
*pACM_TC0=0x01;   //write(ACM_TC0, 0x0001, 16bit); //CKDIV = 'd1, Ts = 'd0 (programming ACM_TC0 at the end)

*pACM_CTL=0x4052;     //CSPOL=Active Low; ADC negedge drive; TRGSEL0=10; TRGSEL1=10; SPORT Unit 1 Selected;
*pACM_CTL|=0x01;  //Enable ACM
}

 

void Init_Timer2 (void)

{

*pTIMER2_CONFIG = 0x030D;     //Run when Emulation, TOGGLE_HI enbale for Timing Isue, PERIOD_CNT = 1(count to peroid, non-stop counting)

            //PULSE_HI = 1 active high pulse, PWM_OUT mode....

*pTIMER2_WIDTH = TIMER2_WITDH; //same as event_timing //500-2

*pTIMER2_PERIOD = TIMER2_ACM_PERIOD; //500

*pTIMER_ENABLE |= 0x0004;     //Enable Timer2; Trigger come in, ACM GO GO GO!!!

}

 


void Init_DMA4( void )
{
*pDMA4_CONFIG=0x0086;             //**STOP mode,Interrupt Enable, 16-bit, WRITE operation, Disable

*pDMA4_START_ADDR=(void*)Rx_Buffer;          //**Assign Start Address(Destination Address)

*pDMA4_X_MODIFY=2;              //**16 bits transfer

*pSPORT1_RCR2=0x010e;             //**Setting SLEN, 16 bit in use

*pDMA4_X_COUNT = SAMPLE_NUMBER;           //**number of elements.

*pSPORT1_RCR1=0x1401;             //**Active low RFS, Requires RFS for every data, Receive Enable!
}

Attachments

Outcomes