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 DMA setup for radio



I cannot seem to see why my CC1110 radio is not transmitting when setup with DMA. I have more or less copied the recommended examples for the PER test code and the basic examples:

static uint8 txrxbuffer[17] = {16, ..... } - first byte is length followed by 16 other bytes

dmaConfig0.SRCADDRH  = ((uint16)txrxbuffer >> 8) & 0x00FF;  // Setup the config data structure
dmaConfig0.SRCADDRL  = (uint16)txrxbuffer & 0x00FF;
dmaConfig0.DESTADDRH = ((uint16)&X_RFD >> 8) & 0x00FF;
dmaConfig0.DESTADDRL = (uint16)&X_RFD & 0x00FF;
dmaConfig0.VLEN      = DMA_VLEN_USE_LEN;
dmaConfig0.LENH      = 0;
dmaConfig0.LENL      = 17;
dmaConfig0.WORDSIZE  = DMA_WORDSIZE_BYTE;
dmaConfig0.TMODE     = DMA_TMODE_SINGLE;
dmaConfig0.TRIG      = DMA_TRIG_RADIO;
dmaConfig0.SRCINC    = DMA_SRCINC_1;
dmaConfig0.DESTINC   = DMA_DESTINC_0;
dmaConfig0.IRQMASK   = DMA_IRQMASK_ENABLE;
dmaConfig0.M8        = DMA_M8_USE_8_BITS;
dmaConfig0.PRIORITY  = DMA_PRI_LOW;
    
// Load DMA configuration to channel 1;
DMA1CFGH = ((uint16)&dmaConfig0 >> 8) & 0x00FF;
DMA1CFGL = (uint16)&dmaConfig0 & 0x00FF;

DMAARM |= DMAARM1;

RFST = RFST_STX;

- but nothing happens. I setup an interupt on RFTXRFIF and it only occurs asserts once, but no other RFIF flags are asserted to indicate underflow. Is this the correct way to load in the data length for the first transfer into RFD?

Any help much appreciated..

Richard.

  • Could it be that you are using "Data model: small" in the project setup (if you're using IAR EW8051, see Project options -> General options -> Target (tab) -> Data model)?

    This would typically cause your txrxbuffer[] to be stored in the IDATA memory, i.e. so when you try to set the SRCADDR of the DMA config you will get an address to the 256 bytes large IDATA memory space (this is the part of RAM with the fastest read/write access). The DMA can only operate on the XDATA memory space so the SRCADDR must be the XDATA address to the buffer. If you switch to "Data model: large" static / global variables and arrays will automatically be assumed located in the larger XDATA memory space, so then I think this will automatically be resolved. Since you've copied that example I guess this is what have happened. Alternatively, you may try to declare the buffer using the __xdata keyword (IAR specific for 8051s) to manually place it in the XDATA memory space, regardless of your data model, e.g. change into:

    static __xdata uint8 txrxbuffer[17] = {16 ... };

  • Thanks for the suggestion - changing to 'large' data model has solved the problem.

    Richard.

  • I've got a very similar problem.

    In RX the DMA doesn't fill the IncomingFrame structure (declared as XData) with the data from RFD and I am already using  a Large data model.  Any ideas why?

    Thank you.

     

    Tim.

  • Do you have CRC turned on? If so are you receiving two extra bytes? If this is turned on, then the two extra bytes must be read before the RFIF flag is asserted, i.e. for my original example I would need a length of 17 for the tx and 19 for the rx.

    Richard.

  •  

    Hi

     

    Just wanted to recommend you to read Design Note DN107 DMA and Radio Configuration (http://www.ti.com/lit/swra164)

    This design note shows how the DMA should be configured to match the different packet handling configurations of the CC1110.

     

    BR

     

    Siri

     

  • Thank you for your replies.

     

    Richard: Yes, I've got CRC on and DMA reads n+3 bytes from RFD, where n is defined in 1st byte.

    In my program  I am using the MRFI library and it is implemented on two boards (ED and  AP). Both of them have identical MRFI set up and the ED can receive without any problems, however,  the AP cannot process incoming packets.

    The AP triggers the RX ISR when the ED sends data, but the DMA doesn't copy bytes from RFD ( the IncomingPacket structure is empty).

     

    Siri: Thank you for the Design Note.

    Here's the DMA setup I am using:

    Source: RFD

    Destination: &mrfiIcomingPacket[0]

    VLEN: n+3

    TMODE: single

    Source increment: 0

    Destination increment: +1

    TRIG: 19 ( RF)

    Wordsize: 8bit

    IRQ: disabled

    M8: all 8bits

    Priority: normal

    With variable packet length, CRC and LQI.

    Is that what it should be or I'm missing something?

  • You can't use the sfr RFD as source or destination, you must use the one maped to xdata space, X_RFD.