<svg width="1200" height="800" viewBox="0 0 1200 800" xmlns="http://www.w3.org/2000/svg">
  <!-- Background -->
  <rect width="1200" height="800" fill="#f8f9fa" stroke="none"/>
  
  <!-- Title -->
  <text x="600" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="20" font-weight="bold" fill="#2c3e50">
    STM32C011F6P Bus-Interface mit galvanischer Trennung
  </text>
  
  <!-- Separation line -->
  <line x1="600" y1="60" x2="600" y2="750" stroke="#e74c3c" stroke-width="3" stroke-dasharray="10,5"/>
  <text x="610" y="80" font-family="Arial, sans-serif" font-size="14" fill="#e74c3c">Galvanische Trennung</text>
  
  <!-- Bus Side (Left) -->
  <text x="300" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#2980b9">
    Bus-Seite (12V)
  </text>
  
  <!-- Bus connections -->
  <text x="50" y="120" font-family="Arial, sans-serif" font-size="12" fill="#2c3e50">Bus +12V</text>
  <line x1="110" y1="115" x2="200" y2="115" stroke="#d35400" stroke-width="2"/>
  
  <text x="50" y="160" font-family="Arial, sans-serif" font-size="12" fill="#2c3e50">Bus Data</text>
  <line x1="110" y1="155" x2="200" y2="155" stroke="#27ae60" stroke-width="2"/>
  
  <text x="50" y="200" font-family="Arial, sans-serif" font-size="12" fill="#2c3e50">Bus GND</text>
  <line x1="110" y1="195" x2="200" y2="195" stroke="#34495e" stroke-width="2"/>
  
  <!-- RX Path - Bus to STM32 -->
  <g id="rx-path">
    <!-- Pull-up resistor -->
    <rect x="200" y="135" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
    <text x="230" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">10kΩ</text>
    <line x1="200" y1="115" x2="200" y2="145" stroke="#d35400" stroke-width="2"/>
    <line x1="200" y1="145" x2="200" y2="155" stroke="#d35400" stroke-width="2"/>
    <line x1="260" y1="145" x2="280" y2="145" stroke="#d35400" stroke-width="2"/>
    <line x1="280" y1="145" x2="280" y2="155" stroke="#27ae60" stroke-width="2"/>
    
    <!-- Current limiting resistor -->
    <rect x="280" y="175" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
    <text x="310" y="188" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">10kΩ</text>
    <line x1="280" y1="155" x2="280" y2="175" stroke="#27ae60" stroke-width="2"/>
    <line x1="280" y1="195" x2="280" y2="220" stroke="#27ae60" stroke-width="2"/>
    <line x1="340" y1="185" x2="360" y2="185" stroke="#27ae60" stroke-width="2"/>
    
    <!-- PC817 RX Optocoupler -->
    <rect x="360" y="160" width="80" height="50" fill="#ecf0f1" stroke="#2c3e50" stroke-width="2"/>
    <text x="400" y="175" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">PC817</text>
    <text x="400" y="188" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">RX</text>
    
    <!-- LED side -->
    <circle cx="375" cy="185" r="3" fill="#e74c3c"/>
    <line x1="360" y1="185" x2="372" y2="185" stroke="#27ae60" stroke-width="2"/>
    <line x1="378" y1="185" x2="390" y2="185" stroke="#27ae60" stroke-width="2"/>
    <line x1="390" y1="185" x2="390" y2="220" stroke="#27ae60" stroke-width="2"/>
    <line x1="280" y1="220" x2="390" y2="220" stroke="#27ae60" stroke-width="2"/>
    <line x1="200" y1="195" x2="390" y2="195" stroke="#34495e" stroke-width="2"/>
    <line x1="390" y1="195" x2="390" y2="220" stroke="#34495e" stroke-width="2"/>
    
    <!-- Phototransistor side -->
    <circle cx="425" cy="185" r="3" fill="#3498db"/>
    <line x1="440" y1="185" x2="480" y2="185" stroke="#8e44ad" stroke-width="2"/>
  </g>
  
  <!-- TX Path - STM32 to Bus -->
  <g id="tx-path">
    <!-- PC817 TX Optocoupler -->
    <rect x="360" y="280" width="80" height="50" fill="#ecf0f1" stroke="#2c3e50" stroke-width="2"/>
    <text x="400" y="295" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">PC817</text>
    <text x="400" y="308" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">TX</text>
    
    <!-- Phototransistor side (left) -->
    <circle cx="375" cy="305" r="3" fill="#3498db"/>
    <line x1="375" y1="290" x2="375" y2="302" stroke="#8e44ad" stroke-width="2"/>
    <line x1="375" y1="308" x2="375" y2="340" stroke="#8e44ad" stroke-width="2"/>
    <line x1="360" y1="290" x2="375" y2="290" stroke="#8e44ad" stroke-width="2"/>
    
    <!-- BC847 Transistor -->
    <circle cx="320" cy="370" r="20" fill="#ecf0f1" stroke="#2c3e50" stroke-width="2"/>
    <text x="320" y="375" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">BC847</text>
    
    <!-- Base connection -->
    <rect x="280" y="360" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
    <text x="310" y="373" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">10kΩ</text>
    <line x1="300" y1="370" x2="280" y2="370" stroke="#8e44ad" stroke-width="2"/>
    <line x1="280" y1="370" x2="280" y2="400" stroke="#8e44ad" stroke-width="2"/>
    <line x1="200" y1="400" x2="280" y2="400" stroke="#34495e" stroke-width="2"/>
    <line x1="340" y1="370" x2="375" y2="370" stroke="#8e44ad" stroke-width="2"/>
    <line x1="375" y1="340" x2="375" y2="370" stroke="#8e44ad" stroke-width="2"/>
    
    <!-- Collector to Bus Data -->
    <line x1="320" y1="350" x2="320" y2="250" stroke="#27ae60" stroke-width="2"/>
    <line x1="200" y1="250" x2="320" y2="250" stroke="#27ae60" stroke-width="2"/>
    <line x1="200" y1="155" x2="200" y2="250" stroke="#27ae60" stroke-width="2"/>
    
    <!-- Emitter to GND -->
    <line x1="320" y1="390" x2="320" y2="400" stroke="#34495e" stroke-width="2"/>
    <line x1="200" y1="195" x2="200" y2="400" stroke="#34495e" stroke-width="2"/>
    <line x1="200" y1="400" x2="320" y2="400" stroke="#34495e" stroke-width="2"/>
    
    <!-- Pull-up for collector -->
    <rect x="250" y="235" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
    <text x="280" y="248" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">10kΩ</text>
    <line x1="280" y1="235" x2="280" y2="115" stroke="#d35400" stroke-width="2"/>
    <line x1="280" y1="255" x2="280" y2="250" stroke="#d35400" stroke-width="2"/>
    <line x1="280" y1="250" x2="320" y2="250" stroke="#27ae60" stroke-width="2"/>
  </g>
  
  <!-- STM32 Side (Right) -->
  <text x="900" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#8e44ad">
    STM32-Seite (3.3V)
  </text>
  
  <!-- Power Supply -->
  <text x="650" y="120" font-family="Arial, sans-serif" font-size="12" fill="#2c3e50">+3.3V</text>
  <line x1="690" y1="115" x2="780" y2="115" stroke="#e74c3c" stroke-width="2"/>
  
  <text x="650" y="160" font-family="Arial, sans-serif" font-size="12" fill="#2c3e50">GND</text>
  <line x1="680" y1="155" x2="780" y2="155" stroke="#34495e" stroke-width="2"/>
  
  <!-- STM32C011F6P Microcontroller -->
  <rect x="780" y="200" width="120" height="200" fill="#ecf0f1" stroke="#2c3e50" stroke-width="2"/>
  <text x="840" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#2c3e50">STM32C011F6P</text>
  <text x="840" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">TSSOP-20</text>
  
  <!-- Pin connections -->
  <text x="790" y="255" font-family="Arial, sans-serif" font-size="9" fill="#2c3e50">1-VDD</text>
  <line x1="780" y1="250" x2="760" y2="250" stroke="#e74c3c" stroke-width="2"/>
  <line x1="760" y1="115" x2="760" y2="250" stroke="#e74c3c" stroke-width="2"/>
  
  <text x="790" y="275" font-family="Arial, sans-serif" font-size="9" fill="#2c3e50">4-NRST</text>
  <line x1="780" y1="270" x2="740" y2="270" stroke="#16a085" stroke-width="2"/>
  
  <text x="790" y="295" font-family="Arial, sans-serif" font-size="9" fill="#2c3e50">6-VSS</text>
  <line x1="780" y1="290" x2="760" y2="290" stroke="#34495e" stroke-width="2"/>
  <line x1="760" y1="155" x2="760" y2="290" stroke="#34495e" stroke-width="2"/>
  
  <text x="790" y="340" font-family="Arial, sans-serif" font-size="9" fill="#2c3e50">11-PA9/TX</text>
  <line x1="780" y1="335" x2="720" y2="335" stroke="#f39c12" stroke-width="2"/>
  
  <text x="790" y="360" font-family="Arial, sans-serif" font-size="9" fill="#2c3e50">12-PA10/RX</text>
  <line x1="780" y1="355" x2="720" y2="355" stroke="#9b59b6" stroke-width="2"/>
  
  <!-- VDD Decoupling -->
  <rect x="720" y="240" width="20" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
  <text x="730" y="253" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#2c3e50">100nF</text>
  <line x1="740" y1="250" x2="760" y2="250" stroke="#e74c3c" stroke-width="2"/>
  <line x1="740" y1="260" x2="760" y2="260" stroke="#34495e" stroke-width="2"/>
  <line x1="760" y1="260" x2="760" y2="290" stroke="#34495e" stroke-width="2"/>
  
  <!-- Reset Circuit -->
  <rect x="680" y="260" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
  <text x="710" y="273" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">10kΩ</text>
  <line x1="680" y1="270" x2="660" y2="270" stroke="#16a085" stroke-width="2"/>
  <line x1="660" y1="115" x2="660" y2="270" stroke="#e74c3c" stroke-width="2"/>
  <line x1="740" y1="270" x2="780" y2="270" stroke="#16a085" stroke-width="2"/>
  
  <rect x="620" y="280" width="20" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
  <text x="630" y="293" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#2c3e50">100nF</text>
  <line x1="640" y1="270" x2="660" y2="270" stroke="#16a085" stroke-width="2"/>
  <line x1="640" y1="300" x2="660" y2="300" stroke="#34495e" stroke-width="2"/>
  <line x1="660" y1="155" x2="660" y2="300" stroke="#34495e" stroke-width="2"/>
  
  <!-- Reset Button -->
  <circle cx="620" cy="320" r="10" fill="white" stroke="#2c3e50" stroke-width="2"/>
  <text x="635" y="325" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">RST</text>
  <line x1="630" y1="320" x2="650" y2="320" stroke="#34495e" stroke-width="2"/>
  <line x1="650" y1="300" x2="650" y2="320" stroke="#34495e" stroke-width="2"/>
  <line x1="610" y1="320" x2="600" y2="320" stroke="#16a085" stroke-width="2"/>
  <line x1="600" y1="270" x2="600" y2="320" stroke="#16a085" stroke-width="2"/>
  <line x1="600" y1="270" x2="640" y2="270" stroke="#16a085" stroke-width="2"/>
  
  <!-- RX Connection -->
  <rect x="670" y="345" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
  <text x="700" y="358" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">3.3kΩ</text>
  <line x1="670" y1="355" x2="640" y2="355" stroke="#9b59b6" stroke-width="2"/>
  <line x1="640" y1="115" x2="640" y2="355" stroke="#e74c3c" stroke-width="2"/>
  <line x1="730" y1="355" x2="780" y2="355" stroke="#9b59b6" stroke-width="2"/>
  
  <!-- Connection across isolation -->
  <line x1="480" y1="185" x2="520" y2="185" stroke="#8e44ad" stroke-width="2" stroke-dasharray="5,5"/>
  <line x1="520" y1="185" x2="520" y2="355" stroke="#8e44ad" stroke-width="2"/>
  <line x1="520" y1="355" x2="640" y2="355" stroke="#9b59b6" stroke-width="2"/>
  
  <!-- TX Connection -->
  <rect x="620" y="325" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
  <text x="650" y="338" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">1kΩ</text>
  <line x1="620" y1="335" x2="580" y2="335" stroke="#f39c12" stroke-width="2"/>
  <line x1="680" y1="335" x2="720" y2="335" stroke="#f39c12" stroke-width="2"/>
  
  <!-- TX LED side of PC817 -->
  <circle cx="425" cy="305" r="3" fill="#e74c3c"/>
  <line x1="440" y1="305" x2="500" y2="305" stroke="#8e44ad" stroke-width="2" stroke-dasharray="5,5"/>
  <line x1="500" y1="305" x2="500" y2="335" stroke="#8e44ad" stroke-width="2"/>
  <line x1="500" y1="335" x2="580" y2="335" stroke="#f39c12" stroke-width="2"/>
  
  <!-- TX LED resistor -->
  <rect x="540" y="415" width="60" height="20" fill="white" stroke="#2c3e50" stroke-width="1"/>
  <text x="570" y="428" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2c3e50">3.3kΩ</text>
  <line x1="425" y1="308" x2="425" y2="425" stroke="#8e44ad" stroke-width="2" stroke-dasharray="5,5"/>
  <line x1="425" y1="425" x2="540" y2="425" stroke="#8e44ad" stroke-width="2"/>
  <line x1="600" y1="425" x2="620" y2="425" stroke="#e74c3c" stroke-width="2"/>
  <line x1="620" y1="115" x2="620" y2="425" stroke="#e74c3c" stroke-width="2"/>
  
  <!-- Labels -->
  <text x="50" y="480" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#2c3e50">Bauteile:</text>
  <text x="50" y="500" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">• 2x PC817 Optokoppler</text>
  <text x="50" y="520" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">• 1x BC847 NPN Transistor</text>
  <text x="50" y="540" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">• 1x STM32C011F6P Mikrocontroller</text>
  <text x="50" y="560" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">• Widerstände: 2x10kΩ, 1x3.3kΩ, 2x1kΩ</text>
  <text x="50" y="580" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">• 2x 100nF Kondensatoren</text>
  
  <!-- Signal flow arrows -->
  <defs>
    <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
      <polygon points="0 0, 10 3.5, 0 7" fill="#2980b9"/>
    </marker>
  </defs>
  
  <line x1="450" y1="170" x2="530" y2="170" stroke="#2980b9" stroke-width="2" marker-end="url(#arrowhead)"/>
  <text x="490" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2980b9">RX</text>
  
  <line x1="530" y1="320" x2="450" y2="320" stroke="#2980b9" stroke-width="2" marker-end="url(#arrowhead)"/>
  <text x="490" y="315" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#2980b9">TX</text>
  
  <!-- Legend -->
  <text x="50" y="620" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#2c3e50">Farblegende:</text>
  <line x1="50" y1="640" x2="80" y2="640" stroke="#d35400" stroke-width="3"/>
  <text x="90" y="645" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">+12V / +3.3V</text>
  <line x1="50" y1="655" x2="80" y2="655" stroke="#34495e" stroke-width="3"/>
  <text x="90" y="660" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">GND</text>
  <line x1="200" y1="640" x2="230" y2="640" stroke="#27ae60" stroke-width="3"/>
  <text x="240" y="645" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">Bus Data</text>
  <line x1="200" y1="655" x2="230" y2="655" stroke="#8e44ad" stroke-width="3"/>
  <text x="240" y="660" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">Optokoppler</text>
  <line x1="350" y1="640" x2="380" y2="640" stroke="#f39c12" stroke-width="3"/>
  <text x="390" y="645" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">UART TX</text>
  <line x1="350" y1="655" x2="380" y2="655" stroke="#9b59b6" stroke-width="3"/>
  <text x="390" y="660" font-family="Arial, sans-serif" font-size="11" fill="#2c3e50">UART RX</text>
</svg>