Merge pull request #11 from nalzok/master

Improvements on the PmodOLED example
This commit is contained in:
wuxx
2020-10-01 13:27:25 +08:00
committed by GitHub
5 changed files with 20 additions and 32 deletions

View File

@@ -1,9 +1,9 @@
# Courtesy of https://github.com/laanwj/yosys-ice-experiments
- Display: Digilent PmodOLED 128x32 grid SSD1306 module
- Connected to iCEstick evaluation board
- Display: [Digilent PmodOLED 128x32 grid SSD1306 module](https://store.digilentinc.com/pmod-oled-128-x-32-pixel-monochromatic-oled-display/)
- Connected to iCESugar on PMOD2
- Using 4-wire SPI 10MHz max
- iCE40HX-1k FPGA, programmed using open source FPGA toolchain Yosys + Arachne-pnr + IceStorm
- iCE40UP5k FPGA, programmed using open source FPGA toolchain Yosys + nextpnr + IceStorm
- Image generated using Python script, sent from PC through FTDI serial-over-USB 1000000 baud
```
@@ -13,6 +13,15 @@
1M baud (pmod conn)
```
Set up
--------------
Connect PmodOLED to PMOD2 on iCESugar, and optionally, Pmod-LED to PMOD3.
Note: you may need to change the function `detect_serial` in `util.py` to specify the serial interface.
![icesugar_render](setup.jpg)
PmodOLED
------------
@@ -31,24 +40,3 @@ Pin | Signal | Description
5, 11 | GND |
6, 12 | VCC | Power Supply G
Pins on FPGA
--------------
Connecting PMODoled: on module: when connector is to the left, pin 1 is at the top right.
Pin 1 is clearly indicated on the iCEstick itself.
Pin | Signal | Pkgpin
-----|---------|---------
1 | PIO1_02 | 78
2 | PIO1_03 | 79
3 | PIO1_04 | 80
4 | PIO1_05 | 81
5 | GND |
6 | VCC |
7 | PIO1_06 | 87
8 | PIO1_07 | 88
9 | PIO1_08 | 90
10 | PIO1_09 | 91
11 | GND |
12 | VCC |

View File

@@ -24,9 +24,9 @@ class OledDisplay(BaseDisplay):
if port is None:
ports = detect_serial()
if len(ports) == 0:
raise IOError('No iCEStick devices detected')
raise IOError('No iCESugar devices detected')
if len(ports) > 1:
raise IOError('Multiple possible iCEStick devices detected. Need to specify which one to use')
raise IOError('Multiple possible iCESugar devices detected. Need to specify which one to use')
port = ports[0]
self.conn = serial.serial_for_url(port, 1000000,
parity=serial.PARITY_NONE, rtscts=False, xonxoff=False, timeout=1)

View File

@@ -4,13 +4,13 @@ set_io clk 35
set_io resetq 18
# LEDs (PMOD 3)
set_io LED0 27
set_io LED1 25
set_io LED2 21
set_io LED0 32
set_io LED1 28
set_io LED2 26
set_io LED3 23
set_io LED4 26
set_io LED4 34
# PMOD OLED module connected
# PMOD OLED module (PMOD 2)
set_io PMOD_CS 46
set_io PMOD_SDIN 44
set_io PMOD_SCLK 37

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

@@ -36,7 +36,7 @@ def tile_image(ingrid):
return data
def detect_serial():
'''Detect serial port for iCEStick.
'''Detect serial port for iCESugar.
Based on 'findserial' in swapforth.
'''
import glob, subprocess