History of RetroShield

2020/10/02

Let me tell you why I did RetroShield.

Way back in time

I grew up in 1980’s when 8bit microprocessors were all around. For some reason my dad chose 6502 based Oric Atmos for our first computer instead of the more popular Spectrum ZX. It ended up being agood choise because there were no games for Oric and the only thing I could do was learn how to program in BASIC. I spent hours typing BASIC games and modifying them. If I had Spectrum ZX as some of my other friends did, I would have wasted my time playing games instead.

Youtube - Oric 1 and Oric Atmos

Oric Atmos 01a

I grew up in Adana, Turkey which had (hopefully will continue to have) the Incirlik US Air Base. Our downtown had a couple of stores that traded second-hand products from Incirlik. My dad loved those stores. I was super lucky to have a Simon and Little Professor. I also had two volumes of IC Master catalog. These were the hardcopy version of Digikey or Mouser. I loved reading the microproecssor section. They had everything in there. I knew hardware and software were my future because I was dreaming of intelligent (as in AI) microprocessors, hahahaha :)

Link to online version

IC Master 1983

Discovering 6809

Fast forward to 2000’s, I had my first job in Silicon Valley as an electrical engineer (I can not thank my first boss Hedley enough for this). In my free time, I was building SBC’s with various microprocessors. First w/ 6502, then Z80. Then I discovered 6809E. This was an amazing processor. I was surprised why I haven’t discovered it before. Of course I did a SBC with it immediately.

Simon6809 was born. People who know me can say I enjoy teaching. My goal w/ Simon6809 was to make it very easy for others to try assembly programming. Simon6809 got powered by USB and had a FTDI chip so it needed just a USB cable to function. Monitor code also included an assembler and disassembler onboard. So it was truely a plug and plug 6809 system.

Simon6809

But I got stuck when I wanted to build the next rev Simon6809 Turbo. I wanted to have lots of memory, access to storage (ideally USB or SDCard) and have a small display for embedded uses and maybe VGA + keyboard to be used with a high level OS. It would still have 6809 so I was looking into Flex09 OS. Breadboarding and soldering individual wires was out of the question (been there done that). I ended up designing PCB’s using expresspcb.com. It worked and I was able to boot FLEX09 from RAM disk. But everytime I wanted to modify hardware it was a hassle. I had to plan everything ahead of time and build new boards, solder sockets, etc.

Simon6809turbo

EEPROM Programmer

For Simon6809, I needed an EEPROM programmer. Back in high school I manually programmed EEPROMs (see it here). I wasn’t doing that again. I built myself a small daughercard using FT245 chip (8bit gpio version of FT232 serial) and several shift register IC’s to read/write EEPROM (2864). I ran the code on PC. It was slow but worked. Unfortunately I need to find that board and post a picture here.

Missing EEPROM Programmer

Hmm, why don’t I do the same with a microprocessor? Couple of year later Arduino came out. I designed a Arduino Mega daughtercard that could handle 6502, 6809 and Z80 (3 overlapped 40pin sockets). Routing was painful because the pinouts were backwards, but I did it and it worked. I had Simon6809 running. Hmm, that is interesting. Since it is Arduino, I can use existing Arduino shields to add features. Nice.

RetroShield proto

I was thinking off doing an open source hardware project and that’s where the idea for RetroShield came: microprocessors, programming, educational. Sign me up. I decided to build daughtercards for every microprocessor out there, including 1-bit, 4bit and 8bit, and some of the 16bits.

I also wanted to sell kits because I used to build electronic kits with my dad and they were fun times. We don’t have nice electronic kits anymore. I could also get rich and retire? Hold your horses buddy. Alright it helps fund some portion of the project costs.

In 2019 I had time between jobs. Perfect timing. I could spend time with our new born and also work on this. I spent 5 months designing PCB’s and finalizing Arduino code. Set up the website, gitlab, PCB production, kit packaging, tindie.com, etc. I submitted my project to Hackaday for them to review. One Sunday I woke up to 8~10 orders come in. I was trying to figure out why, then realized the project was featured on their blog.

