Month: November 2023

Arduino Uno Led Header

Arduino Scrolling Led Display

I build myself a scrolling led message board and every Christmas and new year I have this in my front window to greet the people in front of my house. Every year I reprogram the Arduino Uno with the wishes I want to display. I has become kind of a tradition here. I used an Arduino Uno (clone) and six MAX7219 based LED Matrix Displays forming a 192 x 8 led area. I chose these number of displays because it would fit my window, but the number of displays you want to use is not limited. When a line is displayed it will scroll on the display from right to left and when the display is fully filled it will scroll on until the whole message is displayed. Then it will wait for a few seconds, clear the display with animation and start a random new message. On this page you can find the hardware and the software for this project. Regards, Hein Pragt

What components do you need?

  • An Arduino Uno board; (Nano will also work)
  • MAX7219 LED Matrix Display 8×32 (2 – 8);
  • 5V DC Power supply at least 3A;
  • Board to build on;
Arduino Uno Led Display1

For my version I used an Arduino Uno clone but an Arduino Nano would also be possible, you would have to find the SPI and SS lines for the Nano yourself. I mounted the led displays on a wooden board with stands and the Arduino Uno at the back. In my first design I included a power supply board (the power supply of the Arduino is by far not sufficient) but in the end it was better to use a switching external power supply of 5V DC to feed the Arduino (Vin) and the Led displays. The led displays will take a lot of current, so more displays means a more powerful power supply.

Arduino Uno Led Display2

The connections are very easy, just two power lines and three SPI lines. The Matrix units come in 8×8 times four on a single board, with holes for the connectors at both sides. What I did was lift off the two outer displays, mount the base board on the wooden board and then connect the connector holes with small wires. This is more reliable and you can fit the display units tight together. Look close at the position of the led matrix boards and put them all in the same position. (Also look carefully when putting the displays back on).

The software

I personally do not like to use Arduino libraries, you have to find the correct one and the correct version or it will not work or give compile errors. So what I did was write the whole driver code myself. The whole Arduino project contains two files, the ledmatrix.ino and a 8×8 font include file. In the sourcecode there is an array of messages, you can fill them as you need, they will be stored in flash so there is (almost) no limit to the size. In the top of the code you can define how many displays you have connected (the number of 8×8 blocks), the code will adjust to this automatically. I give you the full sourcecode you can modify it yourself if you want to. The download link is at the bottom of the page. If you need hardware you can visit my webshop.

Arduino Uno Led Display3

Download

Retro computing webshop

Heinpragt.nl is a daughter site of this website and a webshop focused on retro computer parts, retro electronics components and chips and other articles that have a connection with old retro computers. It is a small webshop that I run myself and I also try to get some more information about retro computers and electronics. Shipments are only made to countries within the European Union.
Retro computing parts webshop

More pages on embedded software

Wifi Light

ESP8226 WIFI led control

ESP8226 Microcontroller The ESP8226 is a very cheap Wi-Fi microcontroller with a complete TCP/IP stack and a 32 bit microcontroller and is made by the Chinese manufacturer Espressif Systems. The chip came to attention in 2014 by a small board (ESP-01) as a cheap Wi-Fi module that could be controlled via a serial interface and through a form of Hayes commands. Soon the chip came to the attention of hackers, mainly due to its low cost, to find other uses. For the low amount of money, the specifications are impressive: a 32-bit RISC CPU (Tensilica Xtensa LX106) with an 80 MHz clock frequency, 64 Kb instruction RAM, 96 KB data RAM, external QSPI flash (512 Kb to 4 Mb), built-in IEEE 802.11 Wi-Fi stack, WEP and WPA/WPA2 authentication, 16 GPIO pins, SPI, I2C, UART and a 10-bit ADC. There are some nice cheap DIY boards for sale with this microcontroller and this page contains information about these boards, documentation, links and specifications, and development tooling. Also a full working sourcecode of a WIFI led controller. Sincerely, Hein Pragt

Wemos D1 mini

Wemos D1A relatively small manufacturer by the name of Wemos brings out nice new developments with the ESP-8266 family on Arduino type shields. One of these fun boards to experiment with yourself is the Wemos D1 mini, a small board equipped with a full Wi-Fi and network stack, a nice number of I/O ports, power supply, a USB connection, serial communication, bootloader, Flash memory and a 32 bit processor with an 80 MHz clock frequency. As in all very nice specifications for a board that costs less than 10 dollar. When you are already used to the standard Arduino IDE and programming environment, you can also use this for the Wemos D1. The correct boards have to be installed in the board manager of the IDE, but then it works almost immediately. There are already many libraries specifically for the ESP-8266 family available for the Wemos D1 mini but I find that many of the standard libraries written for the Arduino also work fine on the Wemos D1 mini. Because I2C and SPI also work standard, many of the boards and shields that are made for the Arduino can also be connected, please note that everything must work on 3v3, but this can also be solved with a level adjustment board or a resistance network. But a standard LCD display or a relay board can easily be connected. Sometimes a few I/O pins have to change definitions and often it works fine. But with 4 Mb of code space and 35 Kb of ram and a 32 bit processor at 80 MHz which is a huge improvement over the 16 MHz 8 bit Arduino processor with 1 to 2 Kb sram. The possibilities of the Wemos D1 mini are therefore very extensive, partly due to the built-in Wi-Fi that you can use ready-to-use.

Link: PDF with instructions for the Wemos D1 on the Arduin IDE.

Wemos OLED display

Wemos D1 Mini Oled DisplayThe first display I used is the WeMos D1 mini OLED shield 64×48 of 0.66 inch with an I2C interface. The shield has many more pins because it can also be controlled differently but of course we like to use I2C because it only uses two I/O lines. At 0.66inch it is quite a small display but is very easy to read as it has a high contrast. It uses the SSD1306 as the interface chip and uses the I2C address 0x3C or 0x3D which can be selected by a solder bridge on the back of the PCB. Very small, so I don’t dare and leave them at the default value. The device was delivered with separate header pins and since you only have 4 connections If you need it, you can also solder the wires directly to the PCB.

Code and example

Wemos D1 Mini Met Oled DisplayDownload: HERE my library for the Wemos D1 OLED display and install it via the IDE in your Arduino environment. Restart the IDE and look at the examples and see it says “oledtest64.ino”. The library works for the combination Wemos D1 and the Wemos OLED display. I also use this library myself and develop it further. With these basic functions you can create extensions in your own code.

I like libraries that only offer basic functions because I usually want to make things in my own way, which are just not in the library or just different which means I am compiling a large amount of code from a library that grows my code and is of no use to me. I wish good luck with this code.

The code of this libray is compact and contains only a few basic functions:


  public:
    Ssd1306(uint8_t i2caddr,uint8_t width,uint8_t height,uint8_t orientation);
    void begin(void); 
    void oledSetPixel(int16_t x, int16_t y, uint16_t color);
    void oledDrawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
    void oledDrawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
    void oledFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
    void oledDrawCircle(int16_t x0, int16_t y0, int16_t r,uint16_t color);
    void oledDrawChar(int16_t x, int16_t y, unsigned char c, uint16_t color);
    void oledPrintLine(int16_t x, int16_t y, unsigned char *c, uint16_t color);
    void oledInvert(void); 
    void oledNormal(void);
    void oledCopyDisplayBuffer(void);
    void oledClearDisplayBuffer(uint8_t value);

The displays can actually show only a little text, with a font of 5×7 this is the division on the screen and a resolution of 64 x 48 pixels, this gives ten columns and 5 rows, so you can effectively lose 50 characters on the screen.

Oled Text Size 1

Sourcecode Wi-Fi led control

