Nicolas Electronics

Electronic projects and programming

CHIP-8 Emulator

Hey, it’s been a while since I posted something new here.

I’ve always wanted to try my hand at an emulator and didn’t want to start with something too difficult like a true retro console. I searched for something to emulate and found out about the CHIP-8.

It has 35 different instructions encoded in a 2 byte opcode, 16 one byte registers, 2 timers, a hexadecimal keypad, a memory of 4096 bytes where the program starts at address 0x200 and a screen with a resolution of 64 pixels by 32 rows. The display buffer starts at 0xF00 and ends at 0xFFF.

WS2812 LED driver on a 16F876A @20MHz

Someone on the matrix multimedia forum (French) needed to drive some WS2812 LEDs and wanted to use a 16F876A at 20MHz to do so.
The WS2812 LEDs are RGB LEDs with an integrated controller chip. There’s a data input and data output so you can cascade multiple LEDs by connecting DO to DI of the next LED. Each LED reads 3 bytes, being the value of the color green, red and blue.
Once you’ve sent a color to the LED, it will stay that color until you send another code.

Driving the LEDs would require timings in the 50ns/100ns range, but you can stretch it just a bit.
This is one of those things where timing is pretty much crucial and an AVR would be a better microcontroller for this as it executes one instruction per clock cycle where the PIC needs 4 clock cycles per instruction.

DCF77 Radio Clock

In 2009 I made a DCF77 radio clock for my final years project. I used Flowcode to program the radio clock back then.

Today, I’ve rewritten the code in C and I used the free version of the XC8 compiler to compile it.
I’m using the Winstar yellow 16×2 OLED display and my library to display the time and date.


Previous Posts

Theme created by Powered by