Home > Microcontroller >Microcontroller Production > How to design a home computer using Arduino DUE

How to design a home computer using Arduino DUE

Source: InternetPublisher:闪电杰克 Keywords: Computer Arduino Updated: 2024/08/06

This project started in a rainy summer of 2021, during the pandemic, I started writing a BASIC interpreter for Arduino from scratch. The project was simple and targeted at Arduino UNO and other small systems, but it is now outdated. This project is intended to show how to build a complete standalone computer with it.

The computer here is a home computer based on the Arduino DUE, with a 7-inch 800*480 graphic display, printer support, SD card disk, PS2 keyboard and real-time clock. It includes full Arduino I/O support and a simple way to access I2C devices from the BASIC language.

How to choose the right monitor

Buying the right display can be a bit tricky. There are many libraries available on the market with varying quality. I chose a 7" SSD1936 compatible 800*480 screen. It can be used with the UTFT library. To connect it to an Arduino Mega or DUE, a shield is required. The DUE and Mega shields differ due to the different layout of the SPI pins in the two Arduinos.

It's best to consult the UTFT library manual before purchasing a display.

There is one more important point when you use the TFT shield for DUE. In the library folder of UTFT (UTFT/hardware/arm), you need to edit HW_ARM_defines.h and uncomment #defineCTE_DUE_SHIELD1.

Prepare TFT Shield and TFT

The TFTshield will completely cover the upper side of the Arduino. It can be easily connected without the need for additional wires. There are no prototyping boards on the market that work with the shield. For this reason, I soldered a few wires on the shield to get the power supply.

The blue wire is GND, the white wire is +5V, and the green wire is +3.3V. The wires can be connected to a breadboard on the bottom of the display to power a keyboard and other devices.

My DUE acts as its own SD card slot. An old 2GB SD card formatted with the FAT file system is used as mass storage.

The DUE shield has an SPI connector in the middle. Unlike the MEGA256, the DUE's SPI bus is not accessible from pins 50-53. It is only accessible through the middle SPI connector. The MEGAShield will not work on the DUE.

Preparing the Arduino

I use pins 8 and 9 to connect a PS2 keyboard, a second serial port for a printer, and the I2C pins for an optional real time clock and other peripherals.

To access the pins without more soldering cables, you can connect them to the DUE before attaching the shield.

Pressing the DUE on the shield will hold the cable in place. It's not perfect electronics, but it works.

Then plug the DUE and shield into the back of the monitor

Prepare the PS2 socket

If you are using a 5V machine ArduinoMEGA256, you are done after soldering. You can connect pin 8 of the Arduino to the clock pin of the keyboard socket and pin 9 to the data pin. The power supply for the keyboard comes from GND and the 5V soldered to the shield. Double check here because wrong polarity of the power supply will fry the keyboard.

For the Arduino DUE, it is recommended to use a level converter between the keypad and the Arduino pins since the DUE is a 3.3V system.

The GND and +5V pins and the connector for the PS2 socket go to the 5V side of the level converter, while the GND, 3.3V power supply, and two Arduino pins go to the 3.3V side. It is best to mount the level converter on a breadboard behind the screen.

Upload software

Load the UTFT library in the ArduinoIDE from the website. Also make sure you have the actual patched version of the PS2 library (see link below). If you plan on adding a clock you should also download uRTCLib and uEEPROMLib.

Load the BASIC interpreter in the ArduinoIDE. All you need is the sketch TinybasicArduino/TinybasicArduino.ino. Everything is in one file. Next you need to open the file and set the language capabilities.

And the hardware characteristics at the beginning of the code

Compile and upload to Arduino DUE. Enjoy a fully functional 60kB BASIC home computer with graphics.

The output above was generated by this little program

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号