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.

 

Duinomite MINI, MEGA and eMEGA back in stock

DuinoMite-Mega

Duinomite-MINI, MEGA, eMEGA boards were made specially to run BASIC on PIC32 processors, but are well packed with features boards, so people were using them not only with BASIC interpreter but also programming them in C.

There were not high runners, so at one point we were selling just few per month and when the blank boards were out of stock we had hesitated if to run them again or not, with the time lot of people signed for notification when back in stock so we decided to run small batch of all these three and re-stock.

Now we got them back in stock.

MPIDE Arduino like IDE for PIC32-Pinguino and Duinomite boards

Image

With this tutorial video below we will show you how to setup MPIDE Arduino like IDE to work with PIC32-PINGUINO, PIC32-PINGUINO-OTG, PIC32-PINGUINO-MICRO, DUINOMITE, DUINOMITE-MINI, DUINOMITE-MEGA, DUINOMITE-eMEGA.

Here is video tutorial how to install MPIDE and add support for Pinguino and Duinomite boards:

MPIDE installation is also described in our Wiki

Why to use MPIDE?

It’s an alternative to Pinguino IDE and Duinomite Basic. You have one more option to use these boards.

Pinguino IDE  ( pinguino.cc ) was made as parallel project to Arduino but for PIC microcontrollers, instead of Java it uses Python for the IDE, with the latest Oracle – Google lawsuit we still wonder if Java was the best choice for Arduino IDE, but nevertheless Arduino was made earlier and managed to attract huge community. Pinguino community is still small and the demo codes for Pinguino are not so many as for Arduino.

Microchip and Digilent financed the release of MPIDE which is pure Arduino IDE fork and thus more familiar for the Arduino community to use. As MPIDE already have good PIC32 support it was very easy to add support for PIC32-Pinguino and Duinomite there.

Why to use MPIDE and C for Duinomite?

