Author Topic: [SAMC] DAC clock source and speed  (Read 1875 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18906
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
[SAMC] DAC clock source and speed
« on: March 11, 2022, 01:52:22 pm »
I'm looking at the DAC on the SAMC series of microcontrollers. I have not come across any clock speed requirements for the DAC. I also do not know how long it takes for a conversion to happen in clock cycles.
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 5385
  • Country: gb
Re: [SAMC] DAC clock source and speed
« Reply #1 on: March 11, 2022, 02:18:26 pm »
From  https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/DataSheets/SAM-C20-C21-Family-Data-Sheet-DS60001479J.pdf

When you search for  '  GCLK_DAC  ', it seems to say:

Quote
The voltage pump uses the asynchronous GCLK_DAC clock, and requires that the clock frequency be at least four
times higher than the sampling period.

Which since it seems to be 350kHz, max DAC (sampling/update) data rate. 4 x 0.350 = 1.4 MHz minimum, and the maximum is stated as 48 MHz.

MAX is given as:
Quote
fGCLK_DAC DAC input clock frequency 48 MHz

Quote
10-bit, 350 ksps Digital-to-Analog Converter (DAC) in the SAM C21

Which (at a somewhat quick look at the datasheet), is a fixed rate, independent of other settings, unless you disable/stop it, e.g. for power saving (sleep/idle) reasons.

But I'M NOT 100% sure about that (i.e. fixed at 350 kHz, while running).

They seem to prefer/intend for you to use its interrupt or DMA, to use it, in a time controlled manner. But I suppose you could still use it manually in the software.
« Last Edit: March 11, 2022, 02:27:42 pm by MK14 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18906
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] DAC clock source and speed
« Reply #2 on: March 11, 2022, 02:30:47 pm »
Ah, good detective work, I thought the DAC would be covered in the analogue section of electrical specs completely.

So there is still no clue as to the actual clock cycles required to carry out a conversion other than maybe the dropping of a hint in the voltage pump settings. I don't need speed but have so far just run everything off the one clock channel at 48MHz
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 12494
  • Country: us
    • Personal site
Re: [SAMC] DAC clock source and speed
« Reply #3 on: March 11, 2022, 05:10:22 pm »
Conversion time is variable and depends on the previous value. You can clock the DAC with 48 MHz, there is no issue doing that. If you need specific sampling rate, you must use external timing trigger, like a timer. And if you need regular updates at high rate, it is better to use DMA and trigger DMA transfers from the timer.
« Last Edit: March 11, 2022, 05:12:06 pm by ataradov »
Alex
 
The following users thanked this post: MK14

Offline MK14

  • Super Contributor
  • ***
  • Posts: 5385
  • Country: gb
Re: [SAMC] DAC clock source and speed
« Reply #4 on: March 11, 2022, 08:26:12 pm »
More information about the DAC, seems to be here:

https://microchipdeveloper.com/32arm:samd21-dac-overview

Quote
Conversion Time
DAC conversion time is approximately 2.85 μs. You must ensure that new data is not written to the DAC before the last conversion is complete. Conversions should be triggered by a periodic event from a Timer/Counter or another peripheral.

Also, this one (about driving software and stuff):
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42110-SAM0-Digital-to-Analog-(DAC)-Driver_Application%20Note_AT03244.pdf
« Last Edit: March 11, 2022, 08:29:39 pm by MK14 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18906
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] DAC clock source and speed
« Reply #5 on: March 12, 2022, 02:26:53 pm »
Conversion time is variable and depends on the previous value. You can clock the DAC with 48 MHz, there is no issue doing that. If you need specific sampling rate, you must use external timing trigger, like a timer. And if you need regular updates at high rate, it is better to use DMA and trigger DMA transfers from the timer.

No speed is not an issue, just avoiding more clocks than I need although there is little reason to have a 48MHz clock at all so could reduce it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->