3

I'm building a MIDI synthesizer on Arduino Uno, and am considering user interface options.

I see on Adafruit and Sparkfun there are 16x2 LCD panels available that interface via I2C serial or by UART, but I think neither of those will work in my application:

  • The UART is clocked at 31250 baud to receive MIDI, and that's not a supported baud rate for these LCD devices;

  • I'm producing audio by driving an external DAC (MCP4725) over full-speed I2C; any transmission to another device would audibly jitter the DAC output;

  • SoftwareSerial would get around the UART clocking problem, but I believe it would stall the main loop while driving the output.

One option might be to roll my own software serial routine, carefully clocking it on the main loop, which (I believe) reliably runs at either 14.8KHz or 22.2KHz depending on the DAC protocol in use. I could set a SparkFun SerLCD into a slow data rate (2400 baud) and count passes through the main loop to time the data output.

Another option would be to use a secondary MCU -- I have a surplus Trinket M0 on hand -- and define a custom synchronous serial protocol between the two MCUs, and have the secondary relay commands to the LCD but that's getting into Rube Goldberg territory.

Any obvious options I'm overlooking?

9
  • Old 16x2 LCDs doesn't have an interface really, just a bunch of cables to connect to some unused pins. Modern OLED comes in I2C and SPI versions.
    – user31481
    Commented Dec 24, 2017 at 7:12
  • Also consider using an Arduino Mega, which has 4 UARTs. Commented Dec 24, 2017 at 10:35
  • @LookAlterno: IIRC, it's a sort of synchronous, either 8-bits or 4-bits, parallel interface. Commented Dec 24, 2017 at 11:13
  • 1
    There are a few interrupt-based SoftwareSerial alternatives floating around that will not stall your loop. Commented Dec 24, 2017 at 11:15
  • 4
    The standard HD44780 LCD interface is defined as a "6800 CPU bus interface" with optional 4-bit mode. That is not "sort of synchronous" nor "not an interface really" but rigidly defined in operation. The I2C and UART LCDs just provide a third party interface (IO expander, small MCU, etc) to that 6800 CPU bus interface.
    – Majenko
    Commented Dec 24, 2017 at 13:41

1 Answer 1

1

One obvious option would be to get a display with SPI interface, since you have it available. Another option is to get a DAC running on SPI, and use the I2C for the display.

If you insist on using one of these 16x2 LCDs, there are SPI adapters for them as well. Example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.