Transfer Arduboy sBuffer via SPI to drive an LED matrix

But @Mr.Blinky’s bootloader gives you an extra 1K of program space.

@dxb is the boot loader stuff that @Mr.Blinky did similar to what you did to help us squeeze out 1k?

The Arduboy uses Pin 12 to control CS (SS) instead of Pin 10. However, the dispaly always remains selected, so it’s not really necessary.

1 Like

@Mr.Blinky’s bootloader is a replacement bootloader which takes up (I believe) 3k instead of 4k so you get extra space but cannot rely on that feature outside of your dev hardware because end users can’t really be expected to update their bootloader.

EDIT: even with the extra 1k the arduino code USB serial will not fit in progmem with evade2

Given what you know about the innards of Evade 2, is it worth swapping? this is a bit above my head :stuck_out_tongue_winking_eye:

@JayGarcia i’ve Been packing all sorts into Dark & Under and I have the programming skill of a grapefruit.

1 Like

@Mr.Blinky created a reduced size bootloader that gives you and extra 1K of program space regardless of the contents of the sketch. Any Arduboy sketch loaded into an Arduboy with his bootloader installed, and using the matching boards.txt file, will instantly have 1K of space available.

1 Like

I do not think the arduino core USB serial will not fit in progmem with evade2 even with @Mr.Blinky’s bootloader. You need almost 3k of progmem for that.

1 Like

I had my wires completely crossed. Thank you

Ah! Thanks. Back to SPI it is for me. :stuck_out_tongue_winking_eye:

But you could hook up a USB to TTL serial converter to the Leonardo’s RX and TX pins and use Serial1.

I think using SPI and emulating the display controller on a more powerful slave has several advantages over the serial approach anyway:

  • no need to recompile games with custom libs to make them work on your HUGE screen
  • if the game fits the arduboy it will fit your setup
  • nice decoupling: changes to your display will only require changes to the slave SPI device

Agreed, except a more powerfull (faster) slave could be an issue for @JayGarcia.

Yes, I meant mainly faster :rofl: I don’t think the uno can work as a slave for @JayGarcia because the LCDs he is intending to use don’t do PWM they are just “shift and latch” LED arrays so the slave has to do a lot of bit-banging really fast to achieve a decent refresh rate.

I agree with you 100%.

Even at 1FPS for this POC, i still have the issue stated in the above post. :frowning:

Did you slow down the SPI master clock (i.e. Arduboy) to CLK/4 as suggested by @MLXXXp?
Slowing down the controller memory refresh to 1FPS only reduces the amount SPI words transmitted in the time unit, it doesn’t slow down the SPI clock. i.e. each SPI word is still transmitted at CLK/2.

I haven’t done any specific research, but I’d look into using an Arduino Zero (or something with the same processor), or a Maple clone, to see if either would be capable.

To do this you have to change bootSPI() in Arduboy2Core.cpp, or just rewrite the registers in your sketch.

For 4 MHZ:
SPSR = 0;

For 2MHz:
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR0);


Thank you SO MUCH for this. I was scouring the net on how to do such a thing but only found specific examples that requires the SPI library and method calls. None of them worked by injecting those calls into the library.

SCOTT!!! You’re the effing man!!!

Going to post a video shortly. ;D

1 Like

More work to be done but this was yyyyyuge with a Yeh!