Arduino TV Out has been around for a while, but you can't get many characters on the screen and uses a lot of the Arduino's resource. This is a library which will let you generate an 80x25 text screen on a TV or monitor from an Ardiuno. Well I say from an Arduino, it's more like two Arduinos, or to be precise, an Arduino and a second ATMega328P as a video processor, and one additional TTL chip.
Grant Searles Monitor and Keyboard interface, itself an update of code by Daryl Rictor (40x25 display using an ATmega8). The code in the second chip is unmodified from Grant's (download from his page above). I've completely rewritten the Arduino code, now in the form of a library to make it easier to use.
Shift Register --> Char Data
Arduino <==> Video Processor + ==> Video
The idea is basically this, the Arduino (the first ATMega328P) has an 8 bit output port and two control lines. This interfaces to the video processor (the second ATMega328P). This has an 8 bit output port and 1 control line which is fed to a 74LS165 or 74HCT166 shift register (the pinouts are different, but they can both provide the necessary functionality, you may have more luck finding the 165) [Update: the 166 is preferable, and the HCT version should be used if possible]. The output of the shift register is the character video output data. There is also a composite sync is output from video processor. The composite sync and video data are combined via two resistors and this forms the composite video output. This composite video output is suitable to drive a modern LCD TV or an old CRT TV or monitor.
USBTiny ISP to program in circuit, or use the Ardunio as an ISP.
Arduino as ISP demo (leave some space for the 74LS165). Here is an excellent tutorial on Arduino as ISP, and more info on avrdude.
- avrdude -P COM3 -b 19200 -c avrisp -p m328p -n
- avrdude -P COM3 -b 19200 -c avrisp -p m328p -U lfuse:w:0xe6:m
- avrdude -P COM3 -b 19200 -c avrisp -p m328p -U hfuse:w:0xd9:m
- avrdude -P COM3 -b 19200 -c avrisp -p m328p -U efuse:w:0xff:m
- avrdude -P COM3 -b 19200 -c avrisp -p m328p -U flash:w:SBCVideo.hex
Once the video processor is programmed, wire it up as per the circuit diagram. The pins on the video processor should remain the same (unless you want to modify the source). The pins on the Arduino end can be any. I chose the nearest ones. The only exception was choosing digital pin 13 as the Ack pin. This just shows activity on the LED on the Arduino for diagnostic purposes. The pin connections are:
- Video Data In 0: Arduino D12 - ATMega328P pin 15
- Video Data In 1: Arduino D11 - ATMega328P pin 16
- Video Data In 2: Arduino D10 - ATMega328P pin 17
- Video Data In 3: Arduino D9 - ATMega328P pin 18
- Video Data In 4: Arduino D8 - ATMega328P pin 19
- Video Data In 5: Arduino D7 - ATMega328P pin 23
- Video Data In 6: Arduino D6 - ATMega328P pin 24
- Video Data In 7: Arduino D5 - ATMega328P pin 25
- Video Available: Arduino D4 - ATMega328P pin 26
- Video Ack: Arduino D13 - ATMega328P pin 27
- Reset: Arduino Reset - ATMega328P pin 1
- 16 MHz Crystal to ATMega328P pins 9 and 10
- 22pf capacitors from ATMega328P pins 9 and 10 to GND
- Video Data Out 0: ATMega328P pin 2 - 74LS165 pin 11
- Video Data Out 1: ATMega328P pin 3 - 74LS165 pin 12
- Video Data Out 2: ATMega328P pin 4 - 74LS165 pin 13
- Video Data Out 3: ATMega328P pin 5 - 74LS165 pin 14
- Video Data Out 4: ATMega328P pin 6 - 74LS165 pin 3
- Video Data Out 5: ATMega328P pin 11 - 74LS165 pin 4
- Video Data Out 6: ATMega328P pin 12 - 74LS165 pin 5
- Video Data Out 7: ATMega328P pin 13 - 74LS165 pin 6
- Shift Register Load: ATMega328P pin 28 - 74LS165 pin 1
- Shift Register Clock 1: ATMega328P pin 10 - 74LS165 pin 2
- Shift Register Clock 2: GND - Shift Register pin 15
- Shift Register Serial Load: GND - Shift Register 10
- Composite Sync Out: ATMega328P pin 14 via 1K to Composite Video Out
- Video Out: 74LS165 pin 9 via 470R resistor to Composite Video Out
The breadboard wiring is as follows:
Terminal library, unzip it and copy the 'terminal' folder into the library folder in your Arduino workspace. You should then be able to include the terminal.h file in your projects.