Inbetriebnahme der Pixy 2.1 mit Simulink: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Zeile 190: Zeile 190:
Error:
Error:
   Pixy2 vision sensor supports bit order of 'MSB first' and SPI mode 3. Change the values in the 'SPI properties' of the Hardware board settings and retry.
   Pixy2 vision sensor supports bit order of 'MSB first' and SPI mode 3. Change the values in the 'SPI properties' of the Hardware board settings and retry.
Lösung siehe Abb.
Lösung siehe Abb. 9
 
Folgende Einstellungen wurden getroffen
* PixyMon siehe Abb. 10


= Dokumentation =
= Dokumentation =

Version vom 2. Dezember 2025, 12:12 Uhr

Abb. 1: Kamerasystem Pixy 2.1
Autor: Prof. Dr.-Ing. Schneider

Software Vorbereitung

Installieren Sie folgende Software

  • Simulink Coder
  • Simulink Support Package for Arduino Hardware
  • PixyMon v2 3.0.24

Hardware Verbindung mit Originalkabel (ISCP)

Originalartikel: Hooking up Pixy to a Microcontroller

Abb. 2: Verbindung Pixy 2.1 mit Flachbandkabel mit Arduino ICSP
Abb. 3: Verbindung Pixy 2.1 mit Flachbandkabel mit 10 poligem Stecker
Abb. 4: ICSP des Arduino R3

Steckerbelegung an der Pixy 2.1 (10P)

1  2
3  4
5  6
7  8
9  10 

Die Verbindung der Pixy 2 mit dem Arduino erfolgt über das mitgelieferte 6-adrige Flachbandkabel (vgl. Abb. 2 und 3).

Tabelle 1: Verbindung des 10P ICSP Anschlusses der Pixy 2 mit dem ISCP des Arduino Uno R3
Pin Pixy 2 Arduino ICSP
1 SPI MISO, UART RX, GPIO0 SPI MISO
2 5 V VCC
3 SPI SCK, DAC OUT, GPIO1 SPI SCK
4 SPI MOSI, UART TX, GPIO2 SPI MOSI
5 I2C SCL Reset
6 GND GND
7 SPI SS, ADC IN, GPIO3
8 GND
9 I2C SDA
10 GND

Problem: SPI SS (10P) ist mit Pin 5 des Arduino ICSP nicht verbunden.

Tabelle 2: ICSP Anschluss des Arduino Uno R3 (vgl. Abb. 4)
Pin Arduino ICSP
1 SPI MISO
2 VCC
3 SPI SCK
4 SPI MOSI
5 Reset
6 GND

I2C Verbindung

Abb. 5: Arduino Uno R3 Pinout
Abb. 6: Einfaches Simulink Modell
Abb. 7: Einstellungen des Simulink Pixy2-Blocks
Abb. 8: Einstellungen des PixyMon v2 v3.0.24


Tabelle 3: Handverkabelung des 10P ICSP Anschlusses der Pixy 2 mit dem Arduino Uno R3 (vgl. Abb. 5)
Pin Pixy 2 Arduino Uno R3
1 SPI MISO, UART RX, GPIO0
2 5 V VCC, 5 V
3 SPI SCK, DAC OUT, GPIO1
4 SPI MOSI, UART TX, GPIO2
5 I2C SCL SCL
6 GND
7 SPI SS, ADC IN, GPIO3
8 GND
9 I2C SDA SDA
10 GND GND

SRC

Datei:LineTrackingI2C R2025a.zip

SPI laut MathWorks

Abb. 9: Simulink Modellparameter
Abb. 10: Einstellungen des Simulink Pixy2-Blocks SPI with CS
Abb. 9: Einstellungen des PixyMon v2 v3.0.24
Abb. 9: Einstellungen des PixyMon v2 v3.0.24
Tabelle 2: SPI Verbindung Pixy2 10P mit Arduino Uno R3
Pin Pixy 2.1 10P Arduino Uno R3
1 SPI MISO 12
2 5 V VCC 5 V
3 SPI SCK 13
4 SPI MOSI 11
6 GND GND
7 SPI SS D10

Error:

 Pixy2 vision sensor supports bit order of 'MSB first' and SPI mode 3. Change the values in the 'SPI properties' of the Hardware board settings and retry.

Lösung siehe Abb. 9

Folgende Einstellungen wurden getroffen

  • PixyMon siehe Abb. 10

Dokumentation


→ zurück zum Hauptartikel: Kamerasensor_Pixy_2.1