Here's what I've got:
- Metro M4 Express Airlift
- Adafruit RGB LCD shield (not piggybacked, but wired with I2C)
- A 3x4 matrix keypad (which is connected but not really a part of the equation yet)
- A home-built case that is designed to work in a dirty shop environment, so the board itself is not accessible from outside the box. Because of that, I've got:
-- A micro-usb port on the outside of the box that goes to a micro-usb plug that is plugged into the Metro
-- A power jack wired through a switch that ends in a 5v plug, which is plugged into the DC jack of the Metro
-- A nine-pin female port to the outside of the box so external things can be plugged in
I'm using (or plan to use) these pins:
- Digital pins 1-7 are connected to the 7 pins on the matrix keypad
- SCL and SCA pins are connected to the RGB LCD
- GND (next to Vin) and 5V connected to a little homemade power node which is connected to:
-- The RGB LCD (5V and GND)
-- 2 pins of the 9-pin port (5V and GND)
- The 9-pin port is connected to:
-- A0, which is planned to be used as an analog sensor input
-- A1, which will be a digital output
-- A2, which will be another digital output
-- The aforementioned power connections
I have edited code.py to be the basic circuitpy demo code from the Adafruit Learn page for the RGB LCD:
Code: Select all
import board
import busio
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
lcd_columns = 16
lcd_rows = 2
i2c = busio.I2C(board.SCL, board.SDA)
lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
lcd.color = [100, 255, 0]
lcd.message = "Hello\nCircuitPython"
Up until this morning, I could plug a micro-usb cable from my PC to the port on the outside of the box, and it would connect to the Metro and give me the CIRCUITPY folder, and display the correct message on the RGB LCD. I could unplug the micro-usb from the outside of the box, plug in a 5V DC adapter from the wall outlet, turn on the power switch, and the Metro would turn on, "boot up" for lack of a more accurate term, and the RGB LCD would display the correct message. Nothing is plugged into the external 9 pin connector at this time, though a test rig for that part was working earlier today as well.
Now, if I plug a micro-usb cable in to the outside port, the green "On" led on the board lights up, and the "L" led lights up red, but then nothing else happens. The neopixel doesn't light, the RGB LCD does not come on, and the CIRCUITPY folder does not come up on the computer.
If I do any of the following, the board springs to life and works correctly, the LCD works, and the folder appears:
- Unplug the connector that plugs into the GND and 5V pins
- Unplug the connector that plugs into the SCL and SDA pins
If I connect a 5V DC adapter and turn on the switch, it works, but the brightness on the LCD needs to be increased. If I then leave that connected and plug in the micro-usb, the CIRCUITPY folder comes up on the computer and the LCD brightness is fine.
At any point after things are working, I can plug back in any pins I've unplugged and everything continues to function. If I exit code.py and save it, the changes are reflected on the LCD, so it's all really working correctly once it's working.
In use, it's going to be powered by the DC adapter, so that's great, but the process of getting the code set up requires the micro-usb connection, and the flakiness of it is troubling.
Any ideas?
Thanks,
Big Dave
EDIT - In the interest of thoroughness I tried pulling the data pins (A0, A1, and A2) and keypad pins (D1-D7) when the startup was "hung" but neither of those sets of pins had any effect.
EDIT AGAIN - I also used REPL for the first time earlier today. It worked as expected, but maybe I messed something up somehow?