Mar 06, 2014
03:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 06, 2014
03:10 AM
Hi everyone,
I'm using the XMC1302 (200kB) together with an I2C DAC.
Talking to the DAC works fine, but now I wanted to implement the reaction on a not working DAC
and I'm trying for many days without success.
The major malfunction case is a not connected DAC device.
I do see that the TX-FIFO is not totally empty and the i2cSend() is not sending pulses on the SCL line (even the function returns a DAVE_SUCCESS...)
Now I'm looking for a way to RESET the whole I2C system, but I can't get it back to work. Only a chip reset does it.
I tried I2C_Init() and even together with UART001_Init() it does not come back to live.
Can anybody give me a hint how to restart the whole I2C system without resetting the micro?
Thanks for any help provided.
Michael
I'm using the XMC1302 (200kB) together with an I2C DAC.
Talking to the DAC works fine, but now I wanted to implement the reaction on a not working DAC
and I'm trying for many days without success.
The major malfunction case is a not connected DAC device.
I do see that the TX-FIFO is not totally empty and the i2cSend() is not sending pulses on the SCL line (even the function returns a DAVE_SUCCESS...)
Now I'm looking for a way to RESET the whole I2C system, but I can't get it back to work. Only a chip reset does it.
I tried I2C_Init() and even together with UART001_Init() it does not come back to live.
Can anybody give me a hint how to restart the whole I2C system without resetting the micro?
Thanks for any help provided.
Michael
- Tags:
- IFX
2 Replies
Not applicable
Mar 07, 2014
01:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 07, 2014
01:09 AM
I found this code in another thread and it works for me.
After flushing the FIFO and clearing the TDV bit, the FIFO has to be refilled though.
if(USIC1_CH1->PSR_IICMode & (USIC_CH_PSR_IICMode_ERR_Msk | USIC_CH_PSR_IICMode_NACK_Msk)) {
// Clear error bits
USIC1_CH1->PSCR |= 0x3FF;
// Flush transmit FIFO buffer
USIC1_CH1->TRBSCR |= USIC_CH_TRBSCR_FLUSHTB_Msk;
// Modify Transmit Data Valid
WR_REG(USIC1_CH1->FMR, USIC_CH_FMR_MTDV_Msk, USIC_CH_FMR_MTDV_Pos, 2);
After flushing the FIFO and clearing the TDV bit, the FIFO has to be refilled though.
Mar 07, 2014
02:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 07, 2014
02:05 AM
😄
Thanks for your help!
I did think of the TDV bit, but I did not clear the right bit location...
Now it works!
I think, if making apps, such important things like resetting the I²C state machine should be covered by the app.
I like the dozens of empty DeInit functions in the generated dave code :rolleyes:
Thanks agian!
Michael
Thanks for your help!
I did think of the TDV bit, but I did not clear the right bit location...
Now it works!
I think, if making apps, such important things like resetting the I²C state machine should be covered by the app.
I like the dozens of empty DeInit functions in the generated dave code :rolleyes:
Thanks agian!
Michael