SSC transmit

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

cross mob
User8819
Level 4
Level 4
Hello,

I am transmitting 16bit data over SSC configured as master 1MHz every 1ms on xmc4108. Bellow is my code

void TransmitSPI1(uint16_t value){

// check if transmit event occurred, buffer is empty
if(USIC0_CH1->PSR_SSCMode & (uint32_t)USIC_CH_PSR_SSCMode_TBIF_Msk){
// write data to output
USIC0_CH1->TBUF[0] = (uint16_t)value;
// clear transmit event flag
USIC0_CH1->PSCR |= (uint32_t)USIC_CH_PSCR_CTBIF_Msk;
}
}

My problem is that after some random time (in the order of seconds) TBIF is not set anymore and therefore transmission stops.

What could be the reason why data is not transferred to shift register and transmit buffer is emptied for next data? What can I check to find the cause of this behavior?

Please do not answer to check DAVE app.

rum
0 Likes
1 Reply
User8819
Level 4
Level 4
I solved the problem by exchanging two lines of code. First, erase the flag then write to transmit buffer. But I wonder why it was working also before but only for some time.
0 Likes