k6809

How long does it take to do one design?

It takes me about 3~5 months to complete one board. I study the microprocessor, research various monitor codes available. I try to reach the authors to get permissions to use their code. Then I need to figure out the I/O peripherals needed. I start the Arduino code and might even breadboard the processor to confirm I chose the correct signals to connect to Arduino.

Bringup

While I study the documents, I complete the PCB layout. PCB arrives in about a week. I do soldering and go thru the bring-up process: Write the Arduino code. Verify signals and timings with a oscilloscope. Then check the bus transactions. Once everything seems to work, I verify the monitor code functions next - this usually brings out the bugs in I/O handling for keyboard and serial ports. i.e. Arduino might be sending serial too fast for processor to keep up with.

Once everything is functional, I switch to optimization mode. I optimize Arduino code to squeeze every cycle out so the micro can run as fast as possible. I also port the code to my Teensy adapter board in parallel.

Teensy Adaptor

Next comes producing the kits. the critical part is obtaining the microprocessors. I want to keep my prices cheap so that means I can’t spend $20 on a processor as most of them are on ebay. While I study the docs and design the PCB, I look around and try to buy 20~30 chips at a reasonable price. Rare processors rarely sell that many, so this is a good quantity. This is one disadvantage of doing hardware. It requires paying upfront hoping all kits will sell eventually. As big companies figured out, you don’t make money selling hardware. It’s the app store that brings money. Oh well, I will sell the chips back on ebay or donate to other people at some point.

I used to do the SMT soldering at home on a small cooker (I now do SMT in China.):

Home SMT

Why makes it fun?

Well, first of all, I have a simple platform to play with various microprocessors that I didn’t have a chance to play with. Intel 4004, world’s first microprocessor. 1802, micro that is in space. interesting 1-bit micros.

I made a lot of friends from all over the world. I will admit, there are countries I didn’t know they existed. Feedback has been generally positive. People enjoy how easy it is to play with a microprocessor. Some try writing their own assembly code or modify Arduino to add new “hardware features”. Some buy one and then come back to order rest of the RetroShields. I think RetroShields helped many enthusiasts spend fun times during the covid-19 days.

I do have constructive feedback. Major one is some countries charge customs fees that are close to the cost of RetroShield itself. Then there is the documentation aspect. I know documentation can better. I working on it - planning to record Youtube sessions. Stay tuned.

One of the highlights for me was bringing up Commodore 64 code on RetroShield. The night VCF2019 was over, I emailed Michael Steil (whom I found randomly on the internet) and asked him if he would be interested to port C64 basic to RetroShield 6502. He emailed back in an hour, saying he was actually in silicon valley visiting the VCF and he saw my project. He said he has a few days before he flies back to Germany and offered to get together. We met around 5pm, got pizza and worked until 4am and got commodore 64 basic running on RetroShield. Michael knows the C64 ROM’s inside out. We added our small “special custom ROM” to get colors and cursors working thru VT100 emulation. If you look at the Arduino code, you’ll see how easy it was to modify ROM’s. I then brough the Arduino VGA+keyboard shield and we got a stand-alone C64 too.

C64 VGA PS2

We didn’t bother getting setting the background to blue.

C64 VGA PS2

With another friend at Google, we got RetroShield working on his Android phone:

RetroShield on Arduino

What’s next?

Well, keep working on the remaining microprocessor list. Just got intel 4004 done. I am one of the few lucky people who have programmed world’s first microprocessor!

Then I am thinking of putting together a microprocessor class for a university or summer camp for kids. They can learn soldering, Arduino programming, machine code, and validation using oscilloscope. I’m working on a syllabus and will contact a few professors to see if we can do a pilot class.

That’s quick recap of my RetroShield project. I love microprocessors and this project enabled me to learn microprocessors and meet new people.

So keep’em running.

Erturk Kocalar

Teddy