Loading ...
Sorry, an error occurred while loading the content.

DMA Receive from peripheral

Expand Messages
  • hammond_sp
    Hello, I ve been having some trouble using the DMA module on the TMS470R1B1M lately. I want to be able to use it to send and receive data through GIOE either
    Message 1 of 1 , Oct 2, 2008
    • 0 Attachment
      Hello,

      I've been having some trouble using the DMA module on the TMS470R1B1M
      lately. I want to be able to use it to send and receive data through
      GIOE either using just the regular GIO registers or through the
      expansion bus module.

      So fat I've been able to send data from RAM out through GIOE without
      touching the EBM, but trying to read from GIOE only pulls zeroes no
      matter what's on the buffer. Here's the source I'm using to receive data:

      void DMAReceive(unsigned short DataLength)
      {

      // DMA Control recieve from GIOE

      // Recieving on channel 0, through packet 0
      DMAC00 = NCPACK_0 // Using packet 0
      + TRSIZE_0 // 8 bit data width
      + DSTINC // incrementing the destination
      + DSTMOD_2 // transmitting to fine memory 2 (RAM)
      + SRCMOD_15; // transmitting from peripheral (GIOE)


      DMASA00 = (unsigned long)&GIODINE; // Getting data from GIOE
      DMADA00 = (unsigned long)&rxbuffer; // Sending data to our recieve
      buffer
      DMATC00 = (unsigned short)DataLength; // Load the number of bytes to
      transmit

      // DMA channel initialization

      DMACC0 |= SEN0; // Enabling channel 0

      // DMA global registers initialization

      DMAGC = 0; // One byte per CPU cycle, normal operation in suspend
      DMAGD = 0; // DMA is not stopped or halted
      DMACPS |= RX_PACKET; // Control packet 0 is ready
      DMACCP0 |= DMEN0 + CCPACK0_0; // Enable channel 0 using packet 0
      }

      My main is pretty simple, just enabling peripherals and setting up
      GIOE. I've tried fiddling with the EBM a little, but don't know it
      well enough to say it's making or breaking the program. Debugging the
      program shows that I'm receiving the correct data in GIODINE, but the
      rxbuffer is always filled with 0x00. As a precaution, I fill the
      rxbuffer with other values to make sure SOMETHING is being moved
      through the DMA, and no matter what values I start with I always end
      with a buffer full of 0x00.

      Thanks in advance for the help.
      -hammond
    Your message has been successfully submitted and would be delivered to recipients shortly.