This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADC results via CAN without core intervention

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

I understand it is possible to send the ADC results to the DMA without core intervention as per

http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/119037.aspx

Is it possible to then send this data to a single DCAN message box?

The ADC is set in continuous mode with the FIFO set to the same size as the number of channels to convert.

How would you recommend the DMA be setup, can the data only then be sent on via an interrupt?

regards,

Alan

  • Hello Alan,

    I have forwarded you question to one of our experts and they will respond soon.

  • There are two demand on the ADC modules and many ways of addressing them.

    One demand is the ad-hoc access to one of 14 adc channels split equally between the two ADC modules

    The other demand is a periodic snap-shot of all 14 adc channels to be sent for logging

    As I see it this can be done as follows

    The ad-hoc access is setup as group 1 on both modules, however the adcStartConversion function from Halcogen is not used, instead the GxSEL register is written to directly with the normal halcogen functions used to check completion and retrieval of the adc conversion data.

    The periodic snap-shot is triggered by RTI, where all channels are measured, once complete the FIFO will be full, this then undergoes a multi-word DMA transfer.

    This, I believe, removes the issue stated in the linked  thread.

    However I am unsure how to continue the final step of a independent CAN transfer.

  • Hi Alan,

    Sorry for the delay in answering. As I understand, you have setup a DMA transfer that waits for the group results' buffer to be full before transferring the accumulated results presumably to the CPU RAM.

    As for the CAN, note that the data bytes of a transmit object can be updated at any time via the IFx register sets. You could have a message object with the arbitration and control fields already setup (during CAN configuration). Now you could update the data bytes and the command control fields using DMA.

    In fact, you could use the same DMA channel to copy 8 bytes of ADC conversion results directly into the IFx data bytes, followed by another chained DMA channel that updates the IFx command register and the IFx message control register.

    Regards, Sunil

  • Hi Sunil,

    Thanks for the quick reply, that is exactly how I'd like to set it up.

    Would you happen to have some example code I could look at?  I forgot to mention I'm using the TMS570LS3137.

    The only concern I have is with how the ADC will deal with the ad-hoc request (which is time dependant) if the RTI triggered snap-shot is already taking place.

    would the use of adcStopConversion for the two relevant module sand groups be sufficient and give instant access to carry-out the ad-hoc request?

    Even if the FIFO is triggered, as I will be using a different group the data should remain separate and not interfere.

    Regards,

    Alan