Re: Simpler Question (Re: MCP2221 I2C/UART to USB)

From: George Mitchell <george+freebsd_at_m5p.com>
Date: Sat, 16 Nov 2024 17:24:05 UTC
On 11/15/24 20:27, Tomek CEDRO wrote:
> On Thu, Nov 14, 2024 at 12:21 AM Tomek CEDRO <tomek@cedro.info> wrote:
>> On Thu, Nov 14, 2024 at 12:08 AM George Mitchell <george+freebsd@m5p.com> wrote:
>>>> Okay I just ordered the MCP2221A Breakout Stemma QT/Qwiic for ~10EUR
>>>> it should arrive on Friday/Monday will see what happens ;-)
>>> That just happens to be the board I was hoping to get!        -- George
>> Cool I will let you know how it works :-)
> 
> This MCP2221A works like a charm out of the box on FreeBSD 13.3 :-)
> [...]
> Regarding the additional stuff it seems to work in Python over hid but
> I did not play any further (after cable disconnect I got errors on
> commands so there is some communication).
> 
> (venv3.11embedded) python
> Python 3.11.10 (main, Sep 14 2024, 01:19:37) [Clang 17.0.6
> (https://github.com/llvm/llvm-project.git llvmorg-17.0.6-0-g600970 on
> freebsd13
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from PyMCP2221A import PyMCP2221A
>>>> mcp2221 = PyMCP2221A.PyMCP2221A()
>>>> mcp2221.GPIO_Init()
> mcp2221.ADC_1_Init()         mcp2221.CLKDIV_2
> mcp2221.CLKDUTY_25           mcp2221.DAC_2_Init()
> mcp2221.GPIO_0_InputMode()   mcp2221.GPIO_1_Input()
> mcp2221.GPIO_2_DIR           mcp2221.GPIO_3_BIT
> mcp2221.GPIO_3_OutputMode()  mcp2221.I2C_Read(
> mcp2221.Read_Flash_Data(
> mcp2221.ADC_2_Init()         mcp2221.CLKDIV_32
> mcp2221.CLKDUTY_50           mcp2221.DAC_Datawrite(
> mcp2221.GPIO_0_MODE          mcp2221.GPIO_1_InputMode()
> mcp2221.GPIO_2_Input()       mcp2221.GPIO_3_DIR
> mcp2221.GPIO_Init()          mcp2221.I2C_Read_Repeated(
> mcp2221.Reset()
> mcp2221.ADC_3_Init()         mcp2221.CLKDIV_4
> mcp2221.CLKDUTY_75           mcp2221.DeviceDriverInfo()
> mcp2221.GPIO_0_Output(       mcp2221.GPIO_1_MODE
> mcp2221.GPIO_2_InputMode()   mcp2221.GPIO_3_Input()
> mcp2221.GPIO_Read()          mcp2221.I2C_State_Check()
> mcp2221.Write_Flash_Data(
> mcp2221.ADC_DataRead()       mcp2221.CLKDIV_64
> mcp2221.ClockOut(            mcp2221.GPIO_0_BIT
> mcp2221.GPIO_0_OutputMode()  mcp2221.GPIO_1_Output(
> mcp2221.GPIO_2_MODE          mcp2221.GPIO_3_InputMode()
> mcp2221.GPIO_Write()         mcp2221.I2C_Write(
> mcp2221.mcp2221a
> mcp2221.CLKDIV_128           mcp2221.CLKDIV_8
> mcp2221.Command_Structure(   mcp2221.GPIO_0_DIR
> mcp2221.GPIO_1_BIT           mcp2221.GPIO_1_OutputMode()
> mcp2221.GPIO_2_Output(       mcp2221.GPIO_3_MODE
> mcp2221.I2C_Cancel()         mcp2221.I2C_Write_No_Stop(
> mcp2221.CLKDIV_16            mcp2221.CLKDUTY_0
> mcp2221.DAC_1_Init()         mcp2221.GPIO_0_Input()
> mcp2221.GPIO_1_DIR           mcp2221.GPIO_2_BIT
> mcp2221.GPIO_2_OutputMode()  mcp2221.GPIO_3_Output(
> mcp2221.I2C_Init(            mcp2221.I2C_Write_Repeated(
> 
> Regarding the rPI Zero 2W I dd'ed the 14.1 SD image for RPI and got
> the rainbow box on hdmi but some updates are needed in the firmware
> files on first partition, I quickly updated to git master but that did
> not help, and I not rally have time now to play, but it was fun to try
> :-)
> 
> Have fun George :-)
> 
Great news!  Thank you for all your help!                  -- George