Home › Forums › Software › Audesse Flexcase G ADC Setup

Viewing 2 reply threads
  • Author
    Posts
    • samfayezsamfayez
      Participant
      Post count: 1

      Hey Audesse team,

      I am trying to read ADC values from an Audesse FlexCase G on Simulink.

      My ADC configuration is as follows:

      – ADC instance: ADC0
      – ADC group: ADC0Group
      – Group definition: by default it contains 15 ADC channels/elements
      – Conversion mode: Continuous

      My current Simulink flow is essentially:

      Initialization:

      1. Configure/setup the ADC result buffer (uint16, dimension 15) using the ADC_SetupResultBuffer block.
      2. Enable ADC group notification using the ADC_EnableGroupNotification block.
      3. Start ADC conversion using the ADC_StartGroupConversion block.

      During operation:

      1. ADC hardware interrupt occurs.
      2. ADC Read Group block executes.
      3. I read the Data output from the ADC Read Group.

      Its my understanding that the Data output is a uint16 vector with 15 elements, which should correspond to the 15 elements configured in ADC0Group0. However, the Data output is currently returning all zeros.

      I have tested my wiring and input signal and have determined it is functioning correctly. Our input range is 0-5V.
      The pins used are as follows:
      – FCG J1-23 Analog Input 2 0-36V [PTE15/ADC0_P3]
      – FCG J1-24 Analog Input 4 0-36V [PTD0/ADC0_P1]

      We need to measure these signals at a constant sample-time of 1ms (we have a GPT already running at that rate.) Could you please guide us on how to get ADC measurements at fixed sample rates? Is there an example of the correct configuration/Simulink block sequence for this setup?

      Any insight on the matter would be greatly appreciated.

      Thank you,
      Samer

    • AmirFAmirF
      Moderator
      Post count: 38

      Hi Samer,

      We are currently working on an ADC example for K3 and we will try to release it by Friday. That should help with the ADC read. You should be able to find it on the Download page once it is uploaded.

      For the all zero reading issue, try using the “Adc_GetStreamLastPointer” block instead of the “Adc_ReadGroup”. For the data store memories used for “Adc_SetupResultbuffer” and “Adc_GetStreamLastPointer”, both can be initial value:zeros(1,15) and type:uint16.

      Regarding your 1ms requirement. That is worth flagging before you go further. The default group uses a sampling duration of 255 with 32× hardware averaging across all 15 channels, which works out to roughly 1.6–3.3 ms for a single pass depending on ADC clock. A 1 kHz rate simply isn’t reachable with that group as configured.

      The easiest fix is to make a smaller group in the configuration tool. Conversion time scales directly with channel count, and you only need two channels. A dedicated group containing just AI2 and AI4 comes in around 0.2–0.45 ms per pass, comfortably inside 1 ms without touching the averaging or sampling duration at all. If you do need the full set of 15 at rate later, then start trimming AdcSamplingDuration (255 is very conservative, 20–40 is usually fine for a low-impedance divider) and dropping the averaging to SAMPLES_4 or SAMPLES_8. This might lower the accuracy of the ADC read on those channels.

      One other note: continuous mode free-runs at the ADC’s own period, asynchronous to your model rate, so you’ll see jitter and the odd duplicated or skipped sample. For a fixed rate, use a one-shot group triggered from your 1 ms task, or a BCTU hardware trigger off an eMIOS channel if you need real determinism.

      Thanks,
      Amir

    • rhyse.maryniukAudesse Team
      Keymaster
      Post count: 27

      Hi Samer,

      Please see the recently updated example files for your reference. There are now some ADC examples there.

      Best,

      Rhyse

Viewing 2 reply threads
  • You must be logged in to reply to this topic.