Category: Programming

  • Revisiting the MinAttak chess problem

    I blogged about my old Java Applet for the chess minimum attack (dominance) puzzle previously here. But of course Java Applets are now deader than a very dead thing that’s also been poisoned, burnt, and crushed.  I’ve been playing around trying to learn a bit more JavaScript, and as a learning exercise, I coded up…

  • Decoding FrSKY telemetry data with an Arduino – Part two

    In part one, we looked at the standard FrSky ‘D series’ data packets that provide voltage and RSSI information.  In this part two post we’ll consider the data format used by standard FrSky telemetry add-ons and how to decode the data from those without using a Taranis transmitter or a commercial display unit.  In part…

  • An Arduino-based programmer for the AT89C2051 chip – part 2

    Here’s the software necessary to work the programmer board: Arduino sketch (for Arduino Mega 2560) PC program Here’s a screenshot of the program in operation.  It should all be fairly self-explanatory.  Please send me a comment if you have any problems or questions. Update January 2021. Thanks to Marco Almeida, who built one of these…

  • An Arduino-based programmer for the AT89C2051 chip

    The Atmel AT89C2051 is a low cost microcontroller in a 20-pin DIL package.  It runs MCS-51 (commonly termed ‘8051’) code.  It works from 2.7V to 6V at anything from 0 Hz up to 24 MHz.  It has 2K bytes of Flash memory to hold the program and 128 bytes of RAM.  It has 15 I/O…

  • POV source code – part 3

    If you’re trying to compile the source code with the Keil compiler, you’re probably getting error messages about ‘undefined identifier’ or similar.  This is because the standard Keil reg52.h header file doesn’t define all the necessary identifiers for the STC89C5x chips. We need to define the special function register (sfr) P4 = 0xE8; so the…

  • POV source code – part 2

    Clock interrupt The STC89C52 has three timer/counters (most of the 8051 chips have the first two, and the third one is pretty common).  One of the modes for timer 1 is to count clock pulses in an 8-bit register and when FF is reached, reload the count register from a separate 8-bit register.  Each time…

  • POV source code – part 1

    These posts relate to the previous few concerning the Banggood kit: Cross LED Dot Matrix Display Circuit Board Rotating Electronic Kit It uses an STC89C52RC microcontroller which is a (fairly) modern Chinese version in the 8051 family. You can program it in assembler, but I chose to use the C language for this project. The…

  • Cheap POV (persistence of vision) clock kit

    These kits are available on Banggood.com for about $11 shipping included.  Tricky soldering, and they don’t come with any instructions.  There are instructions available on the website – but not unless you read Chinese.  The pictures on the website help though. Anyway, I recommend the kit.  Even if you can’t get it working properly, it’s…

  • ISP programmer for the STC89C51 and STC89C52

    I couldn’t find an ISP (programmer) for the STC89C52RC that worked with modern versions of Windows. I found several programmers that work with other chips in the STC range. I did find one that worked on Windows XP, and with some hacking got it to work with Windows 7; however I had no luck with…

  • Fast, small, and simple Arduino SPI RAM chip routines.

    The 8-pin chip, 23LC1024, is a good candidate for adding extra RAM to simple Arduinos such as the Uno, Nano, Mini.  It provides 128K of RAM (the ATmega328 chip that these Arduinos use only has 2K of internal RAM). The chip works at 5V (anything from 2.5V to 5.5V) and uses SPI so it only…