ZX-ESPectrum emulator tested with ESP32-SBC-FabGL, The Mensch computer with W65C256 got VGA display and Keyboard

https://github.com/EremusOne/ZX-ESPectrum-IDF is the next repository we try with ESP32-SBC-FabGL.

At first it didn’t build but after Twitter consultation the problem appear with PlatformIO which was searching for obsolete version of ESP32 tools, after adding one line in platformio.ini

[env]
platform_packages = toolchain-riscv32-esp @ 8.4.0+2021r2-patch5

the project compiled and show on the screen, there are still some annoying things like menus not working well and no programs in the slots, but I stopped spending time on it 🙂 a little bit more documentation would be helpful though!

Many people asked when W65C265 computer like AgonLight2 will be available and I reply that even now such computer is available: The Mensch W65C265 computer is available at Mouser for EUR 18!

Today I wired Mensch to ESP32-SBC-FabGL access bus following this schematic:

AccessBus.pin1 +5V to Mensch.J5.pin.3
AccessBus.pin3 GND to Mensch.J5.pin.1
AccessBus.pin5 (TX) to Mensch.J5.pin4 (RX)
AccessBus.pin6 (RX) in series with 220 ohm resistor to Mensch.J5.pin5 (TX)

The 220 ohm resistor is necessary as current limiter as Mensch is working on 5V while ESP32 on 3.3V

ESP32-SBC-FabGL is running the standard FabGL ANSI Termainal example with small modification. Mensch sends only CR but not LF. So the FabGL code should be changed when see CR on Serial port to send CR+LF to the terminal. In serialport.cpp this should be add:

void SerialPortTerminalConnector::rxCallback(void * args, uint8_t value, bool fromISR)
{
  auto obj = (SerialPortTerminalConnector *) args;
  if (obj->m_serialPortRXEnabled) {
    obj->m_terminal->write(value, fromISR);
    if (value == 13)
           obj->m_terminal->write(10, false);
  }
}

and we are set 🙂 now Mensch have VGA display and PS2 keyboard!

New Open Source Hardware design is verified: ESP32-SBC-FabGL single board computer based on FabGL library with PS2 keyboard, mouse and VGA display with many retro computer emulators

I learned about the FabGL library when we started manufacturing AgonLight2. The ESP32 was used as a graphics, sound, and IO keyboard co-processor for Bernardo’s Z80 design.

Upon checking the library, I discovered that the author, Fabrizio Di Vittorio, had already created several emulators for Altair8080, VIC20, and even old DOS PCs!

This is how the idea for ESP32-SBC-FabGL was born. I wanted to create a board that could be used as a graphics/sound/IO co-processor for other retro computers based on different processors.

Here is the ESP32-SBC-FabGL layout 105 x 65 mm board:

ESP32-SBC-FabGL uses ESP32-WROVER with 4MB Flash and 8MB PSRAM.

As you may guess, this will be very convenient platform to create Retro Computers based on same principle as AgonLight2, so some Retro Computers based on this platform will follow, but do not ask when 😉

The Access bus will provide interface to retro processors hats for Graphics, Sound, Keyboard and Mouse.

The LCD hat will allow handheld Game consoles to be created easily.

The LiPo battery charger and connector provide stand alone operation without USB connection.

Today we build the first prototypes and they work as expected.

All FabGL demos works!

Altair8080 with CP/M:

IBM-PC with DOS:

It was quite blast from the past to see Turbo Pascal 3.0 running

Boy it took me a while to remember how to quit the editor 🙂

ESP32-SBC-FabGL will be ready for sale in June.

We will put it on the web with pre-order state this week.

The price will be EUR 15.00.

In this price is included royalties for the Author of FabGL, so by buying this board you will support Fabrizio and his further developments.

Tsvetan

AgonLight Weekend Programming Challenge – ISSUE 2

What is WPC?

It’s a small coding challenge that you have to solve in two days during the weekend.

Who can participate?

