Hi Rick
I dusted off my DEMO board and loaded the project with your DMA configuration.
AN0 toggled with a frequency of 1.012kHz (an interrupt every 496us).
Then I did the same with the macro:
dma_timer_setup.count_delay = DMA_TIMER_US_DELAY(1,16,(1000000/2/2000));
where the parameters are 1 = divider, 16 prescaler (because you are setting the prescaler with the parameter DMA_TIMER_INTERNAL_CLOCK_DIV_16), 1000000/2/2000 is the delay expressed in us (for the us macro) but written so that the frequency can be given rather than the us delay - the frequency is set for 2kHz since you have a note that you wanted 2kHz. (In other words 250us is the half period to generate a 2000Hz square wave).
This then gave a 2'000Hz on AN0.
I then tried by removing the prescaler (It is not needed to generate 2kHz) and tested the following:
dma_timer_setup.mode = (DMA_TIMER_INTERNAL_CLOCK | DMA_TIMER_RESTART_ON_MATCH | DMA_TIMER_PERIODIC_INTERRUPT );
dma_timer_setup.count_delay = DMA_TIMER_US_DELAY(1,1,(1000000/2/2000)); // prescaler set to 1
This again gave 2'000Hz.
In the first case DTRR3 was set with 936 and the second case with 14999 (decimal).
Which values were you using for the macro? Do you want 2kHz or 1kHz? Note that the demo project is running with 60MHz PLL and any changes in PLL should automatically be adjusted by the macro.
regards
Mark