• Digikeyboard with LEDs

    03/08/2020 at 20:25 0 comments

    I have just added support for LED status on Digispark Keyboard library.

    Now to get the LED status is just a matter of calling the function



    and test for one of the 3 contants:




    Just like in the example

    // USB Caps Lock Led gizmo - Danjovic 2020
    // Use modified version of DigiKeyboard library
    // https://github.com/Danjovic/DigistumpArduino/tree/master/digistump-avr/libraries/DigisparkKeyboard
    #include "DigiKeyboard.h"
    void setup() {
      pinMode(1,OUTPUT);      // Digistump BuiltIn LED as output
    void loop() {
      // Check the state of Caps Lock and change led accordingly
      if (DigiKeyboard.getLEDs() & CAPS_LOCK)
          digitalWrite(1, HIGH);
          digitalWrite(1, LOW);

    The modified version of the libraries are available at:


    It is necessary to get the 3 files below...

    • DigiKeyboard.h
    • usbconfig.h
    • hidkeys.h
    The latter file enhances the keystroke definition of the original project and defines full set of HID Keycodes (from 0x00 to 0xE7).

    .. and copy the files to the following path


  • Time precise method to provide analog position to ATari 5200

    03/05/2020 at 04:07 0 comments

    This is another method for providing analog position to Atari 5200 that does not depend upon internal calibration.

    The analog controller information is measured by Pokey chip that measures the time a capacitor takes to increase its voltage from near zero to a given value. This time varies with the resistance of the potentiometer axis.

      Many videogames and computers, like ATari 2600, PC gameport, Apple][ gameport usually discharges the capacitors right before start a new reading cycle. On these systems is just a matter of waiting for the capacitors to discharge to know when to push the line high to provide a desired position (timing) information.

      But in Atari 5200 that is not so easy because Pokey chip keeps the capacitors discharged by until the next sampling cycle that depends upon the game loo, therefore the discharge moment can not be used as a time reference.

    The experiments that I have done consisted in:

    1. polarize one of the pot inputs with a resistor that provides a low counting, e.g. 10KOhms and detect the voltage increase before it reaches ~1.9V that is the input threshold voltage of POT pins in Pokey Chip.
    2. Then the line is forced LOW by the time enough to provide the desired counting in Pokey chip.
    3. Finally the line is pushed high to exceed the threshold voltage and that makes pokey capture the exact counting.

    Worth to mention that this method does not depend upon internal calibration of Vac voltage (at pin 9).

    The links [1][2] are for two videos with the first experiments. The tests have been performed on a AVR (Arduino board) together with the #Atari 5200 Controller Port Emulator 

    image.thumb.png.1fbab83ac90a6d604670509e901ffcb0.png image.thumb.png.ebbda832fb9ee8958bdf301758054913.png

  • Another Atari 5200 controller adapter concept

    01/24/2020 at 04:49 0 comments

    MegaPlay adapter lets you play Atari 5200 using a 6 button Sega Genesis controller yet providing full keypad control.

    The circuit can be built using an Arduino Nano and two analog multiplexers. Interface with analog joystick can be borrowed from "Low Priced MasterPlay clone adapter".

    Keypad presses can be emulated by activating a pair of analog multiplexers. This scheme allow the simulation of 1 (one) keypress at a time, but frees the software from critical timing. 

    Buttons can be mapped as follows: