I've found only one source to connect DS1302 and it is with a Microbit microcontroller.
( https://github.com/shaoziyang/microbit- ... isc/DS1302 )
I now try to built the corresponding repository for PICO
( https://github.com/Patriboom/DS1302_Python_RaspPICO )
I've never touch a Microbit MC, but according to the pinout I found ( https://www.microbit-spy.co.uk/wp-conte ... pinout.png )
The pinning goes as the folling:
Microbit Description PICO PIN
clk=pin13, SPI-1.SCK 14:SPI-1.SCK 10
dio=pin14, SPI-1.MIS0 15:SPI-1.TX 11
cs=pin15 SPI-1.MOSI 16:SPI-1.RX 12
Trying to reproduce the same logical, I did the following pinout on Rasp PICO
DS1302 PICO
VCC 39: VSYS
GND 38: GND
CLK 14: SPI1.SCK -- GP 10
DIO 15: SPI1.TX -- GP 11
CS 16:SPI1.RX -- GP 12
It didn't work.
I thought to have connected Rx and Tx on reverse then I connected as:
DS1302 PICO
VCC 39: VSYS
GND 38: GND
CLK 14: SPI1.SCK -- GP 10
DIO 15: SPI1.RX -- GP 12
CS 16:SPI1.TX -- GP 11
No better chance.
Always such error message:
Code: Select all
Traceback (most recent call last):
File "", line 20, in
File "DS1302.py", line 99, in Hour
File "DS1302.py", line 62, in getReg
File "DS1302.py", line 53, in read_byte
TypeError: unsupported types for lshift: 'Pin', 'int'`
Thanks