module:microcontroller:stm32f103pcf8574portwrite:stm32f103pcf8574portwrite
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| module:microcontroller:stm32f103pcf8574portwrite:stm32f103pcf8574portwrite [2022/11/19 14:12] – [211119] omdevelop | module:microcontroller:stm32f103pcf8574portwrite:stm32f103pcf8574portwrite [2022/11/19 15:46] (current) – [Abstract] omdevelop | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== STM32F103PCF8574PortWrite ====== | ====== STM32F103PCF8574PortWrite ====== | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | |||
| ===== Abstract ===== | ===== Abstract ===== | ||
| + | * Ansteuerung des PCF8574 mit STM32F103C8T6 über I2C-Bus (Pullups 1k) | ||
| + | * beide I2C-Busse des STM32F103C8T6 mit gleicher Software benutzbar | ||
| + |   * benutzte Arduino-PCF8574-I2C-Library (hier benutzt: Version 0.3.7):  | ||
| + |   * [[https:// | ||
| + | * funktioniert mit I2C-Bus-Versorgung 3V3 und 5V0 | ||
| ===== ToDo ===== | ===== ToDo ===== | ||
| ===== Done ===== | ===== Done ===== | ||
| ==== 211119 ==== | ==== 211119 ==== | ||
| + | * Ansteuerung des PCF8574 über zwei beim STM32F103 vorhandene getrennte I2C-Busse | ||
|   * Download : {{: |   * Download : {{: | ||
| + | |||
| + | < | ||
| + | #include < | ||
| + | #include " | ||
| + | // | ||
| + | const int PIN_LEDSYSTEM = PC13; | ||
| + | const int I2C1_SDA = PB7; | ||
| + | const int I2C1_SCL = PB6; | ||
| + | const int I2C2_SDA = PB11; | ||
| + | const int I2C2_SCL = PB10; | ||
| + | // | ||
| + | TwoWire I2CA(I2C1_SDA, | ||
| + | TwoWire I2CB(I2C2_SDA, | ||
| + | // | ||
| + | // OK PCF8574 PCF8574Device(0x38, | ||
| + | // OK | ||
| + | PCF8574 PCF8574Device(0x38, | ||
| + | // | ||
| + | void setup() | ||
| + | { | ||
| + |   pinMode(PIN_LEDSYSTEM, | ||
| + |   digitalWrite(PIN_LEDSYSTEM, | ||
| + | // | ||
| + |   PCF8574Device.begin(); | ||
| + | delay(100); | ||
| + | } | ||
| + | // | ||
| + | void loop() | ||
| + | { | ||
| + |   PCF8574Device.write8(0xFF); | ||
| + |   digitalWrite(PIN_LEDSYSTEM, | ||
| + |   delayMicroseconds(100000); | ||
| + |   PCF8574Device.write8(0x00); | ||
| + |   digitalWrite(PIN_LEDSYSTEM, | ||
| + |   delayMicroseconds(1); | ||
| + | } | ||
| + | </ | ||
| + | {{: | ||
| + | \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ | ||
| + | |||
| ==== 211119 ==== | ==== 211119 ==== | ||
| + | * Ansteuerung des PCF8574 mit STM32F103C8T6 | ||
|   * Download : {{: |   * Download : {{: | ||
| + | * verwendete Library (zwei Dateien: PCF8574.cpp und PCF8574.h) | ||
| + | {{: | ||
| + | \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ | ||
| + | -------------- | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
module/microcontroller/stm32f103pcf8574portwrite/stm32f103pcf8574portwrite.1668863575.txt.gz · Last modified: 2022/11/19 14:12 by omdevelop