Close

RetroChallenge Log Entry #1: MPF-GRAFX works with the ATmega1284p @ 16 MHz

A project log for 3D Graphics on the Microprofessor MPF-1B

RetroChallenge 2025/10 Blog

michael-wesselMichael Wessel 10/16/2025 at 15:350 Comments

To support double buffering for the rotating cube, we will need more (video) RAM. Currently, MPF-GRAFX is using an ATmega644p @ 20 MHz. The 1284p is fully pin- (and software?) compatible but has four times the SRAM amount (16K instead of 4K). That's actually twice as much as I thought - nice! And should give us plenty of video SRAM to support double buffering (and maybe even for a color display?) for the Adafruit graphics library being used here. 

So, I swapped the ATmega 644p @ 20 MHz with the 1284p. If was hoping it would run out of the box, but: 

It didn't even initialize the SPI display. Something was wrong. Fuses maybe? Maybe MightyCore didn't work well enough for the 1284p? Maybe the Adafruit Library? SPI speed? I changed the display initialization sequence

  tft.initR(INITR_BLACKTAB);
  //tft.setSPISpeed(1000000);

 trying various settings, with and without explicit SPI  speed setting. Nothing worked. 

OK, so maybe starting ATmega with the SPI display (which is complex) and expecting this to work out of the box isn't the best debugging strategy. So, does the thing run *at all*? It's always good to have a couple of LEDs on board... so before starting up SPI and the display, I put some code in to flash the LEDs as the first thing in "setup" to see if the ATmega was running code at all. And - nothing! So, something was fundamentally wrong. 

My next guess was - maybe I (accidentally) bought a 16 MHz one, and the 20 MHz clock was simply too much and on the edge of this design. So, I swapped the 20 MHz crystal with a 16 MHz one: 

and changed the clock settings in MightyCore accordingly: 

To my relief I could now see LED activity upon boot, and even the display initialized correctly!  Phew!

But, would it work with the Microprofessor? Let's see: 

Alright, we are all set now for working on the firmware to support double buffering and can indulge ourselves with Z80 programming as well, trying to port the rotating 3D cube to the Microprofessor and GRAFX card now. Seems the hardware side of things is done - I would call that progress! 

Stay tuned, the next update is coming soon (hopefully, before the RetroChallenge RC2025#10 runs out ;-) )

Discussions