Not applicable
Jan 09, 2013
06:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 09, 2013
06:31 AM
Hi!
I've written a piece of code to read data on the IIC-Bus (similar to the example of the help) using the APP I2C001[1.0.12]
IIC_Data1.Data1.TDF_Type = I2C_TDF_MStart;
IIC_Data1.Data1.Data = 0x80;
I2C001_WriteData(&I2C001_Handle0, &IIC_Data1);
IIC_Data2.Data1.TDF_Type = I2C_TDF_MTxData;
IIC_Data2.Data1.Data = 0x02;
I2C001_WriteData(&I2C001_Handle0, &IIC_Data2);
IIC_Data3.Data1.TDF_Type = I2C_TDF_MRStart;
IIC_Data3.Data1.Data = 0x81;
I2C001_WriteData(&I2C001_Handle0, &IIC_Data3);
....
The Problem ist that in the 3rd call of I2C001_WriteData-Funktion the program hangs up and the debugger crashs. The free running program is not working.
The transmit FIFO size is >2. (e.g. 16)
Any ideas?
Carsten
I've written a piece of code to read data on the IIC-Bus (similar to the example of the help) using the APP I2C001[1.0.12]
IIC_Data1.Data1.TDF_Type = I2C_TDF_MStart;
IIC_Data1.Data1.Data = 0x80;
I2C001_WriteData(&I2C001_Handle0, &IIC_Data1);
IIC_Data2.Data1.TDF_Type = I2C_TDF_MTxData;
IIC_Data2.Data1.Data = 0x02;
I2C001_WriteData(&I2C001_Handle0, &IIC_Data2);
IIC_Data3.Data1.TDF_Type = I2C_TDF_MRStart;
IIC_Data3.Data1.Data = 0x81;
I2C001_WriteData(&I2C001_Handle0, &IIC_Data3);
....
The Problem ist that in the 3rd call of I2C001_WriteData-Funktion the program hangs up and the debugger crashs. The free running program is not working.
The transmit FIFO size is >2. (e.g. 16)
Any ideas?
Carsten
- Tags:
- IFX
10 Replies
Jan 16, 2013
05:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 16, 2013
05:11 AM
Hey Carsten,
do you using a Board from IFX, if yes, can you post the complete project so that we can reproduce the problem.
do you using a Board from IFX, if yes, can you post the complete project so that we can reproduce the problem.
Not applicable
Jan 17, 2013
11:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 17, 2013
11:41 PM
Hi Ron,
I'm using the XMC4500 Relax Kit.
Last year in september I build up a project with an old I²C App running on the hexagon-kit without any problem.
Which files do you need? The whole project folder is too big to upload.
I'm using the XMC4500 Relax Kit.
Last year in september I build up a project with an old I²C App running on the hexagon-kit without any problem.
Which files do you need? The whole project folder is too big to upload.
Jan 21, 2013
06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2013
06:22 AM
Hey
then please send me the Main.c file. This should be ok and the Pins you are using for the IIC Pins.
then please send me the Main.c file. This should be ok and the Pins you are using for the IIC Pins.
Attachments are accessible only for community members.
Not applicable
Jan 21, 2013
07:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2013
07:11 AM
Jan 24, 2013
04:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 24, 2013
04:17 AM
Hey Carsten,
I try to reproduce your issue but I can not find a problem. I'm using a Hexagon Kit with the IO expander, for debugging I use the segger debugger. Can you try to find out where exactly on you side the program stops working, go step by step trough the code. Then try to create a standalone project just with IIC and use onyl one sequence to read the temp for example.
I modify you code a bit to have a kind of error handling.
do{
IIC_Data1.Data1.TDF_Type = I2C_TDF_MStart;
IIC_Data1.Data1.Data = 0x9A; //IO expander
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data1);
if (IIC_Status==FALSE)break;
IIC_Data2.Data1.TDF_Type = I2C_TDF_MTxData;
IIC_Data2.Data1.Data = 0x08; //Register 0x08
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data2);
if (IIC_Status==FALSE)break;
IIC_Data3.Data1.TDF_Type = I2C_TDF_MRStart;
IIC_Data3.Data1.Data = 0x9A |0x01; //Address + 1 for read
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data3);
if (IIC_Status==FALSE)break;
IIC_Data4.Data1.TDF_Type = I2C_TDF_MRxAck1;
IIC_Data4.Data1.Data = 0xFF;
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data4);
if (IIC_Status==FALSE)break;
}while(0);
IIC_Data5.Data1.TDF_Type = I2C_TDF_MStop;
IIC_Data5.Data1.Data = 0xFF;
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data5);
if (IIC_Status==FALSE){
USBVC001_SendString((const char *)" Transfer FAIL");
/* here the I2C Bus error handling must be added*/
}
else{
IIC_Status = I2C001_ReadData(&I2C001_Handle0, &ReceivedData);
ReceivedData = (ReceivedData & 0xFF);
USBVC001_SendByte(ReceivedData);
}
I try to reproduce your issue but I can not find a problem. I'm using a Hexagon Kit with the IO expander, for debugging I use the segger debugger. Can you try to find out where exactly on you side the program stops working, go step by step trough the code. Then try to create a standalone project just with IIC and use onyl one sequence to read the temp for example.
I modify you code a bit to have a kind of error handling.
do{
IIC_Data1.Data1.TDF_Type = I2C_TDF_MStart;
IIC_Data1.Data1.Data = 0x9A; //IO expander
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data1);
if (IIC_Status==FALSE)break;
IIC_Data2.Data1.TDF_Type = I2C_TDF_MTxData;
IIC_Data2.Data1.Data = 0x08; //Register 0x08
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data2);
if (IIC_Status==FALSE)break;
IIC_Data3.Data1.TDF_Type = I2C_TDF_MRStart;
IIC_Data3.Data1.Data = 0x9A |0x01; //Address + 1 for read
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data3);
if (IIC_Status==FALSE)break;
IIC_Data4.Data1.TDF_Type = I2C_TDF_MRxAck1;
IIC_Data4.Data1.Data = 0xFF;
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data4);
if (IIC_Status==FALSE)break;
}while(0);
IIC_Data5.Data1.TDF_Type = I2C_TDF_MStop;
IIC_Data5.Data1.Data = 0xFF;
IIC_Status = I2C001_WriteData(&I2C001_Handle0, &IIC_Data5);
if (IIC_Status==FALSE){
USBVC001_SendString((const char *)" Transfer FAIL");
/* here the I2C Bus error handling must be added*/
}
else{
IIC_Status = I2C001_ReadData(&I2C001_Handle0, &ReceivedData);
ReceivedData = (ReceivedData & 0xFF);
USBVC001_SendByte(ReceivedData);
}
Not applicable
Jan 28, 2013
05:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2013
05:02 AM
Hi Ron,
I've created a new project only using the I2C-App. But I still have the problem with the 3rd call of the I2C001_WriteData call.
In single step the program stops working at
if(I2CRegs->PSR_IICMode & USIC_CH_PSR_IICMode_WTDF_Msk)
I've created a new project only using the I2C-App. But I still have the problem with the 3rd call of the I2C001_WriteData call.
In single step the program stops working at
if(I2CRegs->PSR_IICMode & USIC_CH_PSR_IICMode_WTDF_Msk)
Not applicable
Jan 28, 2013
05:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 28, 2013
05:54 AM
Hi Ron,
I had a closer look to the hardware and put a oscilloscope on SCL and SDA lines. There are no changes. The lines are all on 3.3V because of the 10k pullups I've connected.
As said. In the past I had no problem on the Hexagon Kit. So this could be an issue with the relax kit.
I had a closer look to the hardware and put a oscilloscope on SCL and SDA lines. There are no changes. The lines are all on 3.3V because of the 10k pullups I've connected.
As said. In the past I had no problem on the Hexagon Kit. So this could be an issue with the relax kit.
Not applicable
Feb 01, 2013
02:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 01, 2013
02:34 AM
Hi Ron,
I changed the I2C Pins to 0.8 + 1.5. Now it's working. Even if there is no i2c slave the function doesn't crash.
So i think you have a problem with the setting to 5.0 + 5.2 as i2c pins.
I changed the I2C Pins to 0.8 + 1.5. Now it's working. Even if there is no i2c slave the function doesn't crash.
So i think you have a problem with the setting to 5.0 + 5.2 as i2c pins.
Feb 14, 2013
01:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 14, 2013
01:21 AM
Hey Carsten,
just for post all the informations we exchange outside of the forum.
On XMC4500 AA13 Step which is currently on all of our Kit's we have an issue with the USIC2 FIFO which is used in the I2C001. --> USIC_AI.012 USIC2 does not provide FIFO buffer
capability Therfore on the latest DAVE3 version and App's I can not assign the 5.0 + 5.2 as i2c pins.
Never the less I can not reproduce the program hangs up and the debugger crashs. The reason is if there is no Slave connected on the pins the USIC will stop stranfering data after the first word he send out when not getting a ACK from the Slave IC.
just for post all the informations we exchange outside of the forum.
On XMC4500 AA13 Step which is currently on all of our Kit's we have an issue with the USIC2 FIFO which is used in the I2C001. --> USIC_AI.012 USIC2 does not provide FIFO buffer
capability Therfore on the latest DAVE3 version and App's I can not assign the 5.0 + 5.2 as i2c pins.
Never the less I can not reproduce the program hangs up and the debugger crashs. The reason is if there is no Slave connected on the pins the USIC will stop stranfering data after the first word he send out when not getting a ACK from the Slave IC.
Not applicable
May 16, 2013
05:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 16, 2013
05:10 AM
Hello,
I am currently trying to implement a I2C master but the error handling of NAK is the problem. According to the manual data transmission is stopped. But I would like to use the FIFO. But how do I the error handling? The best thing was if I could write to the FIFO and then check with a flag whether it succeed or not.
Kind regards,
Christian
I am currently trying to implement a I2C master but the error handling of NAK is the problem. According to the manual data transmission is stopped. But I would like to use the FIFO. But how do I the error handling? The best thing was if I could write to the FIFO and then check with a flag whether it succeed or not.
Kind regards,
Christian