Some advice, please, on ADC with the F28069

I have taken the ADCtestF28069 example and modified it for learning purposes. Instead of using the direct monitoring of an analog channel, I have changed the program to use the Monitor Buffer facility. This is working well, except for the following:

I have sized my buffer to 2500 bytes (or is that words?). Over the course of ten seconds, the buffer updates twice on the plot - an average of five seconds to fill the buffer. This makes me think that the ADC is sampling at about 500 Hz. I need about 2 MHz sample rate on one channel.

Could you please check the attached files and tell me what I have incorrectly configured?

Thank you in advance.

Yes, that leads me down the

Yes, that leads me down the right road. Thank you for the information.


Lxman, your diagram is

Lxman, your diagram is configured to run at 1 kHz, so even though you are pacing the ADC0 to trigger at 2 MHz, you are only recording the ADC0 data to the buffer at 1 kHz. In the attached file, the ADC read and store to the monitor buffer is done inside an ADC EOC0 interrupt handler. This is done by:

  1. Encapsulate the ADC read and store to monitor buffer inside the "ADC Sample" compound block
  2. ctrl+right click on the compound block and select the "Execute on Interrupt" option
  3. Click the "Select..." button
  4. Choose ADCINT1 from the list (any ADCINT will work)
  5. Select EOC0 (End Of Conversion channel 0) under "Mode" As we recently added the Piccolo ADC interrupt option, you may need to download and install the latest version of ECD from our website. As always, do not uninstall your current VisSim, just run this install and it will update files as needed.

Note that taking interrupts at 2 MHz on an 80 MHz part is a tall order. You only have 40 processor ticks in which to accomplish the interrupt vector, pipeline stall, stack save, VisSim code, stack restore, return and pipeline stall. I suspect you will need to back down to 1 Mhz to get this to work.