How to add another board to Blinka? like the FTD or MSP2221

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

I have the Neo Trinkey which is relatively useless on its own. It has no expansion capabilities. It can't do anything without the host program. It can't communicate with any network. It has no I/O pins. I can't think of anything interesting it can do that doesn't make it a PC peripheral.

I'm thinking that maybe there could be three options.
  • The Neo Trinkey be easier to use with no loss of function if it acted as a port expander that could be addressed from CircuitPython Blinka on my PC. I actually think this is the simplest approach. It requires a BLINKA env variable swapped in a bit of code like the "MSP" and the "FTD".
  • The Neo Trinkey could have n HID profile that supports input for the capacitive touchpoints and output for the LEDs..
  • There is a generic proxy program that runs on the PC that connects to the Trinkey. Maybe hooked to a serial/shell prompt.
I have an MSP2221 that I use with CircuitPython and Blinka and it works ok as a virtual I2C and I/O pin bus for my PC. I feel like that is the best way to approach the Neo Trinkey. There isn't really a whole lot of computing to be done on it in any app on the Neo Trinkey that I can imagine.

Note: The Neo Trinkey has 4 NeoPixels and two capacitive sensors and zero free I/O pins.

User avatar
bidrohini
 
Posts: 202
Joined: Thu Oct 20, 2022 10:03 am

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by bidrohini »

Based on the information provided, it sounds like the best approach for using the Neo Trinkey would be option 1, using it as a port expander that can be addressed from CircuitPython Blinka on your PC. This approach would require minimal changes to the existing code and would allow the Neo Trinkey to be used as an additional I/O pin bus for your PC, similar to the MSP2221 that you are currently using. The other options, such as using the Neo Trinkey as a HID device or running a proxy program on the PC, may be more complex and may not provide additional functionality.

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by adafruit_support_mike »

x_it_all wrote: Sat Jan 14, 2023 6:21 pm I have the Neo Trinkey which is relatively useless on its own. It has no expansion capabilities.
We have more than a hundred kinds of dev board in the shop. If expandability is a goal, the 'USB dongle with no exposed GPIO' Trinkey platform would be at the bottom of my suggestion list.

Try a Trinket M0 or something from the ItsyBitsy line instead.

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by neradoc »

There's a few guides for the Neo Trinkey, some of which use it for HID, which is very easy.
https://learn.adafruit.com/neo-trinkey-zoom-shortcuts

Custom HID descriptors for output from the PC are supported but another story.
https://learn.adafruit.com/custom-hid-d ... cuitpython

It does support Midi and Serial in CP, which are easier alternatives to send data to the board to pilot the LEDs (serial requires less libraries to load into the small RAM of the SAMD21).

Adding it to Blinka would require both some firmware on the board and a new device definition in Blinka. U2IF is supported but only exists for RP2040. I think it would be nice to have a configurable Circuitpython app that can be piloted from Blinka, but that would take some work.

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

MCP2221 not MSP2221. Sorry about that. There is no obvious way to fix my spelling errors after a period of time.
Last edited by x_it_all on Mon Jan 30, 2023 9:46 pm, edited 1 time in total.

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

bidrohini wrote: Sun Jan 29, 2023 12:06 am Based on the information provided, it sounds like the best approach for using the Neo Trinkey would be option 1, using it as a port expander that can be addressed from CircuitPython Blinka on your PC. This approach would require minimal changes to the existing code and would allow the Neo Trinkey to be used as an additional I/O pin bus for your PC, similar to the MSP2221 that you are currently using.
Yes, I think that would be great. A device with 3 I/O pins that are all special purpose feels like a great candidate for a remote peripheral instead of a programming platform. I think it would be a great first-step education platform where all the programming is on the PC. It already has cool LEDs on it.

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

adafruit_support_mike wrote: Mon Jan 30, 2023 3:04 am
x_it_all wrote: Sat Jan 14, 2023 6:21 pm I have the Neo Trinkey which is relatively useless on its own. It has no expansion capabilities.
We have more than a hundred kinds of dev board in the shop. If expandability is a goal, the 'USB dongle with no exposed GPIO' Trinkey platform would be at the bottom of my suggestion list.

Try a Trinket M0 or something from the ItsyBitsy line instead.
It is on me that I picked it. No issue there.

My main point, after whining, is that the Neo Trinkey feels like a port expander because everything you use it for has to have a PC component anyway. The Neo Trinkey can't get any network or Bluetooth. Everything has to go over the USB to a host program. If that is the case then why not make it a Blinka port expander instead? Then kids could write and debug host code with pretty lights. Really any of the zero expansion SUB keys could fall into this category.

The other option is to load a USB network adapter like the Raspberry Pi gadget driver. Then the Trinkey could go to the internet via internet connection sharing.

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

neradoc wrote: Mon Jan 30, 2023 7:18 pm Adding it to Blinka would require both some firmware on the board and a new device definition in Blinka. U2IF is supported but only exists for RP2040. I think it would be nice to have a configurable Circuitpython app that can be piloted from Blinka, but that would take some work.
You'd want something that behaved like the FT232H or MCP2221 and then clone and hack their definitions. I guess the firmware would receive commands over USB that look a lot like the port expander commands. That would let you leverage all the neopixel libraries

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

I ended up doing all the programming on the host using belay https://github.com/BrianPugh/belay

You can see the capacitive touch demo running all from the host via belay https://youtu.be/toD5PwAGxPk

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

Someone must have had the same idea 2 years back. They created firmware they called u2ifwhich can be found on GitHub https://github.com/execuc/u2if It looks like it was integrated with Blinka https://github.com/adafruit/Adafruit_Py ... ct/chip.py.
There is a learning doc at https://learn.adafruit.com/circuitpytho ... /overview

The ui2f firmware does not seem to be maintained.

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by neradoc »

There is U2IF support yes, but as I said above:
neradoc wrote: Mon Jan 30, 2023 7:18 pm U2IF is supported but only exists for RP2040.
And the Neo Trinkey is a SAMD21 board.

User avatar
x_it_all
 
Posts: 18
Joined: Thu Jan 05, 2023 10:27 pm

Re: How to add another board to Blinka? like the FTD or MSP2221

Post by x_it_all »

There is U2IF support yes, but as I said above:
D'oh. Yes, you did. I forgot about the earlier post while I noodled on this.

After using Belay. I tried another route and built a command parser to control the LEDs https://github.com/freemansoft/Adafruit ... t-neopixel

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”