pyBusPirateLite
pyBusPirateLite copied to clipboard
ProtocolError: Could not set IC2 speed
The following code (Python 3):
from pyBusPirateLite.SPI import *
i2c = I2C(portname='COM8', speed=115200)
i2c.pins = PIN_POWER | PIN_CS
i2c.speed = '400kHz'
... leads to the following error:
ProtocolError Traceback (most recent call last)
<ipython-input-7-74521de54adf> in <module>()
1 i2c.pins = PIN_POWER | PIN_CS
----> 2 i2c.speed = '400kHz'
D:\python\pyBusPirateLite\pyBusPirateLite\I2C.py in speed(self, frequency)
220
221 if self.response(1, True) != 0x01:
--> 222 raise ProtocolError('Could not set IC2 speed')
223 self.i2c_speed = frequency
224
ProtocolError: Could not set IC2 speed