Making sense of VLEN_LENH and LENL dma bytes

The defined use of these two bytes in the comments within the DMA_CONFIG definition in cc2511_map.h are as below…

/*! Bits 7:5 are VLEN, bits 4:0 are LEN[12:8] */
unsigned char VLEN_LENH;
unsigned char LENL;

So in the test_radio_signal_tx.c example, I see this where the structure is initialized. = 1 + RADIO_PACKET_SIZE; = 0b00100000; // Transfer length is FirstByte+1  

I believe the structure description is telling me that all 8 bits of LENL and the lowest 5 bits (0->4) of VLEN_LENH form a 13 bits number describing the length of the packet including everything but the crc. So my first question, 13 bits is a maximum of 8192 bytes. Surely the maximum packet size can’t be anywhere near that, right? What is the true practical max size?

Second, I see that the upper 3 bits (7:5) of VLEN_LENH in this case is “001”. How is this interpreted? I see in the example that the very first byte of the packet buffer is used to convey the length, but the comments indicate that the transfer length is “FirstByte + 1”. Of course the example works, but this is a little confusing.

The PKTLEN register is 8 bits; if I recall correctly the maximum packet size is 255, but most of our apps use much shorter packets.

Please see the datasheet of the CC2511F32 for a description of what those bits mean. You should read the section about DMA. Let me know if you cannot find your answers there.


Well 256 bytes makes more sense. But I was asking about the DMA_CONFIG definition, which is apparently the way the test_radio_signal_tx and rx examples use to interface with the radio. I guess its the DMA operations that have a possible max of 8192 bytes transferred to memory, using all of one byte and 5 bits of another, which makes more sense.

But unless I’m mistaken this DMA_CONFIG structure is an invention of Polulu, so its pretty tough to trace back from the CC2511F32 doc to find out how the structure is used inside your library. Another example, the DC6 member of that DMA_CONFIG structure is filled with “19” in the test_radio_signal_tx example… = 19; // WORDSIZE = 0, TMODE = 0, TRIG = 19 

When i look at the definition in cc2511_map.h, it says…

 * NOTE: You won't find DC6 or DC7 in the datasheet, the names of
 * those bytes were invented for this struct. */

So what does the 19 mean? Please understand I only started with this code because in the topic “Send 1 byte as fast as possible” here on this forum, YOU recommended the person posting the request look at this app as an example of a way to send data faster than the “IO repeater”. I don’t mind digging through manufacturers documentation to see how bits in registers are used, but if we’re talking about a structure Polulu invented for use in its internal library, there ought to be a reference document somewhere. I can see these struct members are similarly referenced in the SRC for the radio_mac library too, but no explanations are offered, so they might as well be magic numbers

This DMA structure is a special sequence of bytes that is read by the CC2511F32; it’s the way that user software communicates to the CC2511F32’s DMA module what kind of transfer we want to perform. The format of that structure is dictated by the CC2511F32, and it is documented in the datasheet. The datasheet is the reference document. Please see Table 52 in the datasheet. DC6 is the byte that contains all the bitfields whose “Byte Offset” (the left column) is 6. DC7 is the byte that contains all the bitfields whose byte offset is 7.


Thanks!!! That’s exactly what I needed.