{"id":319,"date":"2017-11-23T21:02:31","date_gmt":"2017-11-23T20:02:31","guid":{"rendered":"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=319"},"modified":"2017-12-30T19:30:45","modified_gmt":"2017-12-30T18:30:45","slug":"18-i2c_slave-library-stm32f429","status":"publish","type":"page","link":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=319","title":{"rendered":"18-I2C_Slave-Library (STM32F429)"},"content":{"rendered":"<p><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-previous\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=317\" title=\"17-SPI_HD-TM1638-Library (STM32F429)\"><span class=\"meta-nav\">\u2190<\/span> 17-SPI_HD-TM1638-Library (STM32F429)<\/a><\/div><\/div><!-- #nav-below --><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-next\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=321\" title=\"19-LCD_Graphic-Library (STM32F429)\">19-LCD_Graphic-Library (STM32F429) <span class=\"meta-nav\">&rarr;<\/span><\/a><\/div><\/div><!-- #nav-below --><\/p>\n<p>Mit dieser Library kann der STM32F429 als I2C-Slave eingesetzt werden.<\/p>\n<p>Der Slave simuliert ein 256-Byte gro\u00dfes I2C-RAM. Die I2C-Funktionen laufen per Interrupt ab. Es gibt zwei Funktionen f\u00fcr read\/write vom internen RAM.<\/p>\n<p>Ein I2C-Master kann per I2C-Write ein Byte in das interne RAM vom Slave speichern und per I2C-Read ein Byte aus dem RAM vom Slave auslesen.<\/p>\n<p>Im Beispiel wartet der Slave solange, bis ein Master per I2C in die RAM-Adresse 0\u00d700 den Wert 0\u00d712 geschrieben hat, dann wird die gr\u00fcne LED eingeschaltet.<\/p>\n<p>die I2C-Pins die benutzt werden sollen, m\u00fcssen im C-File eingetragen werden<br \/>\n(im H-File kann die I2C-Clock-Frq und die Gr\u00f6\u00dfe vom RAM eingestellt werden)<\/p>\n<p>auf der Hardware d\u00fcrfen die zwei externen Pull-Up Widerst\u00e4nde (je 4k7) an SCL und SDA nicht vergessen werden, sonst funktioniert das ganze nicht.<\/p>\n<p>es gibt 3 identische Librarys, getrennt f\u00fcr I2C1, I2C2 und I2C3<\/p>\n<p>im Beispiel wurde I2C3 benutzt mit dieser Pinbelegung :<\/p>\n<pre lang=\"c\" line=\"1\">SCL an PA8\r\nSDA an PC9<\/pre>\n<p><strong><strong>Funktionen (f\u00fcr I2C1) :<\/strong><\/strong><\/p>\n<pre lang=\"c\" line=\"1\">void UB_I2C1_Slave_Init(uint8_t slave_adr);              \/\/ zum init als I2C-Slave\r\nuint8_t UB_I2C1_Slave_ReadByte(uint8_t adr);             \/\/ zum lesen vom RAM\r\nvoid UB_I2C1_Slave_WriteByte(uint8_t adr, uint8_t wert); \/\/ zum schreiben in das RAM<\/pre>\n<p><strong>Beispiel :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">\/\/--------------------------------------------------------------\r\n\/\/ File     : main.c\r\n\/\/ Datum    : 05.11.2013\r\n\/\/ Version  : 1.0\r\n\/\/ Autor    : UB\r\n\/\/ EMail    : mc-4u(@)t-online.de\r\n\/\/ Web      : www.mikrocontroller-4u.de\r\n\/\/ CPU      : STM32F429\r\n\/\/ IDE      : CooCox CoIDE 1.7.4\r\n\/\/ GCC      : 4.7 2012q4\r\n\/\/ Module   : CMSIS_BOOT, M4_CMSIS_CORE\r\n\/\/ Funktion : Demo der I2C-Slave-Library\r\n\/\/ Hinweis  : Diese zwei Files muessen auf 8MHz stehen\r\n\/\/              \"cmsis_boot\/stm32f4xx.h\"\r\n\/\/              \"cmsis_boot\/system_stm32f4xx.c\"\r\n\/\/ In Configuration diese Define hinzuf\u00fcgen :\r\n\/\/ \"STM32F429_439xx\" , \"__ASSEMBLY__\" , \"USE_STDPERIPH_DRIVER\"\r\n\/\/--------------------------------------------------------------\r\n\r\n#include \"main.h\"\r\n#include \"stm32_ub_led.h\"\r\n#include \"stm32_ub_i2c3_slave.h\"\r\n\r\nint main(void)\r\n{\r\n  uint8_t wert;\r\n\r\n  SystemInit(); \/\/ Quarz Einstellungen aktivieren\r\n\r\n  \/\/ Init der LEDs\r\n  UB_Led_Init();\r\n\r\n  \/\/ Init vom I2C-3 als Slave mit Adresse 0x70\r\n  UB_I2C3_Slave_Init(0x70);\r\n\r\n  while(1)\r\n  {\r\n    \/\/ Wert vom RAM an Adresse 0x00 auslesen\r\n    wert=UB_I2C3_Slave_ReadByte(0x00);\r\n    \/\/ LEDs je nach Inhalt schalten\r\n    if(wert==0x12) {\r\n      UB_Led_On(LED_GREEN);\r\n      UB_Led_Off(LED_RED);\r\n    }\r\n    else {\r\n      UB_Led_On(LED_RED);\r\n      UB_Led_Off(LED_GREEN);\r\n    }\r\n  }\r\n}\r\n\r\n<\/pre>\n<p>Hier die Library zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"wp-content\/uploads\/2013\/11\/i2c_slave_f429_v100.zip\">i2c_slave_f429_v100<\/a><\/p>\n<p>Hier der komplette CooCox-Projektordner zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"wp-content\/uploads\/2013\/11\/Demo_F429_18.zip\">Demo_F429_18<\/a><\/p>\n<hr \/>\n<h3 id=\"comments-title\">16 Antworten auf <em>18-I2C_Slave-Library (STM32F429)<\/em><\/h3>\n<ol class=\"commentlist\">\n<li id=\"li-comment-1404\" class=\"comment even thread-even depth-1\">\n<div id=\"comment-1404\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/b894d67379dd0647dd316009f47155d2?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Joerg<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">18. Februar 2014 um 16:33<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Auf dem Discovery Board sind die Pullups schon vorhanden!!!!! Also keine extra Pullups benutzen<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<li id=\"li-comment-1949\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div id=\"comment-1949\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/65e55f17c932839d217da69168640144?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Lohmann<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">18. Juli 2014 um 11:37<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Hallo ich habe gerade das stm32f429i-Dico mit tft lcd und 3-axsen Sensor.<br \/>\nLaut Belegung gibt es f\u00fcr I2C PB10 PB11(LCD Touch) &amp; PA8 PC9(LCD Touch) &amp; PF0 PF1(SRAM)<br \/>\nDie sind aber vom LCD Touch und SRAM belegt welchen I2C ist da<br \/>\nam gefahrenlosesten zu verwenden ?<br \/>\nVom SRAM oder vom LCD Touch ?<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-1950\" class=\"comment byuser comment-author-admin_ub bypostauthor even depth-2\">\n<div id=\"comment-1950\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">18. Juli 2014 um 13:17<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>ich w\u00fcrde I2C-3 nehmen (also PA8+PC9). Da an den I2C-BUS mehrere Slaves angeschlossen werden k\u00f6nnen, bleiben damit alle restlichen Funktionen (Touch\/SDRAM\/Display) erhalten. Einfach meine I2C3-Master Library benutzen die k\u00fcmmert sich auch gleich darum, das sie nur einmal initialisiert wird.<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-1952\" class=\"comment odd alt thread-even depth-1\">\n<div id=\"comment-1952\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/65e55f17c932839d217da69168640144?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Lohmann<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">19. Juli 2014 um 12:23<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Danke sch\u00f6n denn ich habe bis heute nur ATMegas und ATXMegas programmiert.<br \/>\nMit Bascom ist das eigentlich sehr leicht da sich alles (mit ausnahmen) wie z.B. I2C<br \/>\nsofort einbinden lassen m\u00f6chte aber nun mal wissen was es anders gibt.<br \/>\nMein erstes Projekt soll nun den BMA180 \u00fcber i2C sein. Dieser Sensor ist das<br \/>\nbeste was ich kenne der bekommt schon die kleinsten Ersch\u00fctterungen mit.<br \/>\nDer hat nur 14 Bit Aufl\u00f6sung (0.00025g\/2g) der 3-Achsen soll ja 16-Bit haben<br \/>\ndavon merke ich aber nichts.Kann ein Beschleunigungssensor mit einem Gyroskop<br \/>\nverglichen werden?<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-1953\" class=\"comment byuser comment-author-admin_ub bypostauthor even depth-2\">\n<div id=\"comment-1953\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">20. Juli 2014 um 09:51<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Ein Gyroskop (Drehratensensor) ist was anderes wie ein Beschleunigungssensor (daher gibt es auch zwei Namen) auf dem STM32F429iDisco ist ein Drehratensensor verbaut. Die Funktionsweise bei WIKI nachlesen.<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-1954\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div id=\"comment-1954\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/65e55f17c932839d217da69168640144?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Lohmann<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">20. Juli 2014 um 20:11<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Ja da ist mir klar aber was ist mit der Aufl\u00f6sung ?<br \/>\nKann ich mit dem Drehratensensor auch kleinste<br \/>\nErsch\u00fctterungen messen ?<br \/>\nz.B 0.00025g<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-1955\" class=\"comment byuser comment-author-admin_ub bypostauthor even depth-2\">\n<div id=\"comment-1955\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">20. Juli 2014 um 21:34<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>ganz klar scheint das aber noch nicht zu sein. Mit einem Drehratensensor kannst du keine \u201cg\u201d messen. Sondern nur die \u201cDrehrate\u201d also die Geschwindigkeit der Drehung in Grad pro Sekunde. Wenn du eine Beschleunigung in der Einheit \u201cg\u201d messen willst, brauchst du einen (wie der Name schon sagt) Beschleunigungs-Sensor. Egal f\u00fcr welchen Sensor du dich entscheidest, die Genauigkeit und Aufl\u00f6sung steht im Datenblatt vom jeweiligen Sensor\u2026lesen musst du selber.<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-1958\" class=\"comment odd alt thread-even depth-1\">\n<div id=\"comment-1958\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/65e55f17c932839d217da69168640144?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Lohmann<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">20. Juli 2014 um 23:08<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Danke aber nun mein eigentliches Problem:<br \/>\nHabe mit das STM32F429I-Disco zugelegt m\u00f6chte mir gerne<br \/>\ndie stm32 Programmierung aneignen.<br \/>\nHabe die Entwickelungsumgebung CooCox Coide installiert und das Funktioniert<br \/>\nalles schon auch die Beispiele funktionieren.<br \/>\nNun erstelle ich ein Projekt gehe auf -&gt;Bord w\u00e4hle -&gt; Stm32f4-discovery<br \/>\nsonst aber nichts w\u00e4hle also und Driver component nichts.<\/p>\n<p>Nun bekomme ich meine main.h die ver\u00e4ndere ich dann so:<br \/>\n#include \u201cmain.h\u201d<br \/>\n#include \u201cstm32_ub_lcd_ili9341.h\u201d<br \/>\n#include \u201cstm32_ub_font.h\u201d<br \/>\n#include \u201cstm32_ub_touch_stmpe811.h\u201d<br \/>\n#include<br \/>\nint main(void)<br \/>\n{<\/p>\n<p>while(1)<br \/>\n{<br \/>\n}<br \/>\n}<\/p>\n<p>Die ganzen files die zum Download bereit stehen wie z.B.<br \/>\nstm32_ub_lcd_ili9341.h<br \/>\nstm32_ub_font.h<br \/>\n.<br \/>\n.<br \/>\nstm32_ub_sdram.c<br \/>\nusw. kopiere ich dann auch in das Verzeichnis ub_lib.<br \/>\nDann gehe ich auf Add file und w\u00e4hle alle aus.<br \/>\nDann gehe ich auf Build(F7) und dann kommen<br \/>\nnur Fehle wie:<br \/>\n[cc] c:\\stm32f4\\vorlage_f429_168mhz_v100\\ub_lib\\<br \/>\nstm32_ub_font.h:12:23: fatal error: stm32f4xx.h: No such file or directory<\/p>\n<p>Aber warum ist doch alles da ???<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-1960\" class=\"comment byuser comment-author-admin_ub bypostauthor even depth-2\">\n<div id=\"comment-1960\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">21. Juli 2014 um 08:03<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>1. Du kannst CoIDE nicht zum anlegen f\u00fcr ein STM32F429 Projekt benutzen<br \/>\n(nimm eine leere Vorlage von mir, da sind alle Files dabei)<br \/>\n2. du brauchst nat\u00fcrlich alle \u201cStandard Peripherals\u201d von ST f\u00fcr den STM32F429. Diese werden von CoIDE nicht automatisch dazukopiert, weil der STM32F429 noch nicht unterst\u00fczt wird. Du musst also alle notwendigen Files manuell in die beiden Ordner \u201ccmsis_lib\/include\u201d und \u201ccmsis_lib\/source\u201d kopieren. Du findest die Files alle in meinen Projektfiles in den gleichen Ordnern.<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-2003\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div id=\"comment-2003\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/65e55f17c932839d217da69168640144?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Lohmann<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">3. August 2014 um 20:23<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Eine kleine Frage wof\u00fcr steht bei STM das ST ich meine auch bei der ST.com<br \/>\nwas ist mit ST gemeint?<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-2021\" class=\"comment even depth-2\">\n<div id=\"comment-2021\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/1.gravatar.com\/avatar\/b894d67379dd0647dd316009f47155d2?s=40&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Joerg B.<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">7. August 2014 um 16:41<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Die Anfangsbuchstaben aus den Firmen aus den ST entstand.<\/p>\n<p>SGS Microelettronica und Thomson<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-2968\" class=\"comment odd alt thread-even depth-1\">\n<div id=\"comment-2968\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/ae1663bac2bdd897191980cbb5016522?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\"><a class=\"url\" href=\"http:\/\/keine\/\" rel=\"external nofollow\">Michael<\/a><\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">13. M\u00e4rz 2015 um 22:58<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Alles funktioniert prima auf Anhieb. I2C Master ist ein anderer STM32. Slave klappt nun auch.<br \/>\nAllerdings bleibt nach dem Lesen von einem Block bei diesem Slave die SCL Leitung auf 0V. Ich debugge schon wie wild. Was kann das sein?<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<li id=\"li-comment-2969\" class=\"comment even thread-odd thread-alt depth-1\">\n<div id=\"comment-2969\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/ae1663bac2bdd897191980cbb5016522?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\"><a class=\"url\" href=\"http:\/\/keine\/\" rel=\"external nofollow\">Michael<\/a><\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">13. M\u00e4rz 2015 um 23:19<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>I2C3 SR1=0\u00d7180<br \/>\nI2C3 SR2=6 in dem Fall wenn SCL vom Slave auf Low gezogen wird\u2026<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-2978\" class=\"comment byuser comment-author-admin_ub bypostauthor odd alt depth-2\">\n<div id=\"comment-2978\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">14. M\u00e4rz 2015 um 12:19<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>nochmal etwas ausf\u00fchrlicher bitte :<br \/>\n1. was f\u00fcr ein IC ist der Master<br \/>\n2. was f\u00fcr ein IC ist der Slave<br \/>\n3. Welche Seite willst du programmieren (Master oder Slave)<br \/>\n4. Welche Seite funktioniert nicht (Master oder Slave)<br \/>\n5. Welche Libarys benutzt du und was l\u00e4uft sonst noch \u201cparallel\u201d<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<li id=\"li-comment-2979\" class=\"comment even thread-even depth-1\">\n<div id=\"comment-2979\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/ae1663bac2bdd897191980cbb5016522?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\"><a class=\"url\" href=\"http:\/\/keine\/\" rel=\"external nofollow\">Michael<\/a><\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">14. M\u00e4rz 2015 um 12:49<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Damit funktioniert es nun: BERR und TXE Flags m\u00fcssen gel\u00f6scht werden.<br \/>\n\/\/\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br \/>\n\/\/ ISR (Error Handler vom I2C)<br \/>\n\/\/\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2013<br \/>\nvoid I2C3_ER_IRQHandler(void)<br \/>\n{<br \/>\nif (I2C_GetITStatus(I2C3, I2C_IT_AF)) {<br \/>\nI2C_ClearITPendingBit(I2C3, I2C_IT_AF);<br \/>\n}<\/p>\n<p>\/\/mh<br \/>\nif (I2C_GetITStatus(I2C3, I2C_IT_BERR)) {<br \/>\nI2C_ClearITPendingBit(I2C3, I2C_IT_BERR);<br \/>\n}<br \/>\n\/\/mh<br \/>\nif (I2C_GetITStatus(I2C3, I2C_IT_TXE)) {<br \/>\nI2C_ClearITPendingBit(I2C3, I2C_IT_TXE);<br \/>\n}<br \/>\n}<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<li id=\"li-comment-2982\" class=\"comment odd alt thread-odd thread-alt depth-1\">\n<div id=\"comment-2982\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/ae1663bac2bdd897191980cbb5016522?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\"><a class=\"url\" href=\"http:\/\/keine\/\" rel=\"external nofollow\">Michael<\/a><\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">14. M\u00e4rz 2015 um 20:39<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>Das hast Du sch\u00f6n gekapselt: ich brauchte nur die C+H Datei und konnte den I2C Slave nun mein Projekt (STM32F100 LV Discovery mit I2C2) einbauen. Interrupt Handler sind auch gleich mit dabei. Ein paar Anpassungen wg. der Unterschiede zwischen F4xx und F10x waren noch n\u00f6tig. Dann Compliliert und Flashen \u2013 Funktionierte sofort! Gut gemacht.<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Mit dieser Library kann der STM32F429 als I2C-Slave eingesetzt werden. Der Slave simuliert ein 256-Byte gro\u00dfes I2C-RAM. Die I2C-Funktionen laufen per Interrupt ab. Es gibt zwei Funktionen f\u00fcr read\/write vom internen RAM. Ein I2C-Master kann per I2C-Write ein Byte in &hellip; <a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=319\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":160,"menu_order":18,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[129],"tags":[98,213,9,230,102],"class_list":["post-319","page","type-page","status-publish","hentry","category-stm32f429","tag-i2c","tag-i2c-slave","tag-library","tag-slave","tag-stm32f429"],"_links":{"self":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":3,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/319\/revisions"}],"predecessor-version":[{"id":1681,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/319\/revisions\/1681"}],"up":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/160"}],"wp:attachment":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}