LPC43xx HSADC GPDMA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC43xx HSADC GPDMA

439 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mshrestha789 on Thu Nov 05 04:40:41 MST 2015
Hello friends,

Recently I've been working with High speed ADC of LPC4370 and GPDMA. I successfully managed to get the data using the ADC and DMA. However sometime it misses some initial data. For example I am suppose to get five cycles of sine wave at the beginning, most of the time I get five cycles but some time I only get 3 cycles. So my question is "is it because of DMA?"  Can someone please help me regarding this?
Labels (1)
0 Kudos
2 Replies

373 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mshrestha789 on Sun Nov 08 07:28:54 MST 2015
Hi tecow,

In your descriptor entry, I noticed that you used 0x90 for descriptor entry, when I use HSADC_DESC_MATCH(0x90), I don't get valid data from ADC at all. In-fact if I initialize descriptor match with the value greater than ADC frequency (in my case 80), I cannot get valid data. So my question is, is there any way I can know if HSADC analog part settle or not?

0 Kudos

373 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tecow on Sat Nov 07 23:54:19 MST 2015
The HSADC analog part need some time to get settled. You can tell the HSADC when the first samples are received after an initially delay (typically 0x90 samples).
Here an example for the first DescEntry call that adds the initial waiting.

Chip_HSADC_SetupDescEntry(LPC_ADCHS, 0, 0,
(HSADC_DESC_CH(ch[0]) | HSADC_DESC_BRANCH_SWAP
| HSADC_DESC_MATCH(0x90 | thresh[0]
| HSADC_DESC_RESET_TIMER));

If you don't want to miss initial data you should start the DMA before you start the DMA.
setup_ADCHS_DMA(false);
Chip_HSADC_SWTrigger(LPC_ADCHS);

The current LPC_OPEN Library (2_12) is rather incomplete (and buggy) with respect to GPDMA support of the HSADC. So be careful in using it.
0 Kudos