Duinomite boards are low cost but powerful boards initially made specially for project named Maximite.
Two years ago we found interesting project which makes Basic computer with just PIC32 processor.
I started with Apple ][ so it was very nostalgic to see BASIC computer made with embedded processor and to control GPIOs and resources in BASIC.

At that time Maximite was advertised as “open source” project, i.e. firmware sources were available for download. The hardware schematic also was present in JPEG format.

As hardware engineers we immediately spotted some weakness in the Maximite hardware design – the author being mostly software engineer omitted lot of hardware features PIC32 have.

While PIC32 have ultra low power modes, hardware SPI, I2C, UARTs, parallel interfaces which could work with MHz clock speed, for some weird reason the Maximite author decided to implement them by bit-banging purely in software – cripple-ing these interfaces to very low speeds only. Low power modes were not implemented at all.

So we decided to improve the hardware – this is how we made our board with low power design, hardware UARTs and SPIs, UEXT and Arduino connectors so Arduino shields like Gameduino etc could be placed on top of the board and so on.

We completed our hardware design and we proudly offered the Maximite author to check it and tell us his opinion … but he told us that he is not interested and demanded us to choose different name than Maximite. It was a quite surprising open source project author to refuse contribution. So we named our board Duinomite (Maximite is also explosive so we wanted to show where our board roots are).

Being mostly Hardware company we couldn’t implement the software our self, so we contacted Ken Seggler who at this time made port of Maximite for ChipKit board with same PIC32 processor. He was unemployed at that time and he accepted to make the port and even to implement our new ideas we had about low power sleep modes, the new hardware UART and SPI, SETUP command for general board setup, Gameduino commands, we discussed on public forum how to implement editor inside the BASIC and label-less commands etc.

Unfortunately this move really pissed off the Maximite author. He saw the Maximite BASIC port to our board as direct competition as now our hardware had more features than his own.

He closed the Maximite Basic source, then wrote one nasty page about Duinomite on his web presenting him as victim of the big bad company who steal his work and removed his name out of it.
From day one Duinomite Basic fork is on GitHub and anyone can check how true these blames are – Maximite author’s name have been always on our Duinomite Basic fork and display on startup . We had to fork his BASIC just because he refused to support our hardware.

Meantime Ken found full time job and couldn’t contribute to the project anymore, the Maximite author released new version of Maixmite Basic with label-less commands, build-in editor and his new Maximite hardware has … Arduino connectors  (surprise surprise 🙂 ), so after all he has listened to us and took our contributions silently back !

Duinomite software left at that stage as no one was interested to duplicate Maximite Basic work and to run in parallel two same language implementations. The Maximite author had one problem though – while Duinomite quality build hardware cost just EUR 20 the Maximite less capable hardware in kit form cost was something like x3 times more and obviously people were buying Duinomite hardware, so to increase his followers he made Duinomite support and offered HEX compiled version of his Maximite BASIC for Duinomite – actually doing what we originally asked him for to do!

As far for the Duinomite BASIC fork – none of the younger and capable developers is interested in BASIC. Most of Maximite / Duinomite BASIC users are 40+ years and just users but not contributors / developers, so Duinomite BASIC development is pretty much dead.

Although Duinomite boards are still high seller, I guess 99% of people buy them and use them as regular PIC32 development board and use C instead of Basic judging from the tech supports questions we get.

Now with MPIDE Arduino like IDE people who are familiar with Arduino can develop on Duinomite too.

Weekend Programming Challenge Issue-18 – Console Text Editor

Image

Problem: create simple text editor for VT100 terminal

Many of us remember Borland’s Turbo Pascal V3.0 which in 39K had compiler, linker, run-time library and minimal WordStar type text editor.

BAS-INT is freeware tiny Basic interpreter with the bare minimum for BASIC scripting language. It works with external files only and is with Basic Stamp like syntax.

The Challenge today is to write minimal console editor which to complement BAS-INT and to perform some very basic commands:

List – list the program in memory with numbers
Delete N(-M) – deletes line N or N to M from memory
Insert N – inserts line on number N
Run – runs the BASIC program in memory (this code is already available)

if one wants to make it even more advanced he may make also the
Edit N – prints the content of line N and allow it to be edited

Remember this is console application and you have just serial in and serial out, no fancy graphics and windows in this editor.

The BAS-INT template is uploaded on GitHub https://github.com/OLIMEX/WPC/tree/master/ISSUE-18/BAS-INT

The rules:

You can code the solution in any programming language (well obviously as you have to integrate BAS-INT which is written in C this any language for this problem must be C) during the weekend and have to submit it to info@olimex.com latest on Sunday July 21th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

DuinoMite is now on GitHub

DuinoMite software development was suffering from missing version control since we started it. There are 4 developers who contributed to the project but there was quite lack of coordination as we put all stuff on Ken’s shoulders.

Ken’s release from February 16th, 2012 was with few minor bugs on the UART configurations, but being busy he had no time to fix these. This weekend I had some free time after we finish the iMX233-OLinuXino design and took a look at the sources and fixed few port definition and UART initialization mistakes.

Now the source is on GitHub https://github.com/OLIMEX/DuinoMite

I put there also the latest Hardware CAD files and from now on the latest revisions will be there.

DuinoMite DM-BASIC now have CAN support

Good News! Frank Voorburg implemented CAN support BASIC commands for DuinoMite http://www.kenseglerdesigns.com/cms/forums/viewtopic.php?f=4&t=259

Running StickOS BASIC on DuinoMite-Mega

Image
StickOS is BASIC interpreter which runs on Microchip PIC32 and Freescale MCF52XX microcontrollers. Recently in release 1.92 support for DuinoMite-Mega was implemented so I did a test drive this weekend.

To install StickOS on DuinoMite is very easy, you should go in bootloader mode and start DuinoMite bootloader then to load this HEX: http://www.cpustick.com/downloads/StickOS.PIC32.DuinoMite-Mega.v1.92d.elf.hex and then if you are on WIndows you need this INF file for the USB VID/PID which StickOS uses: http://www.cpustick.com/cpustick.inf

when you program the HEX code and press reset new COM port will be created you can use your terminal program of choice to connect to this port and you will see:

Welcome to StickOS for Microchip PIC32MX7-F512H DuinoMite-Mega v1.92d!
Copyright (c) 2008-2012; all rights reserved.
http://www.cpustick.com
support@cpustick.com
(checksum 0xe2e6)
>

StickOS pre-tokenize BASIC command and do syntax check while you enter your code

This is good as it speeds the execution of the code later also it prevent you to write code with syntax errors.

For instance if you want to write:

>10 non-existing command
^ – error

you will receive this error message and nothing will be stored to line 10

pre-tokenizing the source allow later the interpreter to switch the statements with single byte  comparison instead the multiply byte comparison which MM/DM BASIC does and this allow speed increase, another speed increase feature is that StickOS uses just the real PIC32 peripherials and do not make bit-banging as MM BASIC does, this result it x4 times faster execution:

10 dim a
20 configure timer 1 for 1 s
30 on timer 1 do print a
40 for a = 1 to 200000
50 next

prints 112518 BASIC instructions per second

what I missing in StickOS is:

– no VGA and PS2 keyboard support

– no SD card file system

– print command is very simplified

– not open source, although there is mechanism to add new commands by skeleton source which links the core basic as pre-compiled object code

It’s very easy to go back to MM/DM BASIC by simply entering bootloader mode and re-loading the HEX file for MM/DM BASIC.

If you want to give it try to StickOS BASIC you can first learn the commands by reviewing these PDFs:

Quickstart guide

http://www.cpustick.com/downloads/quickref.v1.90.pdf

and user manual

http://www.cpustick.com/downloads/stickos.v1.90.pdf

HACKING DuinoMite BASIC

Image

There is FIRMWARE WISHLIST on Ken Segler Designs forum and I post there a lot with requests for this or that command to be add 🙂

As the DM-BASIC code is over 30 000 lines I never looked at it in detail, just if wanted to see how some command works I was looking at the specific code which implements it.

Overall I though it’s difficult and confusing to touch in so big code as I could easily mess up something with the other commands.

Iggy from KSD forum did some commands recently for me and when he submited them to Ken to include in the mainstream code I was amazed how simple was to add command to DM-BASIC.

For instance he implemented function DM.VMEM which returns the first address of the video RAM as Nick requested on TBS forum, the code insertion was:

in graphics.h there is one line to add:

// Ingmar
{ “DM.VMEM”, T_FNA | T_NBR, 0, fun_vmem },

this row define the name of the new statement: “DM.VMEM” then define it as FUNCTION returning NUMBER and will call fun_vmem() to get it’s value

and in graphics.c there is this code snip to add:

/////////////////////////////////////////////
// Returns lower 16 bits of video buffer.
// This assumes the upper 16 bits always start 0xa000, maybe we should return all 32 bits?
/////////////////////////////////////////////
void fun_vmem(void) {
int vmem = (int)VA;

vmem &= 0x0000ffff;
fret = (float)vmem;
}

so with adding 5 lines of code we already have new DM.VMEM function which returns the address of the Video buffer!

WOW! I didn’t expect it to be SO easy!

now let’s see how he implemented SHIFTOUT:

first define it in external.h
// Ingmar
{ “SHIFTOUT”, T_CMD, 0, cmd_shiftout },

this time this is COMMAND i.e. do not return value and the code is at cmd_shiftout()

and the code is put in external.c

///////////////////////////////////////////////
// This is invoked as a command (ie, shiftout(Dpin, Clkpin, Mode, OutStr, NumBits) )
// Remember that the string returned in outstr will have the length in byte 0, outstr[0]

#define uDly(a) {WriteCoreTimer(0); while(ReadCoreTimer() < a);}

void cmd_shiftout(void) {
int dpin, cpin, mode, nbits;
int ix, iy; // loop counter
int cnt; // number of bytes to output.
unsigned char mybyte;

char * outstr;

const int BDLY = 3; // Determines clocking rate. # of CoreTimer cycles.

getargs(&cmdline, 9, “,”); // Get the arguments, we should have five, comma seperated.

if (argc < 9) error(“Invalid syntax”); // Test number of arguments given.

dpin = getinteger(argv[0]); // Data pin
cpin = getinteger(argv[2]); // Clock pin
mode = getinteger(argv[4]); // Mode
outstr = getstring(argv[6]); // String to clock out,treated as an array of bytes.
nbits = getinteger(argv[8]); // Number of bits to clock out

if (nbits < 1 || nbits > (outstr[0] * 8)) error(“Too many/few bits”);

if (dpin < 0 || dpin > NBRPINS || cpin < 0 || cpin > NBRPINS) error(“Invalid pin number”);
if (ExtCurrentConfig[dpin] >= EXT_COM_RESERVED || ExtCurrentConfig[cpin] >= EXT_COM_RESERVED) error(“Pin is allocated to a communications function”);

// At this point we should have a valid number of arguments and some possibly valid IO pins.

cnt = (nbits – 1) / 8; // Tells us who many complete bytes to loop over.
cnt++; // at least one byte even if it is a partial byte.

ExtSet(cpin,0); // CLK pin low
uDly(BDLY);

if (mode == 0) { // shift bits out LSB first starting at the END of the string.

for (ix=0; ix<nbits; ix++) { // loop through all bits
iy = ix / 8; // byte offset

mybyte = outstr[outstr[0]-iy]; // current byte being output

if (mybyte & (1 << (ix & 0x07))) {
ExtSet(dpin,1); // output a 1
} else {
ExtSet(dpin,0);
}

uDly(BDLY);
ExtSet(cpin,1); // CLK high
uDly(BDLY);
ExtSet(cpin,0); // CLK low
uDly(BDLY);

} // next bit

} else { // shift bits out MSB first starting at the BEGINNING of the string.

for (ix=0; ix<nbits; ix++) { // loop through all bits
iy = (ix / 8) + 1; // byte offset

mybyte = outstr[iy]; // current byte being output

if (mybyte & (128 >> (ix & 0x07))) {
ExtSet(dpin,1); // output a 1
} else {
ExtSet(dpin,0);
}

uDly(BDLY);
ExtSet(cpin,1); // CLK high
uDly(BDLY);
ExtSet(cpin,0); // CLK low
uDly(BDLY);

} // next bit
}

}

/**********************************************/

the code above is well commented and do not need my comments, again it was very simple to add!

Now let’s hack a bit! I wanted to make my own command to prove the concept!

If you want to do the same:

First you have to obtain the tools to compile DM sources from Microchip web

Download MPLAB 8.80 (166MB) and PIC C32 compiler v1.11b (73 MB) and install them

Then download DM-BASIC latest sources from Olimex Web page http://www.olimex.com/dev/

Unpack them in working directory and try the project. Note I had to setup the C32 locations manually and to change search path for Olimex.h to build the project successfully. The HEX is compiled and located in OUTPUT directory and named OLIMEX.HEX, use the Bootloader tool to burn in DuinoMite.

I compiled the source first and downloaded to DuinoMite. Everything works OK!

OK then let me try to add HELLO command which writes “Hello World” on the screen

I add in misc.h this line which defines my command:

{ “HELLO”, T_CMD, 0, cmd_hello },

and in misc.c the code to be executed when HELLO is met in BASIC:

void cmd_hello(void) {

MMPrintString(“Hello world!\r\n”);
}

Now let’s compile everything and bootload and try!

Image
it works!

So using this approach you can define ANYTHING you want to have in DM but you miss it, only you should have some basic C knowledge, then to be not afraid of learning new stuff and hacking.

I will personally try to implement next: RCTIME command which will measure capacitance on the GPIO pin in the next days and post the result.

This way you can build your own version of DM-BASIC which to add specific functionallity which is not possible to be done otherwise in pure BASIC. Do not forget DM-BASIC is open source project with GPL 3.0 licensee so whatever you do do not forget to make your sources also available, so the community can benefit from your contribution and the project move forward!

Happy hacking!

DuinoMite: Working with 1-wire devices

Image

Maxim-Dallas iButton 1-wire devices are widely used in security, timekeeping, temperature measuring and so on applications.

Gerard Sexton added iButton 1-wire support for DuinoMite so I decided to try it today.

We used to produce car immobilizers 20 years ago (when I type this I feel old 🙂 ) so I found in our stock one iButton receptacle and Dallas DS1990 ROM button.

Image

and wrote simple code to test it:

10 SETPIN 1,8 ‘LED output

as the receptacle have LED on it I decided to drive the LED with PIN(1) and to read the iButton with PIN(18) which is open collector

20 dim ar(10) ‘read iButton info

this defines the array where the read iButton info will be stored, later we can save this on file or to “learn” it and if later matched to open door lock, unlock car etc.

30 p = 18 ‘PIN(18) is used as iButton read as Open collector
40 PRINT “TOUCH iBUtton Please!”

now we are set and wait button to be pressed to the receptacle:

50 owreset p,presence ‘check for present
60 if presence = 1 then gosub 100 ‘if present read and display it
70 goto 50

if button is present the variable PRESENT =1 else 0

when the button is detected we write the info on the screen and blink the LED for 1/2 second:

100 ? “iButton detected:”;
110 owsearch p,1,ar(0): FOR I = 1 to 8: ? HEX$(AR(I));” “;:NEXT I: ?
120 PIN(1)=1: PAUSE 500: PIN(1) = 0 ‘blink the LED
130 RETURN

now let’s see what happend when we run this code:

Image

success, Well done Gerard!

Previous Older Entries