arachnidlabs / mcp2210 Goto Github PK
View Code? Open in Web Editor NEWPython library for interfacing with the MCP2210 USB-SPI interface.
License: BSD 2-Clause "Simplified" License
Python library for interfacing with the MCP2210 USB-SPI interface.
License: BSD 2-Clause "Simplified" License
I cannot get this to work in Linux.
dev = MCP2210(my_vid, my_pid)
I just get "IOError: open failed". It sounds like it cannot open the device.
Do I need to install something else?
The library does not work with python 3, probably because the buffer() function has been replaced with memoryview().
Hi, I was just looking at using this, but notice that you are using a python 'hid' module.
Which hid module is this ??
I used this repo from osx and managed to get a hello world working. But on the windows side it's less painful to use the dll provided from microchip. You can find it buried in here: http://ww1.microchip.com/downloads/en/DeviceDoc/MCP2210_DLLv2.zip
Is it possible to know which libraries/packages are necessary to run the mcp2210 package with Linux/Windows?
I ran in problems with win7/64bit regarding the hid library (installed afterwards with 'pip install hidapi') and then with
from mcp2210 import commands
ImportError: cannot import name commands
Some specific errors, like 'bus in use' and 'chip locked' should be represented by specific subclasses.
Currently we wait for a short period after each command. Instead, we should recognise the 'transfer in progress' error and try again.
hi,@Arachnid
when i driver MCP2210 in Python3.5.2 window7,i encounter a problem:
>>> from mcp2210 import MCP2210
>>> dev = MCP2210(0x04D8,0x00DE)
>>> dev.manufacturer_name = "123"
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
dev.manufacturer_name = "123"
File "D:\Python35-32\lib\site-packages\mcp2210-0.1.4-py3.5.egg\mcp2210\device.py", line 77, in setter
self.sendCommand(set_command(value))
File "D:\Python35-32\lib\site-packages\mcp2210-0.1.4-py3.5.egg\mcp2210\commands.py", line 91, in __init__
self.string = s
File "D:\Python35-32\lib\site-packages\mcp2210-0.1.4-py3.5.egg\mcp2210\commands.py", line 100, in string
self.str[i] = ord(x)
TypeError: ord() expected string of length 1, but int found
>>>
PS: i have modifyed the code according to @bddap in the "Pull Requests"
please give me a hand.
Hi;
My apologies, through a lot of trial and error I have managed to solve my initial problems with I/O control.
If I have multiple devices on the network, and have the gpio.pin set as a cs pin, how do I select the pin prior to a data transfer to that the correct device is selected ?
Do I have to do this by defining the pin as an i/o pin and then pull it high/low before and after a data transfer or is there a method that uses the cs pin instead ?
Also, is it possible to do data transfer using hex values i.e: dev.transfer(0x8d,0x14,0xaf)
Got the following issue when working with Python 3.7 on Windows 10.
Traceback (most recent call last):
File "C:/Users/avijit.das/PycharmProjects/SampleTest/sample1.py", line 6, in
dev = MCP2210(vid, pid)
File "C:\Users\avijit.das\PycharmProjects\sample\venv\lib\site-packages\mcp2210\device.py", line 123, in init
self.cancel_transfer()
File "C:\Users\avijit.das\PycharmProjects\sample\venv\lib\site-packages\mcp2210\device.py", line 224, in cancel_transfer
self.sendCommand(commands.CancelTransferCommand())
File "C:\Users\avijit.das\PycharmProjects\sample\venv\lib\site-packages\mcp2210\device.py", line 134, in sendCommand
command_data = [ord(x) for x in buffer(command)]
NameError: name 'buffer' is not defined
Process finished with exit code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.