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.

CC1110 Can I put the DMA structure in CodeSpace



Hi

I am trying to use DMA for radio transactions.   Can I have the 8 byte structure that defines src address, dst address, increments, etc in codespace?  These structures never change in for my application so they can be fixed in code.  Can I just set the DMA0CFG registers to point to these tables in codespace rather than build them in XRAM?

Bill

 

 

  • Hi Bill,

    The DMA must point at XRAM space, but, the code space is mapped to XRAM, so I believe you only have to figure out the XRAM address of the codespace you are using.

    Hope this helps,

    Ron

  • Hi Bill,

    in the device datasheet I've found that:

    "13.5.2.1 Source Address (SRCADDR): The address of the location in XDATA memory space where the DMA channel shall start to read data."

    This means that there are no restrictions on the address to be specified. 

    The following code worked perfectly with IAR on CC1110:

    ______________________

    unsigned char const _code msg_buffer[ ] = "Hello, world!";

    . . .

    dmaConfig.SRCADDRH = (unsigned char) ( (unsigned int) msg_buffer >> 8 );

    dmaConfig.SRCADDRL = (unsigned char) (unsigned int) msg_buffer;

    ...

    ______________________

     

    Hope this helps.

    Priquas

     

  • The answer is yes.

     The XDATA pointer is unified, so everything except certain SFR registers are available to the DMA engine.

  • I have a related question: where does codespace end? Is there a pointer or something to the end of the end of code? We would like to store user data in flash.

  • I would suggest creating your own DATA segment.  In this way, you can have tighter control over where it is located, etc.

  • That is exactly what I would like to do, but when choosing an address in non-volatile storage to save my data, how do I know where I can save it?

    I need to know where codespace ends so I can begin my data segment... All the data sheets seem to show that data and code memory are mapped in the same contiguous block.

     

    Thanks!

  • I'm assuming you have SWRS033G downloaded from TI.  The CC1110x uses the 8051 processor.

    The 8051 is confusing if you have never seen it before.  There are a lot of 8051 tutorials out there.  Do a Google on 8051 tutorial.

    Basically Data is different from SFR is different from code is different XDATA.  However, TI mapped data and code into a "unified"  address space, and included RAM in the code executable map, along with the xdata pointer, DPTR. Therefore you can put your variables anywhere and your code anywhere.

    Depending upon your version of the CC1110 (see SWRS033G), your flash block may end at 0x1fff, 0x3fff, or 0x7fff.  Code memory always starts at 0, and flash memory in the CC1110x always starts at 0.