Transmit Buffer Error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I get a buffer error in this case to send 511 dmx frames.

for(uint16_t i = 0; i < 512; i++)
USIC0_CH1->IN[0] = *dmx_space;

Than you for every help,
Bernd
0 Likes
2 Replies
chismo
Employee
Employee
First like received
Hello Bernd,

The FIFO size in the USIC module is 64 words so it would not be possible to send the complete 511 dmx frames at one go.
When further writes are made to a full buffer, a transmit buffer event will be indicated, which seems to be the case here.

Regards,
Min Wei
0 Likes
Not applicable
I found a solution:

//*********************************************************************************************************************
bool CtrlTXbuffer(void){
bool var = false;
uint8_t x = 0;
x = RD_REG(USIC0_CH1->TRBSR, USIC_CH_TRBSR_TEMPTY_Msk, USIC_CH_TRBSR_TEMPTY_Pos);
if(x == 1){
var = true;
}
else
var = false;

return var;
}//End CtrlTXbuffer
//*********************************************************************************************************************


for(uint16_t i = 0; i < *number_of_channels; i++){
while(CtrlTXbuffer() == false){;}
USIC0_CH1->IN[0] = *dmx_space;

++dmx_space;
}
0 Likes