Not applicable
Nov 19, 2014
11:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 19, 2014
11:50 PM
Hi,
iam new in Component Based Programming and have some problems with USIC communication.
Problem:
I scale my SDA (0.5) SCL (0.11) Pins with a Osci but i dont get a Signal ?!? I will control a I2C Display.
Hardware:
XMC4500 Relax Kit
Details:
I2C001/0 (API)
Slave Adress: 0x77
Code:
| START | SLAVE ADRESS | W | A | DATA | A | DATA | A | P |
I2C001_DataType data1,data2,data3,data4,data5;
//START + SLAVE ADRESS + W
data1.Data1.TDF_Type = I2C_TDF_MStart;
data1.Data1.Data = (0x77 | I2C_WRITE);
while (!I2C001_WriteData(&I2C001_Handle0,&data1));
// A + DATA
data4.Data1.TDF_Type = I2C_TDF_MRxAck0; // <<--- ???? I2C_TDF_STxData ? (Slave to Master Ackn.. )
data4.Data1.Data = 0x21;
while (!I2C001_WriteData(&I2C001_Handle0,&data4));
//Start repeat
data3.Data1.TDF_Type = I2C_TDF_MRStart;
data3.Data1.Data = 0x77 | I2C_WRITE;
while (!I2C001_WriteData(&I2C001_Handle0,&data3));
//A + DATA
data4.Data1.TDF_Type = I2C_TDF_MRxAck0;
data4.Data1.Data = 0xA0;
while (!I2C001_WriteData(&I2C001_Handle0,&data4));
// Stop condition by the master
data5.Data1.TDF_Type = I2C_TDF_MStop;
data5.Data1.Data = 0x00;
while (!I2C001_WriteData(&I2C001_Handle0,&data5));
while(1){
}
Have somebody a simple example ?
iam new in Component Based Programming and have some problems with USIC communication.
Problem:
I scale my SDA (0.5) SCL (0.11) Pins with a Osci but i dont get a Signal ?!? I will control a I2C Display.
Hardware:
XMC4500 Relax Kit
Details:
I2C001/0 (API)
Slave Adress: 0x77
Code:
| START | SLAVE ADRESS | W | A | DATA | A | DATA | A | P |
I2C001_DataType data1,data2,data3,data4,data5;
//START + SLAVE ADRESS + W
data1.Data1.TDF_Type = I2C_TDF_MStart;
data1.Data1.Data = (0x77 | I2C_WRITE);
while (!I2C001_WriteData(&I2C001_Handle0,&data1));
// A + DATA
data4.Data1.TDF_Type = I2C_TDF_MRxAck0; // <<--- ???? I2C_TDF_STxData ? (Slave to Master Ackn.. )
data4.Data1.Data = 0x21;
while (!I2C001_WriteData(&I2C001_Handle0,&data4));
//Start repeat
data3.Data1.TDF_Type = I2C_TDF_MRStart;
data3.Data1.Data = 0x77 | I2C_WRITE;
while (!I2C001_WriteData(&I2C001_Handle0,&data3));
//A + DATA
data4.Data1.TDF_Type = I2C_TDF_MRxAck0;
data4.Data1.Data = 0xA0;
while (!I2C001_WriteData(&I2C001_Handle0,&data4));
// Stop condition by the master
data5.Data1.TDF_Type = I2C_TDF_MStop;
data5.Data1.Data = 0x00;
while (!I2C001_WriteData(&I2C001_Handle0,&data5));
while(1){
}
Have somebody a simple example ?
- Tags:
- IFX
21 Replies
Not applicable
Nov 20, 2014
01:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 20, 2014
01:17 AM
now i get the Start Condition...but my Clock signal ist High no change
Not applicable
Nov 20, 2014
04:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 20, 2014
04:27 AM
int main(void)
{
//uint16_t IICSlave_addr = I2C003_Handle0.SlaveAddress >> 9;
DAVE_Init(); // Initialization of DAVE Apps
//START + SLAVE ADRESS + W
data1.Data1.TDF_Type = I2C_TDF_MStart;
data1.Data1.Data = (0x77 | I2C_WRITE);
while (!I2C001_WriteData(&I2C001_Handle0,&data1));
// A + DATA
data2.Data1.TDF_Type = I2C_TDF_MTxData ;
data2.Data1.Data = 0x21;
while (!I2C001_WriteData(&I2C001_Handle0,&data2));
// A + DATA
data3.Data1.TDF_Type = I2C_TDF_MTxData ;
data3.Data1.Data = 0xA0;
while (!I2C001_WriteData(&I2C001_Handle0,&data3));
// Stop condition by the master
data4.Data1.TDF_Type = I2C_TDF_MStop;
data4.Data1.Data = ubyteFF;
while (!I2C001_WriteData(&I2C001_Handle0,&data4));
{
//uint16_t IICSlave_addr = I2C003_Handle0.SlaveAddress >> 9;
DAVE_Init(); // Initialization of DAVE Apps
//START + SLAVE ADRESS + W
data1.Data1.TDF_Type = I2C_TDF_MStart;
data1.Data1.Data = (0x77 | I2C_WRITE);
while (!I2C001_WriteData(&I2C001_Handle0,&data1));
// A + DATA
data2.Data1.TDF_Type = I2C_TDF_MTxData ;
data2.Data1.Data = 0x21;
while (!I2C001_WriteData(&I2C001_Handle0,&data2));
// A + DATA
data3.Data1.TDF_Type = I2C_TDF_MTxData ;
data3.Data1.Data = 0xA0;
while (!I2C001_WriteData(&I2C001_Handle0,&data3));
// Stop condition by the master
data4.Data1.TDF_Type = I2C_TDF_MStop;
data4.Data1.Data = ubyteFF;
while (!I2C001_WriteData(&I2C001_Handle0,&data4));
Not applicable
Nov 21, 2014
03:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 21, 2014
03:58 AM
Hi,
I use a simple project to test my Pin's on my xmc Relax Board but i don't get Clock Signal. I use the pins P0.5 P0.11.
somebody have the same problem ?
I use a simple project to test my Pin's on my xmc Relax Board but i don't get Clock Signal. I use the pins P0.5 P0.11.
somebody have the same problem ?
Not applicable
Nov 23, 2014
06:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 23, 2014
06:09 PM
Hi,
Did you provide the pull-up resistor?
External pull up resistor is required for I2C protocol.
Is this the same question related to this thread - "I2C (IIc USIC Communication with Relax Kit) Problem "
If yes, I shall merge these two thread together.
Did you provide the pull-up resistor?
External pull up resistor is required for I2C protocol.
Is this the same question related to this thread - "I2C (IIc USIC Communication with Relax Kit) Problem "
If yes, I shall merge these two thread together.
Not applicable
Nov 24, 2014
07:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 24, 2014
07:53 AM
Yes its nearly same Thread.
I use only Master no Slave's, this means I can use I2C without Pull up.
tanks...
I use only Master no Slave's, this means I can use I2C without Pull up.
tanks...
Not applicable
Nov 24, 2014
11:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 24, 2014
11:50 PM
I use only I2C001 App with default configurations,
My Code:
// Configure message data length
I2C001_Type data1,data2,data3,data4,data5,data6;
int main(void)
{
DAVE_Init();
// Configure message data length
I2C001_Type data1,data2,data3,data4;
// Write access IO expander device PCA9502
// Transmission by the master with start condition,
// I2C write condition and slave address
data1.TDF_Type = I2C_TDF_MStart;
data1.Data = (0x77 | I2C_WRITE); //Slave Adress
I2C001_WriteData(&I2C001_Handle0,&data1);
// Write to the direction register
data2.TDF_Type = I2C_TDF_MTxData;
data2.Data = 0x21; //Osc. ON
I2C001_WriteData(&I2C001_Handle0,&data2);
// Write data to configure one bit as output
data3.TDF_Type = I2C_TDF_MTxData;
data3.Data = 0xA0; //ROW
I2C001_WriteData(&I2C001_Handle0,&data3);
// Write data to configure one bit as output
data4.TDF_Type = I2C_TDF_MTxData;
data4.Data = 0x81; //Display ON
I2C001_WriteData(&I2C001_Handle0,&data4);
// Stop condition by the master
data4.TDF_Type = I2C_TDF_MStop;
data4.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data4);
while(1)
{}
return 0;
}
My Code:
// Configure message data length
I2C001_Type data1,data2,data3,data4,data5,data6;
int main(void)
{
DAVE_Init();
// Configure message data length
I2C001_Type data1,data2,data3,data4;
// Write access IO expander device PCA9502
// Transmission by the master with start condition,
// I2C write condition and slave address
data1.TDF_Type = I2C_TDF_MStart;
data1.Data = (0x77 | I2C_WRITE); //Slave Adress
I2C001_WriteData(&I2C001_Handle0,&data1);
// Write to the direction register
data2.TDF_Type = I2C_TDF_MTxData;
data2.Data = 0x21; //Osc. ON
I2C001_WriteData(&I2C001_Handle0,&data2);
// Write data to configure one bit as output
data3.TDF_Type = I2C_TDF_MTxData;
data3.Data = 0xA0; //ROW
I2C001_WriteData(&I2C001_Handle0,&data3);
// Write data to configure one bit as output
data4.TDF_Type = I2C_TDF_MTxData;
data4.Data = 0x81; //Display ON
I2C001_WriteData(&I2C001_Handle0,&data4);
// Stop condition by the master
data4.TDF_Type = I2C_TDF_MStop;
data4.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data4);
while(1)
{}
return 0;
}
Not applicable
Nov 25, 2014
01:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 25, 2014
01:40 AM
Hi,
I don't think you will see the clock signal if no external pull up resistor is connected.
I don't think you will see the clock signal if no external pull up resistor is connected.
Not applicable
Nov 25, 2014
01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 25, 2014
01:51 AM
I use external Pull ups 4,7K
Not applicable
Nov 25, 2014
02:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 25, 2014
02:20 AM
The Picture shows my circuit structure...
This one is false(Attached).
Not applicable
Dec 01, 2014
12:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 01, 2014
12:16 AM
i also set the pins as Ouput and Open Drain
P0_11_set_mode(OUTPUT_OD_GP);
P0_11_set_driver_strength(STRONG);
P0_5_set_mode(OUTPUT_OD_GP);
P0_5_set_driver_strength(STRONG);
P0_11_set_mode(OUTPUT_OD_GP);
P0_11_set_driver_strength(STRONG);
P0_5_set_mode(OUTPUT_OD_GP);
P0_5_set_driver_strength(STRONG);
Not applicable
Dec 01, 2014
01:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 01, 2014
01:37 AM
Hi,
I also having problem using that 2 pins (P0.11 and P0.5) on my test. I will investigate further.
Meanwhile, do you mind run your test on P0.8 (SCL) and P1.5 (SDA)?
When I use P0.8 and P1.5 on my Relax kit, it works fine for me.
I also having problem using that 2 pins (P0.11 and P0.5) on my test. I will investigate further.
Meanwhile, do you mind run your test on P0.8 (SCL) and P1.5 (SDA)?
When I use P0.8 and P1.5 on my Relax kit, it works fine for me.
Not applicable
Dec 01, 2014
03:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 01, 2014
03:08 AM
Do you show me your code example, pleace ?
Not applicable
Dec 01, 2014
05:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 01, 2014
05:49 PM
Hi,
I'm using the I2C001_Example1 from the DAVE example project and changes the pins configuration.
I connect the Relax Kit with the I2C slave on the COM_ETH-V1 board.
Of course, with 4.7K external pull up added.
I'm using the I2C001_Example1 from the DAVE example project and changes the pins configuration.
I connect the Relax Kit with the I2C slave on the COM_ETH-V1 board.
Of course, with 4.7K external pull up added.
Not applicable
Dec 02, 2014
01:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 02, 2014
01:14 AM
okey Thank you ....
🙂
🙂
Not applicable
Dec 03, 2014
07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 03, 2014
07:42 AM
How can i clear my TxFIFO Buffer ?
my code holding in this code line...
if(USIC_IsTxFIFOfull(I2CRegs))
{
Result = (bool)FALSE;
}
my code holding in this code line...
if(USIC_IsTxFIFOfull(I2CRegs))
{
Result = (bool)FALSE;
}
Not applicable
Dec 03, 2014
06:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 03, 2014
06:00 PM
Hi,
In this line of code, it show that your FIFO buffer is full.
So I believe that the data you write into the TxFIFO did not transmit out, that is why it caused the TxFIFO to be full.
Instead of looking at how to clear the buffer, perhaps you need to find out why the data did not transfer out?
In this line of code, it show that your FIFO buffer is full.
So I believe that the data you write into the TxFIFO did not transmit out, that is why it caused the TxFIFO to be full.
Instead of looking at how to clear the buffer, perhaps you need to find out why the data did not transfer out?
Not applicable
Dec 03, 2014
10:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 03, 2014
10:55 PM
Hi,
Finally I managed to get it working on pin P0.5 and P0.11.
Is not due to software or the device but the hardware connection.
I just re-solder the connection pin for P0.5, P0.11 and GND.
Then I connected it again to the slave on the COM board and now it is working.
Finally I managed to get it working on pin P0.5 and P0.11.
Is not due to software or the device but the hardware connection.
I just re-solder the connection pin for P0.5, P0.11 and GND.
Then I connected it again to the slave on the COM board and now it is working.
Not applicable
Dec 04, 2014
12:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 04, 2014
12:28 AM
Okey Thanks Jackson, do you know how can i Reset the FIFO buffer...
normally i read out the Buffer in this line is that correct?
(in FIFO_Receive_Int_Handler)
I2C001_ReadData(&I2C001_Handle0,&DataReceived);
normally i read out the Buffer in this line is that correct?
(in FIFO_Receive_Int_Handler)
I2C001_ReadData(&I2C001_Handle0,&DataReceived);
Not applicable
Dec 04, 2014
01:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 04, 2014
01:39 AM
Yes, that is the correct code to read from RxFIFO.
May I know what do you mean by reset the FIFO?
May I know what do you mean by reset the FIFO?
Not applicable
Dec 04, 2014
01:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 04, 2014
01:54 AM
ok.
I mean with Reset i will clear my Buffer.
I mean with Reset i will clear my Buffer.
Not applicable
Dec 07, 2014
06:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2014
06:18 PM
Hi,
You can clear the FIFO buffer by the register TRBSCR.FLUSHRB for receive fifo and TRBSCR.FLUSHTB for transmit fifo.
You can clear the FIFO buffer by the register TRBSCR.FLUSHRB for receive fifo and TRBSCR.FLUSHTB for transmit fifo.