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.

Sample data with ADC and store the data into SD card

Other Parts Discussed in Thread: ADS8365, TMS320C6747

Hello,

I use ADS8365 to sample speech signal with TMS320C6747 and I want to store the data into SD card timely.
I find the card write/read data slowly and often get stuck when work together with the ADC interrupt.
I don't know why,Is there anybody meet this problem?


thank you!

  • Hi Tong,

    I find the card write/read data slowly and often get stuck when work together with the ADC interrupt.

    What is the type of code are you using?

    SYS/BIOS or Starterware code or any example projects or own code,

    What type of memory transfer are you using?

    I think that  you are using EDMA peripheral for memory transfers,

    If yes, Could you please check the error control registers on EDMA.

  • Hi Titusrathinaraj Stalin,

    thank you for your reply!

    I use my own code which refer to the Digital Spectrum corporation.Yes,I use EDMA transfer the data.

    I check the ERRSTAT register and its value is 0x00000009.(1.User attempt to read or write to an invalid address in configuration map;2.EDMA3TC has detected an error at source or destination address.)

    But the reality is:When I debug the EDMA separately, it works well. I use continuous transferring and change the SRC and DST after each SD controller FIFO transfer completion.

    regards

  • Hi,

    I check the ERRSTAT register and its value is 0x00000009.(1.User attempt to read or write to an invalid address in configuration map;2.EDMA3TC has detected an error at source or destination address.)

    Have you cleared all the error registers before going to setup/init EDMA?

    Could you please check to ERRDET register to identify the exact error.

  • Hi,

    Thanks!

    The error is "user attempt to read or write to an invalid address ".

    The phenomenon is with the AD interrupt.The SD card transfer the wrong data or get stuck.

    There is another fact that the ADC pins(data lines and address lines)are time division multiplexing with the SD card pins(data lines and clock,cmd linds).So I must change the PINMUX registers in the AD interrupt service program. Does the pins'  function change(such as clock can stop when in the AD interrupt)affect the SD card transfer?

    Regards!

  • Hi,

    There is another fact that the ADC pins(data lines and address lines)are time division multiplexing with the SD card pins(data lines and clock,cmd linds).So I must change the PINMUX registers in the AD interrupt service program. Does the pins'  function change(such as clock can stop when in the AD interrupt)affect the SD card transfer?

    You can't access the particular pin in simultaneously for different purpose.

    If it is like that, then It is possible to affect the transfer and also I'm wondering is that It is working well while it is in debug mode.

    Right!

  • Hi tong sun,

    Thanks for your update.

    Please ensure your PINMUX registers are configured appropriately for ADC pins & SD card pins, if pinmux is configured properly, probably, you do not have to think about the possibility of pin functionality change and also, the AD interrupt wouldn't affect the SD card transfer.

    Alternatively, you could think about probing the appropriate ADC & SD card pins through scope for any malfunction which you really suspect, sothat, you could narrow down your issue to greater extent. Also, please enable all error condition flags in the appropriate control registers, sothat, it would trigger you  appropriate error interrupt whenever there is any exception over desired stable conditions.

    Also, the other probability would be that,  EDMA servicing high priority requests from other peripherals other than AD interrupt to transfer data from ADC to SD card. May be, this could be a possibility for slow read/write operations from ADC to SD card and SD card strucks when it operates with ADC interrupt. Please find out what other priority requests are taking place at the same time when ADC is transferring data to SD card, since you need to understand the strategy of priority mechanisms across other peripherals & CPU internal memory access (L1p, L1D, L2 RAM etc)   since each DMA channel controller queues the Rx/Tx. event requests across other peripherals and prioritizes the event based on the time critical deadlines of data transfer before submitting a transfer request (TR) to the transfer controller.

    Please refer the EDMA architecture & EDMA controller user guide below to understand priority mechanims & any chance of conficts with other peripherals across different DMA data transfers:

    http://www.ti.com/lit/an/spra996/spra996.pdf

    http://www.ti.com/lit/ug/spru234c/spru234c.pdf

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------
  • Hi,

    Yes,I can't change the pin function  while SD card transfer data.

    It can't work while in debug mode.It only works well when I close the ADC interrupt.

    Now it seems that if I want to use AD and SD card simultaneously, I must use CPU for SD data access.I tried, but it still have the same problem with CPU access.It get wrong data or stuck when I send the read/write command.

    Does the pins function can not be changed during SD card data access operation?( the reason such as:if I change the pin function,the clock of the SD card stops,even though I change the PINMUX back, the SD card data access operation can not be right)

    Regards.