Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4521

SDK • adc dma capture example -- DMA_SIZE_8

$
0
0
Hello, all.

I'm having trouble with the adc dma capture example on the Pico examples github page.

I'm using VS code on my Ubuntu machine to program my Pico using the Pico Debug Probe.

I don't understand why I only get 8-bit resolution on the adc read. I can see in the example that the dma sample channel is configured for DMA_SIZE_8

Code:

channel_config_set_transfer_data_size(&samp_conf, DMA_SIZE_8);
If I change this to DMA_SIZE_16 or DMA_SIZE_32, the sample doesn't change size... I am sending the sample to the UART so I can read it on minicom, to see what I get. Nothing changes on minicom when I change the dma size to 16 or 32....

If I do a standard adc_read() I get 12-bit resolution

Code:

uint16_t raw_value = adc_read();
Could this possibly be due to the example code statement a few lines up in the example that states that the dma sample channel is configured as an int....?

Code:

int samp_chan = dma_claim_unused_channel(true);dma_channel_config samp_conf = dma_channel_get_default_config(samp_chan);
I guess my question is how do I get 12-bit resolution from the dma adc channel?

Thanks in advance for any help!
--Don

Statistics: Posted by ttu_Don — Fri Nov 22, 2024 3:40 am — Replies 1 — Views 47



Viewing all articles
Browse latest Browse all 4521

Trending Articles