Showing posts with label LCD. Show all posts
Showing posts with label LCD. Show all posts

Tuesday, December 5, 2023

7" LCD (ESP32) with C64 Text Emulator

 

7" is giant compared to this much smaller screen

So this ESP32-8048S070 showed up from AliExpress today.  It is a 7" IPS with touchscreen with ESP32-S3-WROOM-1 module, 16MB flash, 8MB PSRAM, microSD card, USB-C serial (CH3400 serial), Speaker connector, and other IO connectors.   The large LCD is 800x480 resolution.

The ordering page had a ZIP download of the examples, so I made sure I could build their Arduino Hello World TFT sample (I downgraded to Arduino_GFX library 1.3.1), and then ported my c-simple-emu6502-cbm project including upscaling from one to four pixels to cover the screen with C64 goodness.  Without upscaling, the C64 was using less than a quarter of the screen.   I skipped the SD support, and went straight to creating a FATFS partition and uploading a D64 image.  Saves me from pulling an SD, but moving files up and down will be a bit more cumbersome.  Included in the project already was custom wireless BLE keyboard support, so I was typing away and running my programs right away.

The largest IPS I had on hand was 3.5" 480x320, so this is a definite upgrade.  

The only downsides to this board that I can tell are the lack of an enclosure (ships in a nice plastic storage box though - I hear there is a 3D printable one on github somewhere though), and the lack of direct connection to the native ESP32-S3 USB port.  Then again, a permanent serial connection is more convenient for flashing Arduino sketches otherwise you have to keep selecting the COM port on other solutions.

Even though I've worked with it only a few hours, I highly recommend this board!

Monday, February 22, 2021

C64 Emulator for Teensy 4.1 LCD/USB/SD(D64)



Here is my Teensy 4.1 on a breadboard pretending to be a Commodore 64.  USB keyboard, color text, background, border, and D64 (1541 image) support for LOAD/$/SAVE.  6502 emulation supports machine language, and Commodore 2.0 BASIC programs.   Sorry text only, no games, no graphics, no sound, no joysticks, just simple stuff for now.  But that simple stuff works! (mileage may vary, lightly tested, please try this at home under controlled conditions).




Saturday, September 3, 2011

Serial Text LCD

Serial Text LCD module
This project connects a Text LCD display to a microcontroller or PC via a single serial transmission line (plus power).
One of the challenges of integrating a text LCD display is the number of pins to connect. A display module typically has 16 lines, with 11 for data and control. That's a lot of lines for a microprocessor to handle. One way to handle it is to get an I/O expander (I2C or SPI), another way is to use a serial protocol such as a UART. The advantage of have a UART compatible text LCD display module is that it can be controlled with just a single TX line. The downside is using up one of (or your only) microcontroller's UART transmission line, unless you can use software UARTs.

backside
Prototype with serial connections

My requirements included performing a very simple firmware implementation.  I didn't want to spend a lot of effort creating the module.  And I wanted to learn the communications with the LCD module, so limiting to just a text interface was not desired.  I ended up implementing a 6-bit raw protocol, and writing a .NET program to talk to the LCD using 4-bit mode.  I already had some firmware for my 485 monitor that I quickly adapted for use with the LCD.  Bytes are received serially on the RX line, then output to the PORTB, of which 6-bits are wired to the LCD.  After echoing the raw hex back on the TX line (for diagnostics, not necessary for operation), the data byte is strobed with bit 5 cleared to finalize communication with the LCD.  I ended up expanding on the .NET program to have a form where what is typed on the screen is efficiently updated to the LCD screen.

I want to interface with 3.3V microcontrollers, and I want the cost to be low, so I used an available PIC18F26K22 I had received as a sample from Microchip, with the circuit using 5V from USB stepped down to 3.3V with a voltage regulator for the CPU.  The LCD runs at 5V, accepting 3V logic from the CPU.  The latest version of the circuit has an added jumper to select whether the PIC runs at 3.3V or 5V, which in turn determines the I/O voltage levels of the module.  The five port socket includes 5V, 3.3V (output), Ground, TX (output), and RX.  Minimally only 5V, Ground, and TX need to be connected.  This PIC is currently configured to run at its top speed of 64MHz! (This may be overkill for just driving an LCD.)  The LED in the circuit is a heartbeat to show that the PIC is running.

.NET program and hex diagnostics 
Schematic


I plan to immediately use this module with other PIC, Arduino, and Netduino projects.  Writing the .NET program allowed me to more easily learn the LCD protocol than debugging the firmware.  I may expand the firmware to move more of the LCD protocol into the PIC18 firmware, or at least have that option.  Other possibilities are to implement I2C and/or SPI interfaces.

Update: In addition to Windows, I have had success using this module with the mbed, LPCXpresso 1769, chipKIT Max, and Arduino. 

Monday, August 8, 2011

mbed Text LCD development board


This is my take on an mbed development board to support different LCD sizes.


The three sizes shown here are 20x4, 16x2, and 8x2.  Some LCD screens have a single row of 16 pins.  Others have two columns of seven (or eight) pins.  I developed this board to not hard-wire any connections except those dedicated on the mbed itself.  The LCD screen can be wired up in 4-bit (shown) or 8-bit mode using any available I/O lines.  Additional sockets are provided for USB host, USB device, Ethernet MagJack, and microSD.  Four switches with sockets are also provided.


eBible with power from Motorola


As most everything was socketed and not hard-wired, there's a lot of solder bridges connecting the sockets.  14 or 16 of the LCD socket connections are wired together in a mass of wire under the board.  This allows using jumper wires for just the top 16 wire socket, and plugging in any of the three LCDs that I have.  One of the LCDs was modified to grab power from the 2x7 socket.  Another has an additional two leads that are socketed.  The reason for the two different 2x7 sockets was that the functions of pins 1/2 were reversed on the 16x2 LCD display.  Alternatively, I could have used a switch or relied on changing the jumper wires.

The microSD has 7 connections, so just provided a 7x2 socket, and this requires jumpering the lines to the mbed.  I can then choose which SPI connections to make, and what line to be the chip select and/or card detect.  I attach a microSD breakout board from SparkFun.

The Ethernet MagJack is hard wired except for the LEDs.  A specific breakout board from SparkFun is required.

A USB device jack is socketed to support a mini USB device breakout board.  Alternatively a USB-A cable can be connected.

Power (3.3V) and ground buses are included, hard wired to the mbed.

Saturday, July 23, 2011

eBible


I developed this eBible for the NXP mbed Design Challenge in February 2011. It utilizes an mbed prototying board socketed along with a small LCD text screen, buttons, SD card socket, and other custom circuitry.

Abstract, documentation, schematics, C++ source, etc. are available on the mbed.org site.