Open Source & Linux Lab

It's better when it's simple

User Tools

Site Tools


etc:users:jcmvbkbc:hardware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
etc:users:jcmvbkbc:hardware [2026/08/29 16:41] – add SPI pinout and pyftdi example jcmvbkbcetc:users:jcmvbkbc:hardware [2026/08/29 16:52] (current) – jcmvbkbc
Line 45: Line 45:
 === SPI master === === SPI master ===
 == Pin functions == == Pin functions ==
-  * 5: SDO +  * 5: MOSI 
-  * 7: SCL+  * 7: CS0
   * 9: SCK   * 9: SCK
-  * 13: SDI (pulled up by default)+  * 13: MISO (pulled up by default)
  
 == PyFTDI-based example == == PyFTDI-based example ==
 +API doc: https://eblot.github.io/pyftdi/api/spi.html
 <code> <code>
 from pyftdi import ftdi, spi from pyftdi import ftdi, spi
Line 61: Line 62:
 ctrl = spi.SpiController() ctrl = spi.SpiController()
 ctrl.configure("ftdi://0x15ba:0x002a:1/1") ctrl.configure("ftdi://0x15ba:0x002a:1/1")
-spi = ctrl.get_port(freq = 10000000, cs = 0) +port = ctrl.get_port(freq = 1000000, cs = 0) 
-...+ 
 +port.write(b'1234', start = True, stop = False) # address phase, 4 bytes 
 +port.read(1, start = False, stop = False, droptail = 4) # dummy phase, 4 clock cycles 
 +port.read(1, start = False, stop = True) # read phase, 1 byte
 </code> </code>
etc/users/jcmvbkbc/hardware.txt · Last modified: 2026/08/29 16:52 by jcmvbkbc