AnsweredAssumed Answered

Sign Extension not working?

Question asked by Dano on Oct 9, 2011

Hello all,

 

I am using the BF506F internal A2D trying to sample a sine wave with DC level of 2.5V.

I am configuring the ACM to single mode, RANGE=1, and then the following SPORT configuration:

 

*pSPORT1_RCR2     =SLEN(15);  // SLEN (Serial Word Length)
*pSPORT1_RCR1     =0x5405;       // LRFS|RFSR|RSPEN|RDTYPE=sign extension

 

*pACM_ER0    =0x0031; // Single Ended|Va1|Enable Event

*pDMA4_CONFIG =0x0086; // Data Interrupt|16Bit Word|Memory Write
*pDMA4_START_ADDR =(void*)Rx_Buffer;
*pDMA4_X_MODIFY =2; // 2 Strides
*pDMA4_X_COUNT    =FFTSIZE; // FFTSIZE Samples transfer
*pDMA4_CONFIG |=DMAEN; // DMA Enable

Unfortunately, I never get the sign extended properly, and it seems that the MSB (15th bit) is always zero regardless of the RDTYPE.

Please see the picture attached.

 

 

Please Help!

Dano

Attachments

Outcomes