Anyone can participate except Olimex employees. You can submit the solutions under your name or anonymously under an alias name.

What are the rules?

The code must run on AgonLight. There are no restriction how you will code your solution: Assembler, Forth, C, BBC Basic, Turbo Pascal for CP/M any tool is possible. If your tool need special installation you should provide brief note how to do it so we can verify your solution.
There is no restriction to re-use code found on internet and adopt it for AgonLight2 as far the code is working and doing the job!
The solutions should be sent to info at olimex dot com. You will receive notification email that the solution is received.

On Monday, we will push all solutions received to a special GitHub repository and announce the winner on Tuesday, who will receive a €50 voucher to use in the Olimex web shop. The jury will consist of Tsvetan Usunov and Bernardo Kastrup.

So z80 retro ninja coders here is the second challenge for you!

Make Flappy Bird game for AgonLight during this weekend!

https://en.wikipedia.org/wiki/Flappy_Bird

According to the Author it took him one weekend to write it 😉

Good Luck!

UPDATE 08-05-2023

With only one single submission we have the ultimate winner LuzrBum:

https://github.com/OLIMEX/AgonLight-WPC/tree/main/ISSUE-2

Neo6502- Open Source Hardware Modern Retro Computer Project

I will admit, I have a sentiment for retro computers. This is probably because my career in IT started many years ago with the Bulgarian Apple ][ clone called IMKO2, later renamed to Pravetz 82.

This is also one of the reasons Olimex stepped into the AgonLight production.

AgonLight sparked a lot of enthusiasm and activity, not only here at Olimex. Bernardo Kastrup hit the sweet spot of the Retro Computer maniacs by offering them a small, fast, feature-packed real Z80 machine with plenty of memory. The Facebook group already has close to 1000 members!

There are a lot of posts about why not having a 6502-based machine, and Kyle (mos_8502), Rebecca (RenewedRebecca) and Bernardo (TheByteAttic) are already working on a W65C265 version using the same ESP32 FabGL-based video and audio system.

Two weeks ago, I started thinking, as an engineering challenge, is it possible to build a modern peripheral 6502 computer that is with the lowest possible cost.

Then I put the minimal requirements for my 6502 computer:

  • It must have a real 6502 processor.
  • It must have a minimum of 64KB of RAM.
  • This computer must run as fast as possible. People confirm that the W65C02 from WDC can be overclocked up to 16Mhz. On the other hand, a lot of software depends on instruction execution time for loops, so the possibility to run at a lower 1Mhz clock will ensure backward software compatibility. This can be achieved with a variable clock that can be set by 6502 software.
  • The computer must have a modern video interface like DVI/HDMI so that you can connect it to your home TV or modern monitor.
  • Support for a modern USB keyboard.
  • A sound synthesizer like the popular C64 SID.
  • The power supply should be via a USB-C connector so that you can use any phone charger with a USB-C cable.
  • A UEXT connector with modern interfaces like UART, I2C, SPI.
  • Disk storage for code.
  • The 6502 bus should be available on a slot/connector so that additional hardware can be easily added on.

The final requirement is to design such a system to be at the lowest possible price, making it an easy purchase decision, similar to what the Raspberry Pi did with a price of $25-30.

This is a good hardware engineering challenge!

After some research I have decided to use the Raspberry Pi’s new dual-core Cortex-M0 RP2040 as an emulator for everything except the 6502.

The RP2040 will emulate:

  • The RAM memory. The RP2040 has 264KB of RAM, which is plenty of RAM to hold the emulator code and at least 64KB for the 6502. As the RP2040 runs at 133 MHz, there will be no issue serving the slow 6502 with memory read/write operations. If there is more RAM left, we can implement some kind of bank switching, such as 56KB of continuous RAM from $2000-FFFF and switchable RAM banks for $0000-1FFFF. Alternatively, we can define a pointer and block size somewhere in the upper memory location, which can overlap different RAM segments at any address at any time. After all, what the RP2040 will serve at a given address depends only on the pointer, which will show where this data needs to be fetched from.
  • Initially, I thought of using the Si5153 programmable oscillator, which can clock from 250kHz up to 100MHz, but after checking the RP2040 PWM specs, I found that the RP2040 can also generate a programmable clock for the 6502 from 0 up to 100MHz. This saves us one more IC!
  • There is already a DVI generation project with RP2040 called picoDVI, which supports 640×480 pixel resolution with RGB565 16-bit color depth. This project loads about 60% of one of the cores in RP2040.
  • RP2040 has USB host capability, so there are no issues whatsoever in connecting a USB keyboard to it.
  • There are already RP2040 SID player projects that exist and can be reused for sound generation, such as picoSID.
  • Although the UART, I2C, and SPI are interfaces that the 6502 originally did not have, we can catch memory location read/write exceptions with RP2040 and emulate a classic PIA or ACIA. Alternatively, we can define some API in memory to access I2C and SPI buffers.
  • As for disk storage, RP2040 will have 2MB of external SPI flash to hold the firmware, but there will be a lot of free space. The Apple ][ 5″ floppy was holding the humble 114KB, so around 10 classic floppy discs could fit in a little more than 1MB.

One week ago, I posted my idea on the Homebrew 6502 Facebook group and received more than 100 replies with valuable comments and suggestions.

To summarize all the feedback and prevent redundant discussions, here are the FAQ:

Q: Why not emulate the 6502 with RP2040 as well?
A: Emulating memory or ACIA PIA is simple, but the 6502 is a complex state machine, and an emulator will never be 100% accurate. Even N6502 and W65C02 have differences, and we want to have a REAL processor.

Q: Have you checked the CommanderX16 project? You may get inspiration from it.
A: I have seen this project, but it is over-complicated, expensive, lacks modern peripherals, and is slower compared to what I want to achieve. This is going to be a MODERN 6502 computer. The CommanderX16 has no modern interfaces like USB keyboard, HDMI, SID Sound, or SPI/I2C. Additionally, the CommanderX16 costs $500, while we aim to target a $25-30 board.

Q: Why not make it with VGA? I have one in the basement.
A: We want Neo6502 to be a MODERN computer, and VGA is 40 years old technology.

Q: Why not use W65C265S or W65C816S, etc.?
A: These are not 8-bit and have more address lines to deal with, which will make the design more complex and far from the rock bottom price goal. For those who want a W65C625 computer, Kyle, Becky and Bernardo are already working on Agon X65.

Q: Why not Kickstart it?
A: Although Kickstarter is a great advertising platform, it has its cost. Kickstarter/PayPal combination takes 20-30% of the collected funds. We target rock bottom costs for our customers and count every cent, so we will not inflate the prices with 20-30% to use the platform.

Q: Do you have firmware developers for it?
A: Not yet, so any help and collaboration are welcome. I have already obtained all the parts together and will have a proof of concept on a breadboard this weekend. Then, we will design PCB and some prototypes in a few weeks. If you want to participate in software/firmware development for both RP2040 and 6502, you are welcome to join us! We will have some free early prototypes to send to developers. Send us email to info at olimex dot com.

Tsvetan

AgonLight2 update: embedded Hello world in BBC basic

AgonLight2 is Z80 based retro computer running BBC Basic.

The first thing you do with embedded computer is to run the Hello World equivalent i.e. to blink LED.

AgonLight2 has 34 pin GPIO connector:

In this GPIO-1 connector we can see many different signals are coming both from Z80 and ESP32-D4 . In this demo we decide to connect LED to pin 17 which is GPIO_PC0 signal of ez80F92 processor.

I use Breadboard and some Jumper wires Female-Male to connect the LED anode (+) to GPIO-1.pin17 the LED cathode (-) is connected to 4.7 k OHM which then is connected to GPIO-1.pin3 GND.

With the above setup if PC0 is set high the LED with light ON. When the PC0 is set LOW the LED will go OFF.

So how do we access PC0 in BBC BASIC?

I admit I come from AppleSoft Basic so Z80 BBC Baisc is new for me.

Fortunately Quark Firmware is on GitHub so I can check the sources.

In BBCBasic.txt I nottice commands to access directly Z80 memory, these are GET and PUT commands.

In ez80F92 datasheet I read that GPIO ports are accessed through 4 registers:

PC_DR – data register at address 09E hex /158 dec an 8 bit register where every bit corresponds to port bit i.e. if I want to write in PC0 I have to modify bit0

PC_DDR – data direction register at address 09F hex / 159 dec and 8 bit register where every bit corresponds to port bit direction 1 means Input, 0 means output

I quickly check:

PRINT GET(159)

returns 255 i.e. all ports C are inputs by default

I change PC to output with the PUT command

PUT 159,254

then make PC0 HIGH with the command:

PUT 158,1

LED lights ON:

Yay!

PUT 158,0

command switch LED off:

Now we only have to put some delay between the ON OFF commands.

I search for delay in Quark sources without success when I nottice that INKEY command scans for keystroke pressed for some time and returns -1 if not suceed.

Let’s check if INKEY can be used as delay 🙂

PRINT INKEY 1000

prints -1 after about 1 second, great then our fill code becomes like this:

the code runs and the LED slowly blinks as on the video clip above!

AgonLight2 now is officially certified by OSHWA as Open Source Hardware

AgonLight2 now is officially listed on OSHWA.org directory as true Open Source Hardware project.

AgonLight Open Source Hardware Retro Computer Running BBC Basic was captured in KiCad and updated by Olimex

AgonLight is a well-documented small computer based on the Z80 family and running BBC BASIC.

With a VGA output and a PS2 Keyboard this is a stand alone retro style computer.

The project is open source hardware and software.

AgonLight may be also seen as an embedded BASIC computer as it has plenty of GPIOs available to interact with other components and modules.

The AgonLight was designed by Bernardo Kastrup and the Quark firmware is developed by Dean Belfield.

The project has an active Facebook group https://www.facebook.com/groups/agoncomputer/

We got a few inquiries from customers asking if Olimex is interested in making this project and we hesitated at first due to having the bad experience in the past with Maximite pseudo open source project.

After exchanging a few words with Bernardo via Twitter, we became confident that this is a true open source hardware project.

We checked the schematic and decided to do some small changes.

  • We decided to re-capture the design in KiCad instead of EasyEDA
  • The power of the original AgonLight is delivered by a USB-A connector which is quite odd and USB-A to USB-A cables are less popular. We decided to replace it with USB-C connector which is used in all new phones, tablets and devices due to the new EU directive. Usually everyone has such a cable at home to charge and transfer files to their cell phone.
  • We replaced the Linear voltage regulator with DCDC which delivers up to 2A current.
  • We added a battery LiPo charger and step-up converter which allows operations even if external power supply is interrupted.
  • The original design had a PS2 connector for a keyboard and required a USB to PS2 adapter to operate with the more available USB keyboards. We replaced the PS2 connector with a USB-A connector so a normal USB keyboard (which supports PS2) can be directly plugged-in to AgonLight
  • We routed the AS7C34096A-10TCTR SRAM with 40 ohm impedance lines as per the datasheet
  • Fixed a wrong signal naming in the ESP32-PICO-D4, which now is updated in the original AgonLight documentation.
  • Replaced the bare header 32-pin connector with a plastic boxed 34-pin connector following the same layout and adding two additional signals Vbat and Vin which allow AgonLight to be powered by this connector too.
  • Added a UEXT connector (https://www.olimex.com/Products/Modules/) which allows AgonLight to be connected to: temperature sensors, environmental air quality sensors, pressure, humidity, gyroscope, light, RS485, LCDs, LED matrix, relays, Bluettooth, Zigbee, Lora, GSM, RFID reader, GPS, Pulse, EKG, RTC etc.

We changed most of the components to our component base, which we source and stock in large quantities and allow us to bring the cost down.

The design was completed 1 week ago:

Today the first blank PCBs arrived:

Next week we will assemble 5 pcs to test by ourselves and then send to the original AgonLight developers.


AgonLight will be put on our web and available for pre-order next week with a special Christmas price of EUR 50 for a completely assembled, programmed and tested computer.


If the prottotypes are good mass production will follow and all pre-orders taken to 23.12.2022 will be shipped by the end of January.

We plan to make metal case and other accessories in the near future.

TUXCON FOSS and OSHW conference 2018 in Plovdiv is just 18 days away, so plan your visit properly ;)

15241999_541171392758646_9152584434294422876_n

TuxCon 2018 conference about Free Open Source Software and Open Source Hardware will be June 9 and 10th in Plovdiv.

This is community driven event done by volunteers with the support of local IT companies and it’s totally free to participate.

In Saturday 9th of June in the Technical University building there will be two rooms, for lectures and workshops.

Hacking Risc-V core, implemented on iCE40 FPGA and playing with it’s instruction set and making small “monitor” program which allow you to enter programs written on machine code and executed on iCE40HX8K-EVB + iCE40-IO will be demonstrated, so if you want to touch and make your first program on RISC-V “computer” with VGA monitor and keyboard you may find Rangel Ivanov lecture interesting.

Plamen Vaisolov is retro computer maniac and keep working on them, implementing modern floppy disk emulators and other peripherials. He will share his experience with all these who miss Karateka and Load Runner 🙂

Neven Boyanov will talk about his experience with LoRA network and how to start on low budged.

Dimitar Gamishev has two interesting talks, one is for the Open Source Hardware and Software GPS car navigation he made. In the  second he will speak about the home assistants like Google Home and Alexa, how to implement them with small Linux computer like OLinuXino and even with ESP32-Lyra and how to impress your girlfriend by switching on and off appliances and lights with your voice.

There will be KiCAD workshop where everyone (even with no knowledge) will learn how to install, configure and make small robot PCB with KiCAD. Then some general knowledges about PCB materials and how to prepare all files and send to PCB board house for manufacturing. How to select the components, footprints, good routing practices, DRC/ERC checks, Gerber generation and tips how to design your PCBs in way to be produced at lower cost. At the workshop will be our design engineers and you can talk to them directly about issues you encountered when worked with KiCAD or other CAD product.

 

In Sunday 10th of June we will have traditional Soldering workshop at Olimex training building, where we will assembly and program with Arduino small robot which can follow line or escape from labyrinth. This will be the same robot which PCB we will design in the KiCAD workshop in the previous day. We will go detailed through the program and study how modifications affect it.

The workshop with end with barbeque in Olimex backyard 🙂

 

We are looking forward to see you in Plovdiv soon!

Apollo Guidance Computer which landed Apollo 11 at moon code is on GitHub

agc_view

AGC was digital computer for navigation and control of Apollo-11 spacecraft. It’s processor was made with discrete IC logic and 16-bit word running at 2 Mhz with 2K words of RAM and 36K words of ROM.

Recently the code which runs on AGC was published on GitHub based on manual re-entering of scanned papers. The sources are dated from April 1st 1969.

The retro computer lovers will be able to run the code on the Virtual AGC.

Even if you do not like retro computing, there is still something to learn when you look how the source code is documented.

 

TuxCon 2016 highlights – two days fun with open source hardware and software

tuxcon

TuxCon free and open source software and hardware conference was last weekend in Plovdiv.

This is local, small conference which once per year gather enthusiasts and people who love open technologies at one place.

The event started on July 9th at 11 o’clock with Trayan who spoke about Java Robotics or how do you program Lego Mindstorm in Java:

trayan

then Yassen spoke about the future of Jitsi Meet

jitsi

Damyan followed with serious topic explaining how different Linux distributions deal with security updates in a quite a funny way involving such a famous Bulgarian folk singer like Mr. Milko Kalaydjiev in Linux Matter (the video will worth watching).

milko2

Roland who come from Cambridge, UK specially for TuxCon presented us his ideas about the future of the education:

roland

Then we had lunch break with sandwitches and the famous TuxCon cookies:

cookies

After the lunch was one of the most anticipated talk this year: about the Retro Computer Puldin.

Puldin is local Plovdiv pride, the only computer designed from scratch in Bulgaria both hardware and software. On TuxCon 2015 we invited people who designed the hardware to talk, this year we invited the software developer teams. Mr. Nedialko Todorov who was director for this project talk about how the idea to make Puldin come and how it was realized.

puldin1

Puldin design started in 1988 at that time already IBM-PC was on the market with 8088 processor from Intel working at the lighting speed 4.77Mhz. The developers decided to make the new computer software compatible with IBM-PC, so files from IBM-PC disk can be read/written and cross-compiled. At that time all electronic developments should have used Bulgarian electronic components so they choose CM601 which was copy of Motorola 6800 – 8-bit processor.

They made their own BIOS, DOS, Pascal compiler, BASIC, text editor same as famous PE2 (all this written in assembler!).

orlin

Orlin Shopov who leaded the software development team at that time shared that they had to fit everything in 16KB of ROM memory and at the end they had no single byte free!

The result was that the BASIC code on Puldin (with 6800 @1Mhz) was running faster than same code written on IBM-PC (8088 @4.77Mhz).

The BASIC interpreter of Puldin was written by Todor Todorov more famous with the Eddie viruses he wrote later (a.k.a. Dark Avenger).

For this talk four members of the team come together:

puldin

From Left to Right: Dimitar Georgiev, Ivo Nenov, Nedialko Todorov, Orlin Shopov

Puldin computers were at TuxCon also:

comp

people could see what is inside:

inside1

or take autograph from the developers on the old user manuals 🙂

user

The next talk was no less interesting. Edmund come from Vienna to talk about FOSS tools used in FPGAs:

edmund

He explained why we also need open source IPs. The FPGA vendors offer IP blobs which are “free” to use, but they are huge and you actually pay them in the price of the bigger FPGAs you buy to use them. Good example was for HDMI IP which FPGA vendor give away for free but use many different modes and resolutions which you may not need but have to use. Open Source HDMI design tailored to your needs may fit in 10 times less resources.

In next lecture Lubomir talked how he is attempting to create 3D model based on 2D pictures taken with his phone, quite interesting topic and interesting results:

lubo

Then Dimitar show us how to build custom Android images:

mitko

Delian has announced to talk for OpenSCAD but instead of this he talked about his dream to move the manufacturing from China back to Bulgaria 🙂 and to do manufacture on demand with new technologies like 3D printers, DIY assembly machines.

delian

In the next talk George was talking for creating web sites with open source technology, he dedicated his talk to Ian Murdock

george

Stoyan shared in the next talk his experience with setting up corporate servers. He wanted to bet that in 90% of the public administration running Microsoft server solutions are set to default configuration with no cache enabled etc etc which effectively kills more than half of the performance potential hardware has. Anyone want to contest his statement?

stoyan

The first day closed with Lighting talks and interesting Quiz.

light

Day 2 continued in Olimex training building. We have just 50 seats there but around 70 people come 🙂

d2

Fortunately Dimitar Gamishev has bring 10 meter radio antenna with some Radio sniffer, so some people were there and enjoying listen to space stations communication and local police which obviously do not care to encrypt their channels 🙂

radio

 

ant

meantime Trayan made practical workshop how Lego robot is programming

day2

Peter present our attempt to make Robotic arm programmable with JavaScript

robko

Then we learn how to program FPGAs with our new ICE40 boards:

fpga

and we finished with the status of our DIY laptop:

lap

laptop

Special thanks to TuxCon organizers, sponsors and all people who come and were part of this wonderful event!

Previous Older Entries