Hello,
I'm having problems with I2C when connecting two devices to the same bus. The I2C_Write seems to always use the highest address used so far, no matter what it's given as first parameter. For example
I2C1_Write(0x38,@wert,1,END_MODE_STOP);
I2C1_Write(0x39,@wert,1,END_MODE_STOP);
I2C1_Write(0x38,@wert,1,END_MODE_STOP); // does not work, uses 0x39 as address instead
Same code runs fine on STM32F103C8.
I have attached a small example to reproduce the problem.
Any ideas?
Problem with I2C on STM32F303CC
Problem with I2C on STM32F303CC
- Attachments
-
- Div_Tests.mpas.zip
- (848 Bytes) Downloaded 80 times
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: Problem with I2C on STM32F303CC
Hello,
I apologize for the delayed answer.
Could you provide me with more details?
Can you tell me which module (chip) you are using? Are you using some of our click boards?
Kind regards,
Jovana
I apologize for the delayed answer.
Could you provide me with more details?
Can you tell me which module (chip) you are using? Are you using some of our click boards?
Kind regards,
Jovana
Re: Problem with I2C on STM32F303CC
moin KaHese,
in dem Prog
Procedure PCF_Reset;
var Help : byte;
Begin
Help := 0xff;
I2C1_Start();
I2C1_Write(0x38,@help,1,END_MODE_STOP);
end; //<-- das fehlt!
Die I2C Module von F103 und F303 sind etwas unterschiedlich.
Leider ist mein letztes Black-Pill mit F303CC von RoboDyn defekt. Neue dauern.
Hast Du die Möglicjkeit I2C zu loggen, wo es klemmt?
Mit Gruß
Peter
PS: Das Prog ist schon fast ulk, oder?
in dem Prog
Procedure PCF_Reset;
var Help : byte;
Begin
Help := 0xff;
I2C1_Start();
I2C1_Write(0x38,@help,1,END_MODE_STOP);
end; //<-- das fehlt!
Die I2C Module von F103 und F303 sind etwas unterschiedlich.
Leider ist mein letztes Black-Pill mit F303CC von RoboDyn defekt. Neue dauern.
Hast Du die Möglicjkeit I2C zu loggen, wo es klemmt?
Mit Gruß
Peter
PS: Das Prog ist schon fast ulk, oder?
Re: Problem with I2C on STM32F303CC
Dear Jovana,
I have connected two PCF 8574A modules.
Thanks and regards,
kahese
I have connected two PCF 8574A modules.
Thanks and regards,
kahese
Re: Problem with I2C on STM32F303CC
Hallo Peter,
Das mit dem end muss beim kopieren passiert sein. Habe das Programm ja compilieren können.
Das Programm ist nur zum testen des i2c Busses. Habe in einen anderen umfangreichen Programm festgestellt
Das es mit dem i2c bus Probleme gibt. Es ist folgendermaßen, es wird immer die zuletzt höchste Adresse weitere nutzt.
Habe mal ein Uhrenmodell mit A0 probiert da bleibt er immer bei so, auch wenn ich 38 benutze.
Habe alles mit einem logicanalyzer beobachtet..
Alles getestet mit dem Modul von RoboDyn. (STM32F303CC)
C
Lg Kalle
Das mit dem end muss beim kopieren passiert sein. Habe das Programm ja compilieren können.
Das Programm ist nur zum testen des i2c Busses. Habe in einen anderen umfangreichen Programm festgestellt
Das es mit dem i2c bus Probleme gibt. Es ist folgendermaßen, es wird immer die zuletzt höchste Adresse weitere nutzt.
Habe mal ein Uhrenmodell mit A0 probiert da bleibt er immer bei so, auch wenn ich 38 benutze.
Habe alles mit einem logicanalyzer beobachtet..
Alles getestet mit dem Modul von RoboDyn. (STM32F303CC)
C
Lg Kalle
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: Problem with I2C on STM32F303CC
Hi,
I've tested this on STM32F303RC which uses the same I2C library as STM32F303CC and I have not reproduced any issue.
I've used two EEPROM click boards (one at 0xA0 slave address, and the other at 0xA8) and Fusion for STM32 v8 with MCU CARD 3 for STM32 for the test.
Please find the test project in the attachment.
For further questions please write in English.
Kind regards,
I've tested this on STM32F303RC which uses the same I2C library as STM32F303CC and I have not reproduced any issue.
I've used two EEPROM click boards (one at 0xA0 slave address, and the other at 0xA8) and Fusion for STM32 v8 with MCU CARD 3 for STM32 for the test.
Please find the test project in the attachment.
For further questions please write in English.
Kind regards,
- Attachments
-
- EEPROM click.zip
- (205.06 KiB) Downloaded 90 times
Stefan Filipović
Re: Problem with I2C on STM32F303CC
Hello,
My problem has not been solved yet, I use MikroPascal and not C.
I have attached the program and a logic analyzer protocol. Since the program runs on a STM32F103C8, I am thinking of a compiler error.
Kind regards,
Kalle
My problem has not been solved yet, I use MikroPascal and not C.
I have attached the program and a logic analyzer protocol. Since the program runs on a STM32F103C8, I am thinking of a compiler error.
Kind regards,
Kalle
- Attachments
-
- Div_Tests.PDF
- (338.4 KiB) Downloaded 80 times
-
- Analyser.pdf
- (222.05 KiB) Downloaded 78 times
- stefan.filipovic
- mikroElektronika team
- Posts: 1135
- Joined: 18 Dec 2018 10:30
Re: Problem with I2C on STM32F303CC
Hi Kalle,
Could you please try with the library from the attachment?
Just extract it to the following path:
c:\Users\Public\Documents\Mikroelektronika\mikroPascal PRO for ARM\Uses\ST M4\
Please let me know whether it solved the issue.
Kind regards,
Could you please try with the library from the attachment?
Just extract it to the following path:
c:\Users\Public\Documents\Mikroelektronika\mikroPascal PRO for ARM\Uses\ST M4\
Please let me know whether it solved the issue.
Kind regards,
- Attachments
-
- __Lib_I2C_12_3XX.zip
- (9.8 KiB) Downloaded 73 times
Stefan Filipović
Re: Problem with I2C on STM32F303CC
Hi, Stefan
Problem solved. thank you
Best regards
Kalle
Problem solved. thank you
Best regards
Kalle