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.

dmaCfg.rxTick on cc254x

Can someone please explain how the dmaCfg.rxTick can be used correclty on the cc254x?  Specifically in the function HalUARTPollDMA(void).

An earlier post asked the same question about the ZigBee variant of this, but the function seems to have been changed.  In particular, I don't see the rxTick member of

the data structure getting loaded or decremented.  I do see a comparison with ST0, but I'm not sure the code is correct, since ST0 will just increment from 0 to 255 and wrap around constantly as log as the code runs.

Thanks

  • Hello Beno,

    It looks like the rxTick is initialized in the struct on line 266 of the _hal_uart_dma.c.  From there, it looks like it is only used as a timeout for the Rx event when the HAL_UART_DMA_IDLE.  At that point it is compared to the set timeout period and reset if greater, a UART timeout event is then called.

    The STO value is transferred to the rxTick when the CSR_TX_BYTE flag is cleared. Line 936. It would appear that it is acting as the intermediate delay counter for signaling a timeout for sleep timer 0.

    Thanks,

  • Hi Greenja,

    Thanks for taking a look at it, but I'm not sure my question has been answered.  I do see space being allocated on the structure on line 266 -- but I don't see an explicit initialization: are we relying on a general clearing of memory to set dmaCfg.rxTick to 0x00?   As for line 936: that seems to set the dmaCfg.txTick to the value of ST0. I Still don't understand how the rxTick can be anything but 0x00 or the startup init value.

    Thanks,

    Beno

  • Hello Beno,

    If you take a closer look, I believe that It is being incremented. (not at computer now, can't verify)

    Perhaps if you have ever used the technique of having a delay while you wait for a transition to complete, you can think of it in those terms.  For example if you are sending data and there is a 5ms delay allowed between characters.  Every character resets you timer.  So the STO is the actual 5ms and the rxTick is cleared every time a new character is sent.  The rxTick count increments and if it reaches the serial time out value then it is set to 0xFF, indicating a timeout.

    That was just a way to describe the concept, the values and variables may not be accurate.  When I am at my computer I will take another look and edit is post with exactly what is going on, unless you manage to figure it out before then.

    Thanks,