atsamR34, DAC won't enable.

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I've recently started working with a SAMR34 Explained Development board, which has the SAMR34 on it.   The sam R34 is a L21 plus a LoraWan Radio in the same package.    I had hoped to be able to use the DAC to output a short low sample rate audio tone.       The ASF wizard does not appear to be completed for the R34 and quite a few things that are available for the L21 don't' feature in the R34 setup.   None the less I copied files across from the corresponding L21 library and added them to the compiler;    Project attached. 

The project compiles and runs, but gets stuck in the while loop 


while (!dac_chan_is_end_of_conversion(&dac_module, DAC_CHANNEL_1)) 

The DAC is never completing its conversion :-(

The debugging I've been able to do;

  • The timer is running and incrementing as expected.     events_allocate() and events_attach_user  both return STATUS_OK.  
  • The Registers ( attached ) show that the DAC is not enabled.  :-(


I have to use DAC 1 because the only options for the multiplex is to port PA05.  DAC0 is not exposed on the R34  ( several of the 'pins' are used to connect to the Radio Chip, PA02 being one of them, which is where DAC0 goes ).

I did, however, try using DAC0,    to see what happens..   you can enable that, and the DAC appears to convert the samples, however, because its a PIN I can't access its not much good.

Does anyone have any suggestions as to why DAC1 won't' enable?     Code attached. 




Connecting things, making them blink and beeb

Last Edited: Mon. Mar 4, 2019 - 07:44 PM