How do I route the data to the DAC?

I want to use DTC to transfer data from a memory location to the DAC when a GPT fires. I set the source address to the memory location but how do I route the data to the DAC?
  • Hi Doug-
    Take a look at using the ELC (Event link controller). The module guide with an application project for the ELC is here:
    www.renesas.com/.../D6001434.html

    It used the ELC to control the ADC, DTC, AGT, GPT and DAC. It should give you a good starting point for your project.

    Warren
  • Hi Doug,

    You can set destination address to be address of DAC Data Register, i.e. &R_DAC->DADRn_b[0].DADR; (or &R_DAC->DADRn[0];) where "0" is replaced by the DAC channel number (0 or 1).

    Regards
  • In reply to Renesas Karol:

    Very good thanks. Here is the code I'm using
    g_transfer3_info.p_src = wave;
    g_transfer3_info.p_dest = &R_DAC->DADRn[1];

    status = g_transfer3.p_api->open(g_transfer3.p_ctrl,g_transfer3.p_cfg);

    wave is const 256 element array.

    When I call the open function I get a SSP_ERR_IRQ_BSP_DISABLED error.

    What would cause this error?
  • In reply to Doug:

    Hello Doug,

    The IRQ to trigger the transfer is not enabled. Please verify your configuration inside the configurator window. I highly recommend disabling auto-enable so that you can specify necessary information by starting the transfer with p_api->reset().

    Regards
  • In reply to Renesas Karol:

    Hi Karol,
    Thanks for your help. I had the timer overflow IRQ set but I set the DTC trigger on timer underflow. Once I changed it everything worked. Newbie error.
    Regards