Hi kepl,
so why does the DAVE APP permits FIFO size of multiples of two is because the specification defines that :)
"The size of a FIFO data buffer can only be programmed as a power of 2, starting with 2 entries, then 4 entries, then 8 entries, etc". This is written in XMC1300 Reference Manual chapter 15.2.8.1.
However, there is something else you can use...there is LIMIT parameter, that defines when the standard buffer event will be triggered. So, let´s say you define FIFO SIZE as 8 and you define LIMIT as 3...every time when the number of entries in FIFO drops below 3 (could be done other way around, when the number of entries exceeds 5, take a look at Chapter 15.2.8.2 for details), interrupt routine will be called which you can use to fill the next 5 entries and so on.
I mean, if you have ONLY 5 bytes to transmit then maybe the FIFO is not necessary, but if it´s really necessity then you can also set size 1 and you´ll have 5 interrupts and you´re done, but that makes FIFO not so useful. However, if you have a use case to transmit data in SETS of 5 bytes then I suggest you try something as I mentioned before...define SIZE as 8, and LIMIT to 3 or TBFLVL to 5 (based on LOF value).
And how to achieve something like this? If you´re using UART APP then set size as 8 in APP, and call additional XMCLib function "XMC_USIC_CH_TXFIFO_SetSizeTriggerLimit" to set the LIMIT value. OR, you can use the UART_CONFIG APP where you can define both parameters in the APP itself.
Take a look at the mentioned chapter for details and play around with the FIFO settings to get the feeling how is it working.
Best regards,
Deni
so why does the DAVE APP permits FIFO size of multiples of two is because the specification defines that :)
"The size of a FIFO data buffer can only be programmed as a power of 2, starting with 2 entries, then 4 entries, then 8 entries, etc". This is written in XMC1300 Reference Manual chapter 15.2.8.1.
However, there is something else you can use...there is LIMIT parameter, that defines when the standard buffer event will be triggered. So, let´s say you define FIFO SIZE as 8 and you define LIMIT as 3...every time when the number of entries in FIFO drops below 3 (could be done other way around, when the number of entries exceeds 5, take a look at Chapter 15.2.8.2 for details), interrupt routine will be called which you can use to fill the next 5 entries and so on.
I mean, if you have ONLY 5 bytes to transmit then maybe the FIFO is not necessary, but if it´s really necessity then you can also set size 1 and you´ll have 5 interrupts and you´re done, but that makes FIFO not so useful. However, if you have a use case to transmit data in SETS of 5 bytes then I suggest you try something as I mentioned before...define SIZE as 8, and LIMIT to 3 or TBFLVL to 5 (based on LOF value).
And how to achieve something like this? If you´re using UART APP then set size as 8 in APP, and call additional XMCLib function "XMC_USIC_CH_TXFIFO_SetSizeTriggerLimit" to set the LIMIT value. OR, you can use the UART_CONFIG APP where you can define both parameters in the APP itself.
Take a look at the mentioned chapter for details and play around with the FIFO settings to get the feeling how is it working.
Best regards,
Deni