The circuit is remarkably simple. Besides the MCU and display, only 4 resistors, a capacitor, and a button are required. I would also toss in 2 decoupling capacitors on the power supply line. You can find the full article republished on many websites by searching for "PIC 16C54 dice".

If you look into the source code, only one current limiting resistor per digit is used by the trick of turning on one segment at a time. This is in addition to the digit multiplexing so each segment runs at 1/14th duty cycle. The PIC can easily source or sink 20mA so this drives the segment at about 1.5mA average which is enough for modern LEDs.

The assembler source code for the dice was readily found on the Internet. A hitch was that it was written for MPASM. Recent releases of XC8, the toolchain for the 8-bit PIC family use PIC-AS instead with slightly different syntax. (This accounts for some expressions of unhappiness on forums.) Fortunately Microchip has written a migration guide. In the case of the dice code, the main differences were:

  • Colon after name of variable or code label.
  • Different syntax for numeric constants.
  • Different syntax for specifying chip config options.

After making these changes and cleaning up the formatting a bit, I was able to assemble with pic-as. You will find the code in the Files section. A tip: to get listings, add -Wa,-a to the pic-as command options in the project configuration.

If you decide to try this on other PIC chips, remember to adapt the reset vector. The 16C54 and 16C55 both have 512B code memory (the 55 has more I/O pins), but the 16C57 has 2kB, and will need adjustment of the ORG for that vector.

Also notice the distribution of the segments to port pins is not a simple segment a is LSB or MSB, but rather motivated by the physical layout of the pins.

But I have decided to shelve this project. I'm doing a quick writeup to publish my cleaned up version. The main reason for shelving is I couldn't find any 2-digit common cathode displays in my junk box. It's not as if I would have to skip lunch to order some, they are so cheap, but I don't really need dual dice in my life, this is all just play, so I might wait until buying some other semiconductors to piggyback an order. The other hitch is that my chips have OTP ROM, so I get only one chance to burn the code. (You can find flash versions of those MCUs readily. Or substitute a modern member of the family). But the dice code should work as-is (famous last words).