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.

IchigoJam – Single ARM chip PC with Video and Keyboard support

PC

Everyone who has made their first steps with Apple ][, BBC micro, or Commodore 64 remembers the BASIC language, which nowadays is used by almost no one.

A few days ago, I was directed to an interesting project named IchigoJam BASIC. It was made in Japan and it was about creating a small computer with a BASIC interpreter, made on single LPC1114 Cortex-M0 ARM controller from NXP with only 32KB of Flash and 4KB of RAM.

Ichigo means Strawberry, so this keeps the tradition PCs to be named on fruits.

Although it is built on tiny resources, IchigoJam BASIC has quite an impressive list of commands including I2C read and write!

The schematic is quite simple.

The composite video generation is made via a couple of resistors, and the keyboard is connected with a simple USB-A connector, so with just a few components you have a small personal computer!

And this is not everything, the same hardware has firmware for Javascript called IchigoLatte , for Ruby called IchigoRuby, for IchigoFORTH and here.

On top of this, if you want to try IchigoBASIC you can do it on the web. How cool is that?

Needless to say, I wanted to try this project. I choose our LPC-H1114 board as it has almost everything already pre-soldered.

I had to connect:

for power supply:

LPC-H1114.pin50 – to GND
LPC-H1114.pin49 – PWR to +5V DC

for firmware update:

LPC-H1114.pin46 – to USB-Serial Tx
LPC-H1114.pin47 – to USB-Serial Rx
LPC-H1114.pin4  – to GND

for Videop output

LPC-H1114.pin27 – 470 ohm to video connector
LPC-H1114.pin28 – 100 ohm to video connector

for USB keyboard connector:

LPC-H1114.pin23 – DP
LPC-H1114.pin14 – DM

You can update the firmware using the instructions here.

If you did everything correctly when you apply the power supply you will see on the monitor the text “IchigoJam BASIC 1.4.2 by jig.jp”:

IchigoJam

Then you can use the keyboard to write your program!

You can repeat the project with quick dirty wire connections like I did:

LPC

What you need is a LPC-H1114, a Video RCA jack, a USB connector for the keyboard, a small monitor, a keyboard, and some jumper wires.

This project would be a very good fit for some next Soldering workshop as it has few components but it completes a fully functional BASIC/Ruby/JavaScript/Forth computer.

With the current state of COVID-19 probably TuxCon would be postponed for the Autumn, so there is plenty of time to make a small PCB for soldering 🙂

IchigoBASIC has a button, an LED, plays music on a buzzer and you have access to 4 Digital Inputs and 6 Digital outputs and I2C interface connector.

Too bad most of the educational stuff is in Japanese and needs translation.