This piece of sample code clearly shows the tremendous power of the Wemos D1 mini. The example uses my OLED library and otherwise only use standard supplied / built-in parts. Through this piece of code you can use your mobile phone via the web browser to find an output pin of the Wemos D1 mini module (read: connected relay) on and off. In this example I control the built-in LED. Since the more complete Wi-Fi stack and network stack are in the module as far as we don’t write our own code for this. First you make on your phone to a mobile hotspot and gives it a name and a password, you enter this name and password at const char* ssid and const char* password after which you can compile the code and upload it in the Wemos module. After turning on of the module, it will try to contact your mobile hotspot and then display its IP address on the screen. You then only need to enter this address in the address bar of the browser on your mobile phone and the Wemos module will now behave like an HTTP server and send you a page with the status of the led. Then you can click on a click on the links or switch the LED on the Wemos module on and off by means of a URL parameter. This is just a small example that can be food for many ideas, but I leave that to your imagination. kind regards, Hein Pragt.

// -----------------------------------------------
// Example code WI-FI led control
// -----------------------------------------------
#include 
#include 
#include 

const char* ssid = "HotspotVanUwTelefoon";
const char* password = "WachtwoordHotspotTelefoon";

int ledPin = BUILTIN_LED;
WiFiServer server(80);

Ssd1306 ssd1306(0x3C,64,48,0);

void setup() 
{
String ip;
char buffer[20];

  Serial.begin(9600);
  delay(10);  

  ssd1306.begin(); 
  // Clear the buffer.
  ssd1306.oledClearDisplayBuffer(0);
  ssd1306.oledCopyDisplayBuffer();

  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);

  // Connect to WiFi network
  ssd1306.oledPrintLine(0,0,"Connecting",1);
  Serial.print("Connecting to ");
  Serial.println(ssid);
  ssd1306.oledPrintLine(0,10,(char *)ssid,1); 
  ssd1306.oledCopyDisplayBuffer();

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  ssd1306.oledClearDisplayBuffer(0);
  Serial.println("WiFi connected");
  ssd1306.oledPrintLine(0,0,"Connected ",1);
  ssd1306.oledCopyDisplayBuffer();

  // Start the server
  server.begin();
  Serial.println("Server started");

  // Print the IP address
  Serial.print("Use this URL : ");
  ssd1306.oledPrintLine(0,10,"MY IP:",1);
  Serial.print("http://");
  Serial.print(WiFi.localIP());
  ip = WiFi.localIP().toString();
  ip.toCharArray(buffer, 20);
  ssd1306.oledPrintLine(0,20,buffer,1);
  Serial.println("/");
  ssd1306.oledCopyDisplayBuffer();
}

