Posted on Leave a comment

Arduino boards / AVR chips

arduino Uno

I also sell Arduino boards like the Arduino Nano, Arduino Uno and several AVR based chips in mu webshop and although they are strictly not retro, they are used in a lot of Retro replicas, retroshields and chip testers. I build a lot of chip testers based on an Arduino board and I also have some PCB’s for these in my webshop. On this page I will tell you a little more about these AVR chips.  AVR is a family of microcontrollers developed since 1996 by Atmel and acquired by Microchip Technology in 2016. The AVR chips are modified Harvard architecture 8-bit RISC single-chip microcontrollers and they were one of the first microcontroller families to use on-chip flash memory for program storage.

The AVR architecture was conceived by two students at the Norwegian Institute of Technology (NTH) named Alf-Egil Bogen and Vegard Wollan.  Atmel says that the name AVR is not an acronym but it is commonly accepted that AVR stands for Alf and Vegard’s RISC processor. One of the first chips of the AVR line was the AT90S8515 and the processors got a big boost when the Arduino platform was released in 2005 and featured the ATmega8 AVR microcontrollers.

The Arduino based boards (but also the individual chips using SPI) can be easily programmed in assembler and the ‘C’ and ‘C++’ language and there are a lot of ready to use libraries for different devices and communication protocols.. The fact that (most of ) these chips use 5V power supply makes them also interesting to use in combination with old hardware and old chips. They are often used as a boot device and serial controller in several designs like the Z80 MBC and the Apple1 replica.

atmega32
atmega32

The ATMega32 is a high-performance, low-power Microchip 8-bit AVR® RISC-based microcontroller that combines 32 KB ISP flash memory with 1 KB EEPROM, 2 KB SRAM, 54/69 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, an 8-channel 10-bit A/D converter, programmable watchdog timer with internal oscillator, SPI serial port, and five software selectable power saving modes. The device operates between 1.8-5.5 volts.  This makes it suitable as external rom for boot and serial and I/O device for retro microprocessors like the Z80. The ATMega32 is used in a lot of MBC (Minimal Computer Board) designs like the Z80 MBC.

arduino mega 8031
arduino mega 8031

The Arduino Mega is a big Arduino board based on the ATmega2560. It has 256 KB of Flash Memory ( 8 KB used by bootloader), 8 KB Sram and 4 KB Eeprom, 54 digital input/output pins, 16 analog inputs, 4 UARTs (hardware serial ports) and a 16 MHz crystal oscillator. This makes it perfect to emulate Rom / Ram and I/O for a lot of old 8bit microprocessors. There are a lot of so called Retroshields for a wide verity of 8 bit processors like the Z80, the 6502, the 1802, the 2605 and 68xx processors. Sometimes even a small system using basic or emulation of an old computer is available in open source.

nano_with_pins
nano_with_pins

The Ardiono Uno and the Arduino Nano are often used as basic boards for chip testers, ISP programmers and f.i. as serial interface on a Retro computer where these boards replace a lot of glue logic. On the Apple1 replica the Arduino Nano replaces the terminal interface emulating the keyboard and the CRT interface. I also sell a dram tester based on Arduino Uno or Arduino Nano boards.

AY-3-8910 sound board
AY-3-8910 sound board

In retro designs the AVR chips are very handy to replace a lot of glue logic and I/O devices, because the AVR chips and boards support SPI they can easily interface to cheap SD card disk drives and realtime clock boards. So even if these chips are not retro themselves, the are often used in combination with Retro computers.

Have fun, regards, Hein Pragt.

Posted on Leave a comment

Atmega328 retro board

atmega328

Sometimes you have a project that you started and did not finish that keeps staring you in the eye every time you enter your shack. This was one of mine, I was planning to build a copy of the famous MPF1 board, but after soldering the keys and the displays, it stopped. After a while the urge of building a copy of the MPF1 faded and the board was laying on my desk. Then I thought about creating an ATMega328 based universal retro board that I could use to emulate f.i. a KIM1 or even a MPF1. The problem was the amount of I/O pins an ATMega328 has when using an external oscillator. But with some deep thinking and some clever design I managed to fit it all on one ATMega328 and keeping the RX/TX pins free for serial communication for debugging messages. This is the design I came up with.

I use two common cathode seven segment X 4 displays and I driver them using an ULN2803 that contains 8 Darlington transistor circuits. The outputs drive the displays (active to ground) but also the scanlines of the keyboard.  As I wanted nine rows (MPF1) I had to use a clever trick, there is a 9e state and that is “all off”. By connecting the last row to the ground I can read these pins if all scanlines are inactive. The last button is hardwired to the reset pin. Furthermore the design is very straightforward, the TX line is used as an output for a scanline so it can be used as serial out at the same time. Only the first display will light up a little extra. The RX pin is left free so this can also be used.

The design is made in a way that the ATMega328 chip can be easily replaced with an Arduino Uno, that makes development very easy as you can download the sketch from the IDE and monitor using the terminal of the IDE. When all is working fine, just program the code in an ATMega328 and put the chip in place. Here I have a zip file with the basic test code to see if the hardware is working and an example of the keyboard and display drivers code.

When everything was working I took the sourcecode of the KIMUNO project and cleaned up the code and added my own keyboard and display drivers. This took me a while because the code was a little unclear sometimes. I reformatted / restuctured the code, deleted some unused code and added comment. After a few evening the KIM1 clone was working on my hardware. At the end of the page I included my full sourcecode of the project. And after putting the code inside a standalone ATMega328, this was the result. A working KIM1 emulator.

I hope I have inspired someone to build this and even add more features or other emulations. I still want to write a full MPF1 emulation for this board, but that is one of the future plans.

Sourecode KIM1 ATMega328

Have fun, regards, Hein Pragt.

Posted on Leave a comment

Arduino Uno ATMega328 pins

atmega328

The Arduino Uno is not a very Retro style board but it is one of the boards that made microcontrollers available for the main public with a simple and free IDE and opensource hardware. I like using the AVR chips and nowadays a lot new designs of old retro computers contain an AVR chip to replace al lot of glue logic chips. There are even complete emulations of old system available on AVR chips and f.i. de KIM-Uno is a complete emulation of the very old KIM computer board on an Arduino Uno.

AVR is a family of microcontrollers developed since 1996 by Atmel and these are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families to use on-chip flash memory for program storage. The AVR architecture was conceived by two students at the Norwegian Institute of Technology (NTH) Alf-Egil Bogen and Vegard Wollan. Atmel says that the name AVR is not an acronym and does not stand for anything in particular. However, it is commonly accepted that AVR stands for Alf and Vegard’s RISC processor. The AVR 8-bit microcontroller architecture was introduced in 1997.

In 2009 the team that would become Arduino was formed with the idea of an accessible, affordable electronics development platform. This would eventually give birth to the Arduino UNO. That cheap little board went all over the world and one of oy successors was the Arduino Nano, that us internally the same but has a much smaller size. It isvery easy to use the ATMega328 (DIL version 28 pins) in an electronic design as standalone microcontroller and because it has build in flash and sram memory, 20 I/O pins and a lot of internal peripherals (like a build in UART) it can be used in all kinds of remakes of old computer designs.

When I develop I like to use an UNO or Nano as a drop in for the ATMega328 chip, here is the mapping of the Arduino Uno to the ATMega328 pins.

The same for the Arduino Nano, this board has the 32 pins atmega328 chip.

Have fun, regards, Hein Pragt.