adc periodic framework using both adc0, and 1, and their timing between them

Dear Forum,

 

I have a few questions about the configuration and use the of the periodic framework for the adc.  I am needing to setup and run both adc's at the same time.  From the looks of it and from a few trials it seems like you can only setup one framework for a specific adc.  What Im hoping to do is to be able to have some adc start signal start both adc at the same time.  Is there a way to do this?  Can this also be done with the sample and hold circuitry enabled?  Basically Im needing to capture 6 channels all at the same time. 

Second question is with the configuration, of the "length of data-buffer" in the properties of the periodic framework.  I have 4 channels Im sampling, and have 100 sampling iterations, that will produce 400 sample registers that will be filled.  But when I set that up and run  I get the BSP_CFG_HANDLE_UNRECOVERABLE_ERROR (0); withing the void g_sf_adc_periodic0_err_callback_internal(void * p_instance, void * p_data).  Since I have this setup as 12 bit samples, Im guessing these are all stored as 16bit unsigned ints.  Not 32 bit.  So then is the "length of data-buffer" a size defined as 8 bits or is it actually 16 bit for data space.  It acts like its 8 bit, cause if I increase the size in the above example from 400 to 800 it works just fine.  Or is it that you cant have "length of data-buffer" equal to the exact number of storage locations required.    

Third thing I noticed as I was testing out the adc's was cross talk.  I saw at most 20 bits of cross talk.  My test setup was simply 8 pots, connected between 3.3v and ground on a SK board plugged into the j20 connector.  The wipers of the pots were fed back into ADC000-003, and ADC100-103.  Basically the first 4 channels of each adc.  Im thinking this must be simply a setup or some kind of code issue.  But the cross talk should in no way be this bad right?  I could find no reference to cross talk in the user manual ver 1.2 from aug 2016.  Is it maybe called something different? 

Thank You
Matt

  • Hello Karol,

    I have question with respect to the Length of data-buffer. I need 8 adc input. So Im using the first 7 and then #19. These were setup in the driver under the periodic framework. When I go and define the length of data-buffer I need to define at least 40 so that I do get errors. There are 12 memory locations that are then required but not used. Lots of wasted space. Is there a way with the the periodic framework to not need the extra unused space between 7 and 19 on the adc channels? Im thinking that dtc is not able to do anything other then a linear memory space move and cant do just the used memory space. Is that correct or is there a way to do it with out wasting the space?

    Thanks
    Matt

  • Hello Matt,

    I'm afraid this won't be possible with periodic ADC Framework. For any channel sequence, the framework would select a vector of channels starting at the lowest one and ending at the highest one. These register addresses will then be used as a source for data transfer into Framework-defined buffer. If the sequence was non-continuous, multiple transfers would be required.

    Depending on how often you're sampling the data, it may be better idea to use driver only. When configured in continuous mode, at any point in your application you can call read to retrieve the latest reading from ADC registers. Pairing this up with the dedicated thread to capture readings periodically will result in a reasonably simple, yet efficient, solution.

    Regards
  • Hello Karol,
    Yeah I was afraid that might be the case. Sample rate is currently at 1ksps for each 8 channels. In this application I think that rate is just fine and might be able to be decreased. Though I have another application where Ill need that to be on order of 3 to 5 times faster.

    Karol Thank you for the input and response.

    Matt
  • Hello Karol,

    So I was just doubling checking things today and walking though the adc setup.  I was using E2 studio to verify the registers for the adc were getting the proper timing values set when I stumbled across something that looks like its missing.  In the IO registers ADSSTR00-06 hold AN000-006, ADSSTRL holds AN016-21 are for storing the samplestate values.  From the looks in the debugger ADSSTR06 is not displayed.  Im thinking its getting set, but it just does not show.  Maybe a bug in the debugger tool?  

    Thanks

    Matt

  • Hi Matt,

    Indeed this is a bug. As a workaround, you may use Expressions tab to read ADSSTR06 at 0x4005C0E6. Hopefully this will be fixed in the upcoming release.

    Regards,
    adboc
  • I'm interested if some body find a way 2 use 2 adc periodic?
    thanks
  • Hi skipat,

    You may add two ADC Periodic Framework instances in the configurator and configure underlying ADC drivers to use a distinct unit.

    Regards,
    adboc