void loop() {
  // Check if a client has connected
  WiFiClient client = server.available();
  if (!client) {
    return;
  }

  // Wait until the client sends some data
  Serial.println("new client");
  while(!client.available()){
    delay(1);
  }

  // Read the first line of the request
  String request = client.readStringUntil('\r');
  Serial.println(request);
  client.flush();

  // Match the request

  int value = HIGH;
  if (request.indexOf("/LED=ON") != -1) {
    digitalWrite(ledPin, LOW);
    value = LOW;
  } 
  if (request.indexOf("/LED=OFF") != -1){
    digitalWrite(ledPin, HIGH);
    value = HIGH;
  }



  // Return the response
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println(""); //  do not forget this one
  client.println("");
  client.println("");

  client.print("Led pin is now: ");

  if(value == LOW) {
    client.print("On");  
  } else {
    client.print("Off");
  }
  client.println("

"); client.println("Click here turn the LED on pin 5 ON
"); client.println("Click here turn the LED on pin 5 OFF
"); client.println(""); delay(1); Serial.println("Client disconnected"); Serial.println(""); }

ESP8226 download and links

Here are some external links to pages and documents that will be helpful and helpful when getting started with the ESP8226.

More pages on embedded software

Internet Radio Logo

ESP32 based WIFI internet radio

A nice feature of the Internet is online radio (also web radio, net radio, streaming radio, e-radio, IP radio, Internet radio). These are digital audio services transmitted via the Internet. Broadcasting on the Internet is usually referred to as webcasting since it is not transmitted broadly through wireless means. Internet radio involves streaming media, presenting listeners with a continuous stream of audio that typically cannot be paused or replayed, much like traditional broadcast media. The first Internet radio service was launched in 1993. Nowadays most popular radio stations also have an Internet radio stream and there are a lot of specialized radio stations, for instance I really like outlaw country music, and I have a few nice stations in the USA. Kind regards, Hein Pragt.

Building and ESP32 internet radio

So building an Internet radio is not that hard, we need a HTTP stack and a MP3 decoder. Both are available at a very good price, and we also add a simple display and a button to select a station. I have a 3D printer so I created a nice case as well. Lets start with the part list:

  • A VS1053 MP3 codec board;
  • ESP32 board (I used a WROOM version);
  • OLED 64*128 display module I2C;
  • Push button;
  • 10 K resistor;

Oled Display Module 0.96 128×64 I2C

Ssd1306 I2c Oled DisplayThe display I used is a fairly standard OLED cheap display with white pixels, a resolution of 128 x 64 pixels and a control by means of I2C by the the SSD1306 driver IC. This shield also only needs two data lines and it consumes minimal current so that it can also be used in projects that need to be powered by a battery or battery. The size of this screen is slightly larger than the previous one and measures 26.0 x 15.0 mm. The module runs on 3v3 and can be connected to the outputs of the 3v3 output of the ESP32 and the I2C lines do not need voltage converters. The I2C address of this OLED shield is 0x3C by default. The screen is very clearly readable due to a very high contrast. The SSD1306 is a single-chip CMOS OLED/PLED driver with controller for displays with a maximom resolution of 128 x 64. The IC contains a display controller with display RAM and a built-in oscillator so that it can be used with minimal external components. It has a built-in 256 steps brightness control. It has a 6800/8000 series compatible Parallel Interface and a I2C interface.

VS1053 MP3 codec board

Vs1053The VS1003 audio codec module is a complete MP3/WMA/MIDI audio decoder and ADPCM encoder that features a high quality stereo DAC (Digital to Analog Converter), a 16-bit adjustable ADC (Analog to Digital Converter) and a high quality stereo earphone driver (30 ohms). This module is ideal for adding audio decoding and encoding capabilities to embedded systems. It has a serial data and control interface (SPI) that makes it easy to connect to the ESP32 or any othe board that has an SPI interface. It also has a headphone and audio output interface and a microphone for recording but we cont be using this. It supports MP3 and WAV stream and has a single 5 V power supply that is On-board converted to 3.3 V and 2.5 V for the chips on the board and it uses about 800 mA. When we feed it with 32 bytes chunks of audio data, it will decode and output the audio trough the headphone jack. We can connect this to an amplifier to play it on a stereo set or PC speaker set.

ESP32 connections

Esp Pins Radio

ESP32 internet radio shematics

Esp Radio Schematic

Connecting everything up is not that hard, although the pins on the ESP32 are very hard to read because the text is very small. Also check the pins of the ESP32 board you have, I have noticed some difference in different boards. The name of the pin is the clue you have to follow. The entire device is powered through the micro-usb port of the ESP32. Load the code in the Arduino IDE (you have to make sure it supports the ESO32 first) and you may have to download some additional libraries like the “ESP_VS1053_Library-master” and the “esp8266-oled-ssd1306-master” library. Find the place in the code where you have to put your WIFI network name and password and compile the code.

After uploading the software it will say a welcome phrase and then connect to the WIFI. It will remember the last station you selected and then start streaming the MP3 data to the MP3 codec and you will hear the internet radio station. I really like this little device and I have filled the array in the source code with a few radio stations, you can delete and add your own, as you like and personalize the device. Have fun.

The ESP32 sourcecode

Do not copy and paste, the download link is below the listing!

// ----------------------------------------------------------------
// ESP32 + VS1053  Internet radio
// Hein Pragt 2022
//
// VS1053 - connections 
// XRST = EN (D3)
// MISO = D19
// MOSI = D23
// SCLK = D18
// VCC = 5V / 3.3 V  and  Gnd = Gnd 
// ----------------------------------------------------------------

#include <VS1053.h> 
#include <Preferences.h> 
#include "StartMp3.h"
#include <WiFi.h>
#include <HTTPClient.h>
#include <esp_wifi.h>
#include "SSD1306.h"

char ssid[] = "your wifi ssid";
char pass[] = "your wifi password";

Preferences preferences;
SSD1306     display(0x3c, 21,22);
WiFiClient  client;

unsigned int counter,old_counter;
int change = 13;
bool pinflag = true;
int status = WL_IDLE_STATUS;
uint8_t mp3buffer[128]; 

struct _stationList {
  char sname[64];
  char host[128];
  char path[128];
  int  port;
} stationList[] = {
{ "NPO Radio 1 " ,   "icecast.omroep.nl", "/radio1-bb-mp3", 80 },
{ "NPO Radio 2 " ,   "icecast.omroep.nl", "/radio2-bb-mp3", 80 },
{ "NPO 2 S & J " ,   "icecast.omroep.nl", "/radio6-bb-mp3", 80 },
{ "NPO 3FM     " ,   "icecast.omroep.nl", "/3fm-bb-mp3", 80 },
{ "NPO 3FM Alt " ,   "icecast.omroep.nl", "/3fm-alternative-mp3", 80 },
{ "NPO Radio 5 " ,   "icecast.omroep.nl", "/radio5-bb-mp3", 80 },
{ "538 Radio   " ,   "20073.live.streamtheworld.com", "/RADIO538.mp3", 80 },
{ "QMusic      " ,   "icecast-qmusicnl-cdp.triple-it.nl", "/Qmusic_nl_live.mp3", 80 },
{ "Radio 10    " ,   "25533.live.streamtheworld.com", "/RADIO10.mp3", 80 },
{ "Radio 10 70 " ,   "22343.live.streamtheworld.com", "/TLPSTR18.mp3", 80 },
{ "Radio 10 80 " ,   "25233.live.streamtheworld.com", "/TLPSTR20.mp3", 80 },
{ "Radio 10 90 " ,   "25353.live.streamtheworld.com", "/TLPSTR22.mp3", 80 },
{ "Radio 10 Love" ,  "25293.live.streamtheworld.com", "/TLPSTR04.mp3", 80 },
{ "Veronica    " ,   "22343.live.streamtheworld.com", "/VERONICA.mp3", 80 },
{ "Sky Radio   " ,   "25293.live.streamtheworld.com", "/SKYRADIO.mp3", 80 },
{ "Country Rocks" ,  "stream.dbmedia.se", "/crrMP3", 80 },
{ "Outlaw Country" , "ice10.securenetsystems.net", "/KIEV2", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 },
{ "~" ,   "0", "0", 80 }
};


// Wiring of VS1053 board (SPI connected in a standard way)
#define VS1053_CS    32
#define VS1053_DCS   33
#define VS1053_DREQ  35 

#define VOLUME  100      // volume level 0-100

VS1053 player(VS1053_CS, VS1053_DCS, VS1053_DREQ);

// -----------------------------------------
// Setup and init
// -----------------------------------------

void setup ()
{
display.init();
display.invertDisplay();
display.setFont(ArialMT_Plain_16);
display.normalDisplay();
display.setColor(WHITE);
display.drawString(0,0,"  ESP32 Radio");
display.setFont(ArialMT_Plain_10);
  
   pinMode(change,INPUT_PULLUP);
   Serial.begin(115200);
   delay(500);
   SPI.begin();
   player.begin();   // initialize VS1053 player
   player.setVolume(VOLUME);
   
   WiFi.begin(ssid, pass);
   while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
  Serial.println("WiFi connected");  
  Serial.print("IP address:");  
  Serial.println(WiFi.localIP());
  display.setColor(WHITE);
  preferences.begin("my-app", false);
  counter = preferences.getUInt("counter", 0);
  old_counter = counter;
  delay(100);
  player.playChunk(StartUp, sizeof(StartUp)); //VS1053 is wake up & running
  delay(1000);
  station_connect(counter); 
}


// -----------------------------------------
// Main loop
// -----------------------------------------

void loop()
{
  // Play stream
  if (client.available() > 0) {
     uint8_t bytesread = client.read(mp3buffer, 128);
     player.playChunk(mp3buffer, bytesread);
  }
  // Check key
  if (digitalRead(change) == 0 and pinflag == true) {
    pinflag = false;
    counter++;
    if (stationList[counter].sname[0] == '~') { // Empty field
      counter = 0;
    }
  } 
  if (old_counter != counter) {
    player.softReset(); 
    pinflag = true;
    station_connect(counter); 
    old_counter = counter;
  } 
}


// -----------------------------------------
// Connect to radiostation
// -----------------------------------------

void station_connect (int station_no) 
{
  if (client.connect(stationList[station_no].host,stationList[station_no].port) ) {
    Serial.println("Connected now");
  }
  client.setNoDelay(true);
  Serial.print(String("GET ") + stationList[station_no].path + " HTTP/1.1\r\n" + "Host: " + stationList[station_no].host + "\r\n" + "Connection: close\r\n\r\n");     
  client.print(String("GET ") + stationList[station_no].path + " HTTP/1.1\r\n" + "Host: " + stationList[station_no].host + "\r\n" + "Connection: close\r\n\r\n");     
  display.clear();
  display.setFont(ArialMT_Plain_16);
  display.drawString(0,0,"ESP32  Radio");
  display.drawString(0,21,"Station: " + String(station_no));
  String line4 = String(stationList[station_no].sname); 
  display.drawString(0,42,line4.substring(0,60));
  display.display();
  preferences.putUInt("counter",station_no); 
  Serial.printf("Set counter to new_value: %u\n", station_no);
}

Downloads

Download: Full sourcecode Zip file.

To compile the code you will need some libraries, i have used the next libraries:

  • ESP_VS1053_Library-master
  • esp8266-oled-ssd1306-master

This is my build

I also have a 3D printer and I design using Freecad so I made my own case for this internet radio.

Internetradio

Links

More pages on embedded software

Fz9gfz0jfx0inh3

Arduino RFID Door Lock

On this page I will document and explain how to build a relatively cheap electric door lock based on an Arduino Nano and a RFID shield. I have a small garden with a bicycle shed that has a door to the common area behind our house. I have a lock on this door, but a lot of people have a key, my children, my neighbor and buying a new spare key takes long and is expensive. And then people lose their key, so I thought of a simple solution where I could make many keys and could authorize, but also unauthorize keys. I though of a solution using simple 125 Khz RFID keys and a cheap reader and an Arduino Nano processor. I ordered an electric lock online because it was hard to get here in a shop and rather expensive. I gave everyone who needs access to my garden (fi. to feed the animals) a small RFID key, and created a 3D printed reader next to the door and its working fine. On thsi page I will show you how I build it, because it’s all standard components, you could design your own version, if for instance you add a clock chip you could even give certain RFID keys only access at specific times. You can download all the files from this website, if hope this project will inspire you to create your own version. Regards, Hein Pragt

Step 1: So What Components Do You Need?

  • An Arduino Nano board;
  • EM4100 RDM-6300 RFID card reader 125 khz (or compatible);
  • Some 125 Khz RFID badges;
  • Led with 330 Ohm resistor;
  • 2N7002 Mosfet;
  • 10 K resistor;
  • 1N4004 diode;
  • 5 Volt relay;
  • 7808 voltage regulator;
  • 12V power supply at least 2A;
  • Terminal connector for power;
  • Terminal connector for lock wires;
  • An electric lock (Fail-Secure);
  • PCB board to mount the parts;
  • Female header pins to mount the Arduino and RFID reader.

I usually mount the Arduino Nano and other boards with a female pin header so they can be easily replaced when broken or if they are failing. The lock needs 12V power and I wanted a single power supply, so in order to save the Arduino from becoming very hot, I put a 7808 power regulator chip between the 12V power line and the Vin of the Arduino, I use a 5 Volt relay to switch the power to the electric lock because this device will draw a lot of current. I have used a cheap 12v switching power supply, but you can use any power supply that’s 12 V and can deliver at least 2 or 3 Amp current. For the RFID badges I use the read-only ones, they have a fixed number inside and are cheaper than the R/W badges,

Step 2: The Whole Diagram

F9witfejfx0ihf5
Ffy929xjfx0iq0v
Fubnw89jfx0iqjq

This is the diagram of the lock system.I build it on a PCB board using several colors of wire, the diagram is not that complex. I use a 7808 power converter to lower the 12 voltage for the Arduino to 8 volt, I don’t use the capacitors on both sides as the input power is stable and the Arduino does not use too much power. But you could put two 1 uf capacitors on bothe sides of the 7808. I use the +5v output from the Arduino to power the rest of the circuit. I use a mosfet (the old common 2n7002) to drive a relay to switch the 12 v power to the lock. As the lock can draw a lot of current its save to use a relay. I took a little plastic case to hold the electronics and I 3D printed a little case on the outside to hold the antenna and the indicator led.

Fu1vyxmjfx0iksc
The Antenna and the Indicator Led.


Mount the Hardware on and Next to the Door. Mount the Hardware on and Next to the Door. Mount the Hardware on and Next to the Door.

Fkob2n6jfx0im52
Fz9gfz0jfx0inh3

I also designed a holder for the lock to mount it next to the door. I also used a standard door lock on the door with a latch that will move inside when the door closes. I designed a knob to mount on the lock to be able to open the lock from the inside without a RFID badge. (The third file of the knob, the axis, should be printed with 100% infill to make it strong enough) I also created a 4mm spacer for the lock, so you can mount it right in front of the latch. The lock and latch should fit loosely otherwise the unlock won’t work. I used a 12 volt 3 A switching power supply for the 12 volt and I mounted it in the top of the bicycle shed in a dry space. I have used a 3 meter wire to connect the 12 volt to the lock system.

Step 5: The Software.

I wrote a very small Arduino program to read the RFID badges and display them on the serial interface so you can read the value inside the badge. Then you can add the hexadecimal number to the array at the top of the file (don’t forget to increment the number of cards below the array). When a valid card is detected the pin 12 of the Arduino controlling the relay pin will be activated for 5 seconds. You can adjust this time to your own needs. I use the software serial to read the badge so the other serial port is free for other use. There are a lot of pins left on the Arduino, you could add a I2C clock module and enable certain badges only at certain times. There is programming space left so add what you want. The basic version is working code and currently mounted in my own backyard.

Download

More pages on embedded software

Intel 8052ah Basic2

Intel 8052AH Basic computer

A while ago I bought an old box with integrated circuits that had been stored for many years and contained a lot of tubes with very old IS’s. As I like to build old processor boards and try to repair old computers and boards, these chips were very welcome. In one tube there were two original P8052-Basic chips and that brought back good memories of the time mid 80ties of last century when I was working as head R&D embedded programmer and hardware designer for a small company and was using the 8031 processor a lot. I even extended a tiny Basic version at that time, but the real P8031-Basic was incredible and complete, but expensive and hard to get at that time. I put these chips in my computer chips and cpu collection and one I kept aside to make a board to get it working again. I had a latch and a memory chip in my workshop, a PCB was also there, I only needed to order a few 11.0592 crystals as these are not so common anymore. After two evenings of wiring it was finally ready and at my first attempt to run it I got a line number error all the time. I seemed that the external sram was not working and it was a small wiring error. After I had fixed that it worked like a charm, I connected it to my VT100 terminal with the TTL serial input and after pressing the spacebar I got the prompt and I could write a small Basic program. On this page I will show you the schematic I made, some build instructions and some documentation and (source)code. Regards, Hein Pragt.

I also have a Facebook Group on Retro Computing and Electronics, feel free to join!Intel 8052-Basic chip

Why do we need at least 3 chips

To answer the question why we need al least 3 chips I have to explain the 8031 bus a little. To make room for as many I/O pins as possible Intel decided to multiplex the low part of the addresses and the 8 bit databus on one port. This would mean only 8 pins of the chip instead of 16 pins. Of course you would need an external latch for decoding the 8i address bits and the chip needed a pin to signal the output of the address part. Port 1 is actually a 8 bit data out and a 8 bit data in and a 8 bit address out port. The 74573 chip is often used as an 8 bit latch, this will store the 8 bits and save them (kind of like a 8 bit memory chip) to provide the lower 8 bits of the external memory address when reading or writing to external memory. Then we need a external memory chip, we can use anything between 8 and 128 x 8 sram chips, I chose the 32kb x 8 chip (62256) as I had these laying around. I use A15 as a chip select signal, the chip select pin is active low, so the A15 pin selects to lower 32Kb part. When using other chips you have to figure out yourself how to select the chip and put the unused address lines to ground. This is the minimum configuration and all we need to add are a small reset circuit and the crystal oscillator circuit and were done. Below is my schematic I made of my design.

8052 Hp

Building the board

When building this I use a PCB board that is double sided and not too small so I have room to wire the circuit. I put all the chips in sockets, to be able to reuse them again and protect the chips when soldering. I first put the sockets on the board and leave enough space between them for the wires, then I solder the sockets. Then I solder four pin connectors in one corner, two for the power +5v and Gnd, and two for the Tx and Rx lines. Then I solder the crystal near the processor pins, leaving room for the capacitors and I solder them to the correct pins of the processor socket. Then I do the same with the reset capacitor and resistor.

20220521 221504

The next thing is wiring and soldering all the power lines, I use red wire for the +5V and black wire for the Ground. I use solid kernel wire that is available in a lot of colors. I avoid going over the soldering points and like using a PCB layout go around the chips as much as possible. After this I wire the control and chips elect R/W lines using gray / white and orange wire. Then I take yellow wire and connect all the address lines, I try to keep the wires as much together as possible. Now it becomes a little tricky as the AD lines need both a address and a data latch wire. I use blue for the data latch and green for the databus lines. First I solder the blue wire to the socket pin and then carefully on top of that the second green wire. Make sure you do not use to much solder otherwise you can short two pins. I you shorted two pins, take the solder od with a solder pump and try again.

20220521 220244

Now all the lines are attached it is time to check for short circuits, take a Ohm meter and put the pins on two socket pins near each other and do that for all pins. If there is no short circuit we can place the chips. Check the powerlines for short circuit before putting 5 volt on the board. I use a USB power supply and I cut a standard USB cable ands solder female sockets on the power lines, safe an cheap. Now connect the board to a terminal or to a PC using a TTL RS232 to USB cable and type space. When all is right you should see a basic welcome message and prompt. The basic manual download link is at the bottom of this page, have fun!

20220521 220213

Using a AT89c52 or STC89c52 chip

The P8052-Basic chip is very rare and not available anymore, but there us a good alternative. Intel made the Basic code freeware a while ago and put the sourecode and hex files on their FTP site. I cannot find it anymore, but luckily I download everything that is interesting and so I have put the original zip file on my website to download. It contains the sourcecode and the binary hex file of the 8Kb Basic interpreter. When you use a 8052 with Flash eeprom like the 89c52 you can burn the hex code inside the microcontroller and you will have the same chip as the P8052-Basic chip. So you can build this small computer with modern parts.

8052 Basic PCB

I have a PCB for a very complere 8052 Basic computer in my webshop. This is a PCB of a Basic computer based on intel p8052-ah basic for the RCBus. (RC2014), an improved basic version for the 8052 was published in ELEKTOR 2001 (MCS BASIC-52 V1.3) This board can hold many different 8052 variants and supports a lot of different crystal oscillator configurations from 11.075 Mhz (Original) up to 22 and even 33 Mhz. The designer flashed the code into an ds89c450 running at 22.184 mhz, and that is 12x faster than an normal 8052. I build mine with a AT89C52 processor, but ANY 8052 version with at least 8Kb internal Flash will work. https://www.heinpragt.nl/?product=8052ah-basic-pcb-rc2014

My 8031 background

In 1986 I started to work as an embedded programmer and hardware designer for a small company in the Netherlands that build modems and computer equipment. At first it was only my favorite processor the Z80 but in the low cost modems we needed a cheaper microcontroller so one day I got a 8031 hardware emulator from Intel with all the development tools. As Intel provided PL/M and Assembler with their development kit I started to program in PL/M and assembler for the 8031 processor. I really fell in love with this processor and struggled to get all the code into a single eprom and only use the internal ram. In the second modem I got a 8032 so that gave me 128 bytes of extra ram and in the next redesign we implemented an Atmel version so we needed no external eprom anymore, bringing the chipcount down. In one of the last devices I build with the 8032 I had implemented the tiny Basic as well to make the device a programmable communication controller. After that we started to make modems with V42/v42bis and MNP compression and the 8032 was not powerful enough, so we stated to use an Intel 80188 processor. But I loved the MSC-52 processors from Intel, but the next companies I worked for used the Z80 and MC6809 chips, so I have used and programmed a lot of different processor chips.

8052 and 8052-Basic related documents

More pages on embedded software

Mos6502

6502 processor IDE

This is a page about my freeware 6502 processor IDE program which is an editor / emulator / debugger / assembler / disassembler for the 6502 processor all in one portable Windows executable. I was never a big fan of the MOS 6502 processor, it was far to simple compared to the Z80 processor that I used. But the MOS 6502 processor was the biggest competitor of the Z80 in home computers in the 80ties and a lot of great computers used this processor. A few years ago I build my first Apple 1 clone and I got interested in the MOS 6502 again, this time I took some time to learn to program it. But as with so many old processors, it is hard to find the programming tools, there are some, but most of them cover only one configuration or are not portable and not suited for Windows. I had already written an Apple 1 emulator and had the emulator code. So I decided to add another IDE to the ones I had already written. (It get easier every time). In this IDE I support the Apple 1 computer, the Elector Junior (KIM 1) board and a simple 64K rom/ram machine with only LED outputs. Have fun. Regards, Hein Pragt.

I also have a Facebook Group on Retro Computing and Electronics, feel free to join!

6502 editor / assembler / emulator / debugger

Mc6502 Ide

To be able to program for the 6502 processor you need an assembler or compiler. I personally still like to write in assembler but I could no longer find tools for Windows 10. There were still some programs to download but most of them worked at DOS level, had serious bugs or did not fit my needs. After some searching I decided that it was time for a new project, building a complete integrated 6502 development environment. I found a pretty good assembler and the base code of my Z80 IDE and I had some old code in my code library. The result is 6502 workbench, a portable x64 Windows program that includes an editor, assembler, disassembler, emulator, single step debugger, Intel hex read / write function a VT100 terminal window, a seven segment display with 8 LEDs and keyboard support.

Installation

Download the zip file and unzip it at the place where you want to install it on your hard drive. Then create a shortcut to the program to the desktop and the program is ready for use. It is a so-called portable program which means that it does not use external sources or libraries and does not use the registry. After removing the directory from this program, it has also disappeared completely from your system.

First time use

To practice there are a few example files in the example directory, which you can load after which it will be in the shown in the middle edit window. Now you can convert this into machine code by means of the assemble button, this will appear on the left of the screen and be put into the virtual memory of the emulator. The last (or first) .org statement will also be put in the program counter and by simply pressing the run button you can execute the program and follow it on the screen. The speed will be just like the original processor, you can set the speed in the top of the screen. You can now stop running and modify the program, reassemble it and run it again. You can chose to see a realtime update of all registers (update checkbox) and you can set a breakpoint on code or memory access, a value of zero means its off. You can choose to stop at a breakpoint or start the realtime disassembler so you can trace your program. You can also set this trace on manually when you choose to single step trough the code. You can inspect the memory in the hex window. Default the 6521 PIA is emulated and the WozMon rom is loaded in Apple 1 mode. This terminal is a VT100 type. You can also select the Junior computer in which case the 6532 PIA is emulated and the Junior rom is loaded. Both rom files are external so you can modify them.

You can save the modified code as an asm file again but also save it as a hex file so that you can load the binary code in a circuit or ep(rom) for a real 6502 circuit. You can also read an Intel-Hex file, which will then be loaded into the internal emulator memory. You can also run this code when you put the correct start address in the program counter. You can also disassemble this internal emulator memory code after which the source code will appears in the edit screen in the middle. This can then be changed and written back into the emulator memory by means of assemble button.

I/O map

The 6502 has no I/O space so I implemented am MC6821 and a MC6532 PIA, in Apple 1 mode the 6821 PIA is used and mapped just like the Apple1, connecting the keyboard and the display with a VT100 terminal. In Junior mode the 6532 is emulated and the I/O mapping is just like the Junior computer (or KIM 1) with the seven segment displays and the keys mapped to the PC keyboard. You can also click the keys on the screen image. In simple mode the 8 leds are on memory address $d000 and the keyboard can be read using the same address.

Junior memory map

Junior Map

Version 1.04

I use the 6502_workbench myself and that is one of the way I find and fix bugs. I it now time to release the first version on my website so other can use it and I will continue to use improve the code. Suggestions and bugs reports are always welecome. I proudly present version 1.04 of the 6502 processor developer IDE.

Buy 6502 and 6502 related chips and hardware

I also have a webshop where I sell several 6502 types processors, boards and support chips.

https://www.heinpragt.nl/?s=6502&post_type=product

Download

Here you can download the latest version if this IDE. This download is a zip file containing a portable x64 (and a x32 version) Windows exe programs, an assembler directory and a examples directory.

https://www.heinpragt.nl/?product=6502-processor-ide

  • Version 1.04
    • Fixed some small bugs in the user interface
    • Fixed overflow bug in monitor.
  • Version 1.01
    • Initial release, it might be not completely bug free, I will test on, wait for remarks amd release the next version soon.

Documentation:

U use an external CA65 assembler, you can find documentaion on: https://cc65.github.io/doc/ca65.html

More pages on software development

8052

8052 processor IDE

This is a page about my freeware 8051 / 8052 IDE program which is an editor / emulator / debugger / assembler / disassembler / ISP programmer for the 8052 all in one portable Windows executable. Many years ago when I was programming the 8052 professionally and at home, tools were very expensive. There was not much freeware or opensource, but trough my employer I had most of the tools I needed. I wrote a lot of programs in 8052 assembler in 8052 assembler and PL/M, but I also learned to write in C and I had a good C compiler for the 8052. The 8052 was a genius design for its time and its funny that this processor is still used a lot. For development and debugging 8052 assembler code, this freeware IDE can be used. Regards, Hein Pragt.

I also have a Facebook Group on Retro Computing and Electronics, feel free to join!

8052 editor / assembler / emulator / debugger

8052 Workbench

To be able to program for the 8052 you need an assembler or compiler. I personally still like to write in 8052 assembler but I could no longer find tools for Windows 10. There were still some programs to download but most of them worked at DOS level, had serious bugs or did not fit my needs. After some searching I decided that it was time for a new project, building a complete integrated 8052 development environment. I found a pretty good assembler and the base code of my Z80 IDE and I had some olde code in my code library. The result is 8052 workbench, a portable x64 Windows program that includes an editor, assembler, disassembler, emulator, single step debugger, Intel hex read / write function a VT100 terminal window, a seven segment display with 8 LEDs and keyboard support.

Installation

Download the zip file and unzip it at the place where you want to install it on your hard drive. Then create a shortcut to the program to the desktop and the program is ready for use. It is a so-called portable program which means that it does not use external sources or libraries and does not use the registry. After removing the directory from this program, it has also disappeared completely from your system.

First time use

To practice there is an example4.asm file in the example directory, which you can load after which it will be in the shown in the middle edit window. Now you can convert this into machine code by means of the assemble button, this will appear on the left of the screen and be put into the virtual memory of the emulator. The last (or first) .org statement will also be put in the program counter and by simply pressing the run button you can execute the program and follow it on the screen. This will not be very fast because every instruction will perform a screen update of all registers. If you want the program to run faster, you can disable the update of the registry block by means of the update checkbox. You can now modify the program, reassemble it and run it again.

In de example directory there are also two 8052 Basic versions from Intel that will run fine in this IDE emulator. After the assembler and RUN hit the spacebar (just as in the original autobaud detect) and the prompt will be shown.

There are more example files, a lot of them I made myself when testing the IDE and some I found on the Internet and are free to use.

By means of the step button you can execute the program instruction by instruction and check the output and the registers. You can also enter the break address, the emulator will then stop at a run command at this address and display the registers of that moment. When 0000 is entered in the break field it will be ignored.

You can save the modified code as an asm file again but also save it as a hex file so that you can load the binary code in a circuit or ep(rom) for a real 8052 circuit. You can also read an Intel-Hex file, which will then be loaded into the internal emulator memory. You can also run tis code when you put the correct start address in the program counter. You can also disassemble this internal emulator memory code after which the source code will appears in the edit screen in the middle. This can then be changed and written back into the emulator memory by means of assemble button.

I/O map

The 8052 has no I/O space so the LEDS and seven segment display are mapped on port 1 and 2. You can put the leds on port 1 or 2 and the display on lines port 1 or 2 and character port 1 of 2. You can select this with the top menu, or with some extra assembler directives I added. Look in the example files to see how they work.

  • The keyboard is send to the serial buffer of the 8052 (SBUF) and the display is also connected to the serial (SBUF) of the 8052. I also pulse the character on the RX pin to enable autobaud detect and simulate the hardware as good as possible.
  • Interrupt lines are connected to the interrupt buttons at the top of the screen, when pushed they will activate the interrupt lines.
  • The output ports are shown at the top as input values and output values, they can be modified to test input / output code.

LED I/O modes

In led I/O mode 1 the leds are connected to port 1 and a 1 on the port makes the led light up, directive is ;#LED1

8052 Leds Port1


In led I/O mode 2 the leds are connected to port 2 and a 1 on the port makes the led light up, directive is ;#LED2

8052 Leds Port2

Seven segment display modes

In Seven segment mode 1 the leds are connected to port 1 is select of segment and port 2 is display data. The data is latched so the displays keep their value even if they are no longer selected. Directive is ;#SEVEN12

8052 Seven1


In Seven segment mode 2 the leds are connected to port 2 is select of segment and port 1 is display data. The data is latched so the displays keep their value even if they are no longer selected. Directive is ;#SEVEN21

8052 Seven2

Interrupt pins configuration

The I0, I1 and I2 buttons ar the top of the screen are connected to the interrupt lines to simulate external interrupts.

8052 Interrupts Buttons

User define buttons configuration

There are also four user define buttons on the seven segment panel, these are connected to P1.2 to P1,5 to simulate external switches.

8052 User Buttons

Supported processors

The current version supports the Intel 8031, 8032, 8051, 8052 and Atmel 8952 processor. For the Atmel 8952 processor this IDE had a ISP In Circuit Programming mode, that supports a serial Arduino ISP module to update an 8952 processor from within the IDE. You can edit code, run and debug it on the emulator and then test it on a real 8952 processor. The hardware configuration of the IDE is equal to a cheap 8952 development board from China.

Supported development board

I use this development board, you can order it in my webshop, its very complete, you have to solder it yourself. It had a Zif socket for the processor, a full rs232 circuit, and USB circuit, four pushbuttons and a reset button, am ISP programming connector, eight output leds, a power supply, crystal in socket and all I/O lines on connector pins.

8952 Developme Board

Link: https://www.heinpragt.nl/?product=avr-development-board-kit

Schema of this development board

Development Avr51

8952 ISP programmer using Arduin nano

I created my own Arduino Nano based ISP programmer for the 89S52 processor. I connected it to the Chinese development board with a standard ISP connector cable and I guess this will work on other 8052 ISP development boards as well. I chose this development board because it is very cheap and has a lot of features. And of course an Arduino Nano is small and also cheap.

8959 Arduino Nano Isp

Schema of Arduino Nano ISP programmer

Arduino Nano 8952 Isp Schema

Download Arduino Nano sketch for the ISP programmer.

*) This will also work with an Arduino Uno board!

Version 1.04

I use the 8052_workbench myself and that is one of the way I find and fix bugs. One of the last things I did was recode de TB31.asm file, a complete Tiny Basic interpreter for the Intel 8031 and made it work fine on 8031 with 128 bytes internal ram. During this process I found some little bugs in de emulator and I added a mode to emulate a real 8031 (128 bytes memory checks) to the code. Also I fixed code that would destroy the user interface if there was too much output to the windows. And the most important new feature is the ISP In Circuit Programming option. The example directory now also contains the Intel 8052 floating point basic assembly sourcecode, the complete 8031 tiny basic assembly sourcecode and the paulmon21 assembly sourcecode. I proudly present version 1.04 of the 8052 developer IDE.

Download

Here you can download the latest version if this IDE. This download is a zip file containing a portable x64 (and a x32 version) Windows exe programs, an assembler directory and a examples directory. After weeks of debugging I think the project is ready for release, if you find any bugs please report them to me.

https://www.heinpragt.nl/?product=8052-processor-ide

  • Version 1.04
    • Added full timer 2 support.
    • Added ISP upload feature
    • Change Led polarity to match development board.
    • Added four buttons to LCD panel.
    • Fixed P3 display in register panel.
    • Fixed windows corrupt on to much update.
    • Fixed SETB to handle LEDS correct.
  • Version 1.03
    • Fixed error in IDE update windows that would destroy the IDE context menus.
    • Fixed ADDC flags error.
    • Fixed MOVC A,@A + PC instruction.
    • Fixed DA A instruction AC flag error.
    • Fixed SUBB OV flag error.
    • Added 8031 emulation checkbox.
  • Version 1.02
    • Fixed a last minute change error in the terminal code that made keyboard not respond.
    • Fixed the name of the example directory.
    • Fixed a unwanted quote character in exampkle4.asm.
  • Version 1.01
    • Initial release, it might be not completely bug free, I will test on, wait for remarks amd release the next version soon.


8052 links, tips and documents

More pages on software development

Mc14500a

MC14500B processor IDE

This is a page about my MC14500B IDE program which is an editor / emulator / debugger / assembler / disassembler / ISP programmer for the MC14500B, all in one portable Windows executable. I learned about the MC14500B one bit processor on an Internet forum and I was facinated by this little device. I ordered a PLC14500 board from Tindie and designed mt own hardware, a breadboard design and an Arduino shield version. There ere no real tools but the processor is quite simple and reading the datasheet and the programming manual I wrote an assembler and disassembler and an emulator, then I decided to adap my IDE framework for the MC14500B processor. It took som time to create a fully working hardware emulator for the PLC14500 board and a working emulator for my own board, and I tried to visualize the boards on screen. Then I write my own bootloader for the Arduino Nano and added the ISP option to the IDE so you could upload the code directly to the boards. For development and debugging MC14500B assembler code, this IDE can be used.
Regards, Hein Pragt.

I also have a Facebook Group on Retro Computing and Electronics, feel free to join!

MC14500B editor / assembler / emulator / debugger

Mc14500b Workbench

To be able to program for the MC14500Byou need an assembler or compiler. I like to write (puzzle) in MC14500B assembler but there were no real usefull tools available for for Windows 7,8,10,11. After some searching I decided that it was time for a new project, building a complete integrated MC14500B development environment. I wrote an two pass assembler and used the base code (framework) of my Z80 and 8052 IDE. The result is MC14500B workbench, a portable x64 (and X32) Windows program that includes an editor, assembler, disassembler, emulator, single step debugger, Intel hex write function, a VT100 terminal window and a ISP programmer.

Installation

Download the zip file and unzip it at the place where you want to install it on your hard drive. Then create a shortcut to the program to the desktop and the program is ready for use. It is a so-called portable program which means that it does not use external sources or libraries and does not use the registry. After removing the directory from this program, it has also disappeared completely from your system.

First time use

To practice there is an example directory, from which you can load example programs after which it will be displayed in the editor window. Now you can convert this into machine code by means of the assemble button, this will appear on the left of the screen and be put into the virtual memory of the emulator. By simply pressing the run button you can execute the program on the selected on screen board and follow it on the screen. This will not be very fast because every instruction will perform a screen update of all registers, ports and leds. If you want the program to run faster, you can disable the update of the registry block by means of the update checkbox. You can now modify the program, reassemble it and run it again.

Ifyou have a board connected you can use (select) the terminal window to “talk”to the Arduino Nano, and if you have loaded my bootloader, you can then simply upload the code to the board using the ISP menu. This is also the menu where you select the communication port.

In the main directory there is also the .ino sourcecode file of my custom bootloader for the Arduino Nano. Just load the code in the Arduino IDE, compile it an upload it to the Arduino Nano using the serial cable. You can now check the code inside the Arduino eeprom or do a factory reset (smoketest program) on the board using the Arduino IDE terminal of the terminal of my IDE at 9600 Baud,

By means of the step button you can execute the program instruction by instruction and check the output and the registers and ports. You can also enter the break address, the emulator will then stop at a run command at this address and display the registers of that moment. When 0000 is entered in the break field it will be ignored.

You can save the modified code as an asm file again but also save it as a hex file so that you can load the binary code in a circuit or ep(rom) for a real MC14500B circuit. You can also disassemble the internal emulator memory code after which the source code will appears in the edit screen in the middle. The assembler and disassembler are default loaded with all the friendly names of all the I/O in a standard symbols table. This generated sourcecode can then be changed and written back into the emulator memory by means of assemble button.

I/O map

The IDE currently supports two hardware boards that will be displayed on the screen with working leds and buttons. Inside the IDE is a real hardware emulation of the complet circuit of the board and all the chips so it should work exactly as the real hardware. My board is not yet ready but I am using this tool to debug it. My board will support JMP and RTN instruction with a ONE level stack :-). With the top menu you call also connect te VT100 terminal to the input and output lines of the board, this will be useful on my board.

Version 1.02

Version 1.02 is the second version with some improvements after testing with different hardware. I will be maintaining the program based on my own needs, bug reports and feature reuests.

Download

Here you can download the latest version if this IDE for a small fee. This download is a zip file containing a portable x64 (and a x32 version) Windows exe programs, an examples directory and my custom Arduino Nano boatloader sourcecode. After weeks of debugging I think the project is ready for release, if you find any bugs please report them to me. The progams are digitally signed using my codeding certificate for your safety and to make them thrusted by Windows. It seems my IDE programs work fine on (Linux) WINE as well.

Download at: https://www.heinpragt.nl/?product=mc14500b-processor-ide

  • Version 1.02
    • Fixed error in hex dump bootloader (16e byte);
    • Improved ISP uploader for PLC14500 board;
    • Improved ISP uploader for HP14500 (Arduino shield) board;
    • Fixed terminal bug in HP145000 emulation.
  • Version 1.01
    • Initial release, it might be not completely bug free, I will test on, wait for remarks amd release the next version soon.

MC14500B links, tips and documents

More pages on software development

Health Mon

Http health check monitor

Hein Pragt Http health monitor As a technical application manager I face the problem of having a complex application with many servers and lots of api services, and sometimes one or more of the many http servers or rest api’s fails. There is excellent tooling to monitor an application farm but a lot of companies do not invest in this kind of health check maintenance tooling especially not in de development area. Giving the fact that a lot of technical maintenance is done by the devops team and they also don’t have the health check tooling to monitor the servers. I am a programmer so decided to build a small portable dotnet program that could generate a real time status view of all the http(s) services in an application suite. It is a simple http server that will run on any chosen port (default 8080) and it reads a simple xml file with a list of url’s it has to poll and what result status code is expected. When the expected status code is returned it will show a green bar and when the status is different it will show a red bar with the server name and the http error code. The program is a simple x64 DotNet 4.6 console application that you can run from the command line, or at server startup, from a scheduled task.

It expects a settings.xml file and a style.css file in the same directory, the xml file contains a list of all the url’s the program has to poll. It looks like this:

<servers> 
  <server> 
    <group>Dev</group>
    <name>Server one VM00345:8080</name> 
    <url>http://www.system1.com:8080/health</url>
    <valid>200</valid>
  </server> 
  <server> 
    <group>Test</group> 
    <name>Server one VM00347:8081</name> 
    <url>http://www.sever11.com:8081/api</url> 
    <valid>401</valid> 
  </server> 
  <server> 
    <group>Test</group> 
    <name>Server two VM00385:80</name> 
    <url>http://www.apigate.com/test</url> 
    <valid>200</valid> 
  </server> 
</servers>

To give users a chance to change the layout or colors of the healt monitor screen, an external css file is provided, it will be read at startup. It only contains the basics, but if you f.i. use short names you could change the width of the blocks (entry) so more blocks can be displayed on a singe screen. It looks like this:

.ok { background-color: lightgreen; } 
.error { background-color: red; } 
.entry { width: 320px; padding-left: 8px; padding-right: 8px; margin-left: 4px; border: 1px solid gray; float: left; } 
.header { font-size: 1.5 em; padding-bottom: 4px; margin-bottom: 4px; } 
.timestamp { font-size: 0.6em; } 
.groupend { clear: both; } 
.groupbar { width: 99%; color: #ffffff; background-color: gray; margin-top: 6px; }

Since version 1.09 there is a config.xml file where some configuration settings are stored in simple name value format. The commandline port will still overide the config.xml setting.

 <settings> 
   <setting> <name>Port</name> <value>8080</value> </setting> 
   <setting> <name>TimeoutMs</name> <value>2200</value> </setting> 
   <setting> <name>Title</name> <value>Development</value> </setting> 
</settings>

Every time you send a GET request to this health check monitor program the internal http server will poll all he url’s and generate the html status screen. It will not poll until the next GET request, the date time stamp of the last request is in the top of the screen. This http health check program is KISS (keep it simple stupid) and does what it has to do and nothing more. Its portable and does not need installation and it runs anywhere you put it. It only needs the dotnet 3.1 (or higher) installed. The program is closed source, freeware and without any warranty whatsoever. But I use it myself and I think it’s simple, stable and safe. Any recommendations for improvement are welcome.

Download the zip file of the https health monitor program and unpack it in a (logical) folder on your disk drive, I use a folder named portapps in the root folder of my C drive. Run the http health check monitor program by hand (the argument can be a different port number), double click it for the default port and it will start a console application. As long as this console applicatio is running the http server is alive. In the console window it will log all the things it does, including more details on the response codes. Start you browser and type: http//localhost:8080 and the status screen will be displayed in you browser. The timeout on every request is 1.5 seconds, so if a lot of servers are down, the response screen will take a while to load. If you open the port number in the firewall, the http server can also be used on another (client) computer.

Versions

Version 1.09 – Feb 2021 – new features.

Here you can download the zip file with the lates version 1.09 of the HmPHealtheMonitor.exe portable Windows ™ health check monitor program. The executable file is digital signed with my heinpragt.com codesigning certificate. Read the intructions to use above.


Download: HmPHealthMonitor109.zip

Release notes

  • 1.03
    • Initial release
  • 1.04
    • Add timeout of 1.5 sec.
    • Now listening on any IP
  • 1.05
    • Added support for old and invalid TSL/SSL versions.
  • 1.06
    • Added explicit GET methode.
    • Improved error handling.
  • 1.07
    • Improved TSL/SSL handling.
  • 1.08
    • Fixed bug in 404 errorhandling.
  • 1.09
    • Added configurable timeout value for each call.
    • Added a configurable title for the header.
    • Added a config.xml file.

Known issues

  • The windows defender program will sometimes block this program, just right click the exe file and click run anyway.
  • The Avast virusscanner sometimes gives an alarm, I double ckhecked, it is a false positive.

How to install the Health monitor as a service in Windows ™

When you want this health check monitor to run at a Windows server at startup, one way is installing it as a server and set the startup mode to automatic. This also gives the opportunity to run it under another account. There is a nice open source wrapper that can run ANY windows executable (but also runnable jar (Java) programs) under windows as a service. You can find the binary distribution (but also the source code if you need it) at Github, it is the WINSW project for dotnet version 4 with the name: WinSW.NET4.exe, Jus Google it and download it from Github. This is a short manual for this purpose, you can also use it for other programs.

  • Copy the file to the directory containing the executable.
  • Rename the file WinSW.NET4.exe to HmpHealthSrc.exe.
  • Create a xml file with the (same) name HmpHealthSrc.xml.
  • Edit this file and change the content to this:
<service> 
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>HmpHealth</id> 
  <!-- Display name of the service --> 
  <name>HmpHealth WinSW</name> 
  <!-- Service description --> 
  <description>HmpHealth on port 8080</description> 
  <!-- Path to the executable, which should be started -->
  <executable>E:\HealthMonitor\HmPHealthMonitor.exe</executable> 
  <arguments> </arguments> 
</service>
  • To change the port, just put it in arguments.
  • Open a CMD shell and go to the HealtMonitor directory.
  • Type: HmpHealthSrc install to install the service.
  • Open the service manager and check i fit is set to autimatic and start the service.
  • Check, using the browser if the Health Monitor is running.

WINSW commands:

  • ‘install’ – install the service to Windows Service Controller
  • ‘uninstall’ – uninstall the service
  • ‘start’ – start the service (must be installed before)
  • ‘stop’ – stop the service
  • ‘restart’ – restart the service
  • ‘restart!’ – self-restart (can be called from child processes)
  • ‘status’ – check the current status of the service
  • ‘test’ – check if the service can be started and then stopped
  • ‘testwait’ – starts the service and waits until a key is pressed then stops the service
  • ‘version’ – print the version info
  • ‘help’ – print the help info (aliases: -h,–help,-?,/?)

More pages on application software

Cpm22

CpmBox a CPM 2.2 emulator

The second operating system I used (after TrsDos) was CPM on a Z80 development machine. Some time ago I build the Z80 MBC2 board and I played with CPM again. I included a fully working MBC2 emulation in my Z80 IDE program but after using DosBox I got the idea of creating CpmBox. CpmBox is a full CPM 2.2 implementation on a Z80 emulator for Windows, including a VT100 terminal and 8 CPM disks based on the MBC2 with the looks of a real terminal. It is a portable windows program (one single executable) and the zip file contains the emulator, a directory with a lot of disks and the bootdisk and a dos based directory to load CPM files from and to dos. It is also possible to save and load programs from dos and save or load them to a CPM disk. It is freeware and I hope you like it. . Regards, Hein Pragt.

Copyright

I respect copyright and I will not distribute illegal software. Part of this program was inspired by the Z80 MBC2 project and the boot disk and bootloader are from this project. I kept them as they are. The CPM disks are filed with old CPM based software I had in my collection and I filled the first 6 disks with all kind of software. Legally some of this software maybe is still copyrighted BUT in my opinion the copyright was from 40 to 45 years ago, these products have not been on the market for a lot of years and I think that most company’s will not complain. I do not ask any money for this package and the main goal is to keep the old spirit alive. I anyone can identify him or herself as a legal copyright owner and has problems with the distribution I will remove that content. But I seriously believe there is no one to object to distributing these old artifacts as freeware. My program itself is closed source but freeware.

What is inside this emulator

Cpmbox2

This emulator is exactly like a Z80 MBC2 computer running CPM 2.2 (without the i/o chip) and connected to a VT100 terminal.

  • Emulates: Z80 and VT100 terminal;
  • OS: CPM 2.2;
  • Keyboard: full 53 keys emulated by the PC keyboard;
  • CPU: Zilog Z80 the speed is depending on the PC hardware;
  • RAM: 64 kb;
  • Textmode: 24 x 80 characters;
  • Graphics: None;
  • Color: White on green screen;
  • Sound: None;
  • I/O: 15 CMM disks and access to DOS disk;
  • Design: Like an old terminal screen.

Download

Here you can download the latest version if this CpmBox emulator. This download is a zip file containing a portable x64 (and a x32 version) Windows exe programs, a directory with CMP disk images and a directory for DOS based CPM files. It is a portable program, just unpack it somewhere on the disk and start it by clicking it. This program is digitally signed with my own code certificate and it is trusted by Microsoft windows.

Download x64 (and x32) version 1.01 of CpmBox (2022)

  • Version 1.01
    • First (beta release) version, the program has been testen by myself on my hardware.

CPM disks

I made some disks for this program and I got a question about how to make and maintain the disk image files. I have searched for a solution myself for a while until I found a utility program called cpmtools. But it were command line tools and not so user friendly. Then I found a gui for this toolkit and although the visual views are sometimes a little strange because of misinterpreted characters, it works fine. I zipped the complete directory as it is on my disk, including the correct disk definitions. You can download it here. Just download it and unpack it somewhere at your harddisk. Just doubleclick: CpmtoolsGUI.exe.

Cpmtools1

First you select a disk image in the upper left corner (or create a new one) and then you select the disk format. I use the disk formats of the MBC board project, use d0 for bootdisk 0 and d1 for alle other disks. You can now select the directory on you own harddisk in the right corner and you can select a file in the cpm view of the dos view and use the buttons to mover them from dos to cpm, or from cpm tp dos. I can read other cpm disk formats as well. This way you can create your own cpm file repository on your hardisk and copy them to the cpm disk images. This tools is not that user friendly and not very beautiful in UX but ir works fine for me.

More pages on emulator software