Search found 7 matches

by PeterA
Thu Aug 02, 2018 12:23 pm
Forum: MicroPython pyboard
Topic: Pyboard 1.1 Eagle library
Replies: 3
Views: 658

Pyboard 1.1 Eagle library

Has anybody got a Pyboard 1.1 library for Eagle or just the footprint maybe? I don't need the whole thing only the headers would be enough.

Thanks

Peter
by PeterA
Tue Jun 05, 2018 1:06 pm
Forum: MicroPython pyboard
Topic: SPI digital pot control MCP4151-502
Replies: 9
Views: 853

Re: SPI digital pot control MCP4151-502

Update: It worked! The lack of CS signal was the problem, substituted the CS pin with X1. import utime from pyb import SPI spi = SPI(2, SPI.MASTER, baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB) CS = pyb.Pin(pyb.Pin.board.X1, pyb.Pin.OUT_PP) CS.value(1) pyb.udelay(300) CS.value(0) ...
by PeterA
Tue Jun 05, 2018 9:23 am
Forum: MicroPython pyboard
Topic: SPI digital pot control MCP4151-502
Replies: 9
Views: 853

Re: SPI digital pot control MCP4151-502

So the problem appears to be the SS/CS pin, the pyb SPI driver doesn't use it (in the documentation: "At the moment, the NSS pin is not used by the SPI driver and is free for other use.") and is always set to low. The MCP4xxx digital pots require the CS pin to function at all (in the MCP4xxx documen...
by PeterA
Sun Jun 03, 2018 7:19 pm
Forum: MicroPython pyboard
Topic: SPI digital pot control MCP4151-502
Replies: 9
Views: 853

Re: SPI digital pot control MCP4151-502

There indeed was a problem with the measurement. I still don't know what went wrong, but I redid it, and the problem was gone. Here is a comparison between the RPI and the PYB, where the polarity and phase were set to 0 and the bits to 8. The first three rows show MOSI activity on channel 1 and chan...
by PeterA
Wed May 30, 2018 10:18 pm
Forum: MicroPython pyboard
Topic: SPI digital pot control MCP4151-502
Replies: 9
Views: 853

Re: SPI digital pot control MCP4151-502

The logic analyser is a great idea, but I really don't have time to wait for one, so I hooked the pyboard and the Raspberry pi to an oscilloscope, and the results are interesting. https://imgur.com/a/qGiEzBX Channel 1 was hooked up with MOSI and channel 2 to the clock. The initialisation parameters ...
by PeterA
Tue May 29, 2018 1:13 pm
Forum: MicroPython pyboard
Topic: SPI digital pot control MCP4151-502
Replies: 9
Views: 853

Re: SPI digital pot control MCP4151-502

Hello Peter, thank you for your reply. I added a 150KΩ just to be on the safe side. Otherwise I haven't been having the best of luck with the SPI communication. I tried using the machine library, it also didn't work. Also tried every possible variation of argument values for initiating the SPI bus (...
by PeterA
Thu May 24, 2018 9:28 am
Forum: MicroPython pyboard
Topic: SPI digital pot control MCP4151-502
Replies: 9
Views: 853

SPI digital pot control MCP4151-502

I have a 5k digital pot (MCP4151-502 - ww1.microchip.com/downloads/en/DeviceDoc/22060a.pdf) that I would like to control via the pyboard. This is my second time using SPI so I'm not particularly good at it at all. I've used this pot before on the Raspberry Pi. It's really simple to set up and get go...