1 Reply Latest reply on Oct 19, 2020 2:42 AM by VasanthR_91

    WaveDAC8_StartEx() does not work without being previously Initialized.


      I wanted to use the WaveDAC8 component with different waveforms than originally configured.  To do this, the user needs to use the WaveDAC8_StartEx() function.



      I thought that I could straight-out replace the WaveDAC8_Start() with WaveDAC8_StartEx(wave1_ptr, wave1_sz, wave2_ptr, wave2_sz).

      //    WaveDAC8_Start(); /* Start WaveDAC8  */
          WaveDAC8_StartEx(&WaveDAC8_wave1[WaveDAC8_WAVE1_LENGTH/2], WaveDAC8_WAVE1_LENGTH/2, WaveDAC8_wave2, WaveDAC8_WAVE2_LENGTH); /* Start WaveDAC8  */


      This does not work!   The originally configured waveforms are used not the 'new' defined waveforms.


      What does work as to execute the WaveDAC8_Start() first then WaveDAC8_StartEx() next :

          WaveDAC8_Start(); /* Start WaveDAC8  */
          WaveDAC8_Stop();     /* Stop before executing WaveDAC8_StartEx() */
          WaveDAC8_StartEx(&WaveDAC8_2_wave1[WaveDAC8_2_WAVE1_LENGTH/2], WaveDAC8_2_WAVE1_LENGTH/2, WaveDAC8_2_wave2, WaveDAC8_2_WAVE2_LENGTH); /* Start WaveDAC8  */



      This is because the WaveDAC8_StartEx() function is code as follows:

      void WaveDAC8_StartEx(const uint8 * wavePtr1, uint16 sampleSize1, const uint8 * wavePtr2, uint16 sampleSize2)
           WaveDAC8_Wave1Setup(wavePtr1, sampleSize1);
           WaveDAC8_Wave2Setup(wavePtr2, sampleSize2);
           WaveDAC8_Start();   /* This Start() initializes with the original configuration waveforms if not previously initialized */


      The datasheet only mentions about Stopping the WaveDAC8 before executing WaveDAC8_StartEx().   It makes NO mention about the WaveDAC8 being previously initialized.