Finally got the samples running again on Teensy & ILI9341 after some lib changes
Have to still test ILI9488. For testing swapping between MCUs and displays is a bit of a pain on breadboard to do all the wiring manually, so have been thinking of making some standard HW interface to enable snapping different MCU-display combos quickly.
Yes, I've been planning, making breadboards, and soldering up prototype boards that have 2 sets of SPI pins in a standard order with the idea that I can quickly swap either different displays or different Teensies. I then make custom cables that attach to each display that plugs into the standard 10 pin header that goes to a specific display. The order I've chosen for the 10 pin header is:
- Ground
- Power (either VIN or 3.3v)
- SCLK
- MOSI
- MISO
- CS-A
- D/C
- Reset
- CS-B
- Blink (typically connected to 3.3v)
For the first SPI header, I use the standard SPI pins (13, 11, 12), and I only use the first 24 pins to allow any Teensy to be plugged into the system. The two CS pins and D/C are chosen from the 'fast' pins in the Teensy 3.2, 3.5, and 3.6 to allow me to use the uncanny eyes program. Pin CS-B can either be used for a display's SD card reader, touch screen interface, or with uncanny eyes in Teensy 3.x to drive 2 displays. Pins CS-A through blink have dip switches, so there is a default value, but I can override the default by turning off the dip switch and using a jumper wire. My current defaults are:
- Ground - ground
- Power - connected to a switch between 3.3v and VIN
- SCK: 13
- MOSI: 11
- MISO: 12
- CS-A: 22
- D/C: 9
- Reset: 5
- CS-B: 10
- Blink: 3.3v
For the 2nd SPI header, I only use pins that both the Teensy 4.0 and 4.1 support (though you have to bring out some of the Teensy 4.0 pins from the solder pads underneath the Teensy 4.0). Fortunately, the 2 or 3 Teensy 4.0's that I have wired up with the underneath pins use the Teensy 4.1 pin layout for pins 24-32. In addition to dip-switches for CA-A through Blink, on the 2nd SPI there is an extra dip-switch to switch MISO from pin 1 to the alternate pin 39 for the Teensy 4.1:
- Ground - ground
- Power - connected to a switch between 3.3v and VIN
- SCK: 27
- MOSI: 26
- MISO: 1
- CS-A: 0
- D/C: 24
- Reset: 25
- CS-B: 28
- Blink: 3.3v
I soldered up the first generation of prototype board, but I'm a little unhappy with some of the decisions, and some of the soldering for the non-display pins may be wrong. But any way, the headers this board has are:
- dual 24-pin rows for Teensy, and to use jumper wires for any pin;
- The two SPI headers, plus the dip-switches;
- Three pin jumper header to switch both SPI displays from 3.3v to VIN;
- I2C header, including pull-up resistors for I2C (this doesn't work in the current board);
- Pinout for ground, 3.3v, 15, and 14 to allow access to Serial3, 2 analog input pins, S/PDIF, or PWM;
- Pinout for ground, 3.3v, 28, and 29 to allow access to Serial7 or PWM;
- Pinout for ground, pin 16, and 3.3v to allow plugging in a potentiometer (with a dip switch to use a different pin);
- Connect pin 3 to a momentary switch and ground to use as a general button;
- Connect pin 4 to a dip switch or jumper to allow for a dedicated switch;
- Pinout for ground, VIN, and pin 17 (connected via level shifter) for use with neopixels (this doesn't work in the current board);
- The next board should have a separate pinout for accessing ground, 3.3v, and pin 17 without doing the level shifting and a dip switch to change pin.
Some of the design decisions include:
- Don't use pins 2, 6, and 7 as these are used by the prop shield;
- Don't use pin 10 as the main CS pin, since this is used by both the prop and audio shields;
- Don't use pin 21 as this is used by the feather adapter for battery gauge;
- Don't use pins 7, 8, 20, 21, and 23 as these are used by the revision D audio shield;
- Don't use pin 16 for the SPI headers, since this is used by the audio shield (it is brought out in the Serial3 breakout);
- Use the Teensy 3.x 'fast' pins for the first SPI display (22, 9, and 10);
- Use a TX pin for neopixel (pin 17) to allow using the WS2812Serial library on Teensy 4.0 and 4.1;
- The I2C breakout order allows connecting the Sparkfun I2C to QWIICK header directly;
- Except for potentiometer & neopixels, always put ground first, power second in the pinouts;
- Potentiometer pinout allows plugging a potentometer directly into the headers (ground, data, 3.3v);
- Neopixel matches my existing cable label (ground, power, data);
- I've used pin 3 as a momentary button in previous shields.