Skip to content

Commit 640af0f

Browse files
authored
Merge branch 'peterhinch:master' into master
2 parents a7f3dbd + 51f7a13 commit 640af0f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

eeprom/spi/SPI.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ The driver has the following attributes:
2222

2323
As of Jan 2024 this driver has been updated to fix a bug where the device page
2424
size was less than 256. A further aim was to make the driver more generic, with
25-
a better chance of working with other SPI EEPROM chips. The constructor has
25+
a high chance of working with other SPI EEPROM chips. The constructor has
2626
additional optional args to support this.
2727

28+
On Pyboard D soft SPI should be used pending resolution of
29+
[this PR](https://github.com/micropython/micropython/pull/13549).
30+
2831
Code samples assume one or more Microchip devices. If using the STM chip the
2932
SPI baudrate should be 5MHz and the chip size must be specified to the `EEPROM`
3033
constructor, e.g.:

eeprom/spi/eep_spi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ def get_eep(stm):
2424
if stm:
2525
if ESP8266:
2626
spi = SoftSPI(baudrate=5_000_000, sck=Pin(4), miso=Pin(0), mosi=Pin(2))
27-
else: # Pyboard. 1.22.1 hard SPI seems to have a read bug
27+
else: # Pyboard. See https://github.com/micropython/micropython/pull/13549
2828
# spi = SPI(2, baudrate=5_000_000)
29-
spi = SoftSPI(baudrate=5_000_000, sck=Pin('Y6'), miso=Pin('Y7'), mosi=Pin('Y8'))
29+
spi = SoftSPI(baudrate=5_000_000, sck=Pin("Y6"), miso=Pin("Y7"), mosi=Pin("Y8"))
3030
eep = EEPROM(spi, cspins, 256)
3131
else:
3232
if ESP8266:
3333
spi = SoftSPI(baudrate=20_000_000, sck=Pin(4), miso=Pin(0), mosi=Pin(2))
3434
else:
3535
# spi = SPI(2, baudrate=20_000_000)
36-
spi = SoftSPI(baudrate=20_000_000, sck=Pin('Y6'), miso=Pin('Y7'), mosi=Pin('Y8'))
36+
spi = SoftSPI(baudrate=20_000_000, sck=Pin("Y6"), miso=Pin("Y7"), mosi=Pin("Y8"))
3737
eep = EEPROM(spi, cspins, 128)
3838
print("Instantiated EEPROM")
3939
return eep

0 commit comments

Comments
 (0)