Close

Config download library for arduino (and all others)

A project log for DIPSY

DIY System on Chip based on FPGA, priced below 5 USD

christophChristoph 08/29/2015 at 22:331 Comment
The iCE40UL can be programmed in three main ways:

The second option is easy to implement, and it's already done! Here's the repo: https://github.com/crteensy/dipsydownloader

Currently there's only one way of getting your config into the DIPSY: Add it to your C++ code as an array. The consequence of this is that the array must fit into your microcontroller's program memory. This is not a problem on larger chips (the config is about 32 kB), and we will come up with examples for smaller ones as well. An external EEPROM or an SD card come to mind.

Enough talking, here's the main part of the current example (also in the repo):

static const uint8_t DIPSY_CRESETB = 0;
static const uint8_t DIPSY_CDONE = 1;
static const uint8_t DIPSY_SS = 2;

SPI.begin();

extern const uint8_t top_bitmap_bin[];
extern const uint16_t top_bitmap_bin_len;
dipsy::ArrayConfig config(top_bitmap_bin_len, top_bitmap_bin);
if (dipsy::configure(DIPSY_CRESETB, DIPSY_CDONE, DIPSY_SS, SPI, config))
{
  Serial.print("config done");
}
else
{
  Serial.print("config error");
}

SPI.end();
Simple enough, I hope.

dipsy::configure() is a function template that will chew *a lot* of different config source and SPI implementations.


Discussions

Eric Hertz wrote 08/30/2015 at 05:46 point

looking quite simple, indeed!

  Are you sure? yes | no