Spark + eInk/ePaper?

I believe those pins are for the fancy font chip on board the seeedstudio shield. You can leave them not connected.

My ability to forget to post that library is really impressing me. Sorry!

1 Like

M_/WORD_STOCK_CS pin is arduino pin 9. in ‘Small_ePaper_Shield/GT20L16_drive.h’ @harrisonhjones: I just wonder, because I haven’t the shield myself, if the fontchip is any useful? It looks that the chip is used in some of the examples. Shouldn’t the chip select pin be connected then?.

M_CKV is connect to a optional(?) 4.41inch EPD according to the schematic i.e not connected.

If you want to use the font chip then yes, you need to connect the pins to the correct locations. I didn’t find it that useful given @peekay123’s GFX font library port thingy

@androw72, thanks! :smile: How did you flash your Core? Via CLI / Spark Dev / …? – I am trying to find the right setup for this and outside the Web IDE it’s getting a bit more complex than a simple arduino environment.

@harrisonhjones, no worries! Just to have the right idea: do you intend on posting the Seeedstudio library to Spark as a contribution to the Web IDE? And what is this “GFX font library port thingy”?. This one?: https://community.sparkdevices.com/t/new-adafruit-mfgfx-multifont-library/4156

Once again, thanks for alle the troubles and n00b questions!

Well I thought the web ide was good when I wanted to find new libraries. Then I went to spark dev. I still use that because of neat features like serial monitor and the wifi setup to the spark core.

But then to get full control I guess there is no alternative than a real IDE.
There is a great guide on this forum. I followed the video and got it right after a while.

Wow, super helpful tutorial. Thanks for the link. After reading and watching the video I was wondering if I really need to go the super advanced way to include custom libraries locally. I was searching for a “how to get things right with spark dev” kind of tutorial within the community but I wasn’t lucky. And I am not only talking about a project boilerplate but also how to set up the files and folders. Guess I just have to fiddle my way through. :wink:

If you find a way to use the spark dev I think it’s a great idea. Really simple and straight forward… (hopefully…:slight_smile: The only files (except your application) you should need to include from github/spark-ereader are EPD.cpp, ereader.cpp. And also reference the sd.card-library.

Thanks, @androw72. And I think this hint by @harrisonhjones: https://github.com/harrisonhjones/Spark-Ported-Libraries concerning a workaround for the “Arduino.h: No such file or directory” error I got might also be helpful. Gotta try that in a bit.

How did you lower the speed on the SPI interface? I looked at the code, but I don’t know what I’m looking for.

@mattdot http://docs.spark.io/firmware/#spi-setclockdivider

I used SPI_CLOCK_DIV16. (in ereader.cpp) That gives 4.5MHz speed. If I remember right the repaper display works up to 12MHz.

Hey @androw72 I just tried your git “spark-ereader” but it didnt work and I dont know why…
Is there a kind of tutorial for your library?

I saw that I by misstake have written in the ‘spark-ereader’- readme that the pwm should be connected to D5 as in the original post but it should be connected to A7 to make it work correctly.

Here is an instruction. Hopefully it can give some more explanation.

2 Likes

I don’t get this working with my setting, @androw72 – I got the seeedstudio board as you know and I used your spark-seeedstudio-epaper library port as a starting point. I don’t know wether the problem is that I use SparkDev? I didn’t want to set up the whole local dev netbeans thing. But SparkDev is very picky concerning folders and how files are organized, indeed. I had to put all needed files (includes/resources) into the root folder and delete all files that didn’t seem to be used to be able to compile without errors. As your library port wasn’t including examples, I assumed that the examples from the wyolum/epd lib might work here as well. No luck so far: https://github.com/HrMense/ePaperFrame

@harrisonhjones would you mind me taking a look at your seeedstudio library port? I got the panel/display working with an arduino and the original seeedstudio libraries in very few simple steps. How did you set it up / compile? Did you use SparkDev? How did you get it running? Thanks you very much in advance for your help —

It’s nothing wrong with the code on my setup! And the spark dev works.

I downloaded your github directory. Put all your files in one directory. Open spark dev and the folder with all your files. Compiled in the cloud. It compiled OK. And run perfectly on my spark core with the epaper I use from adafruit (epd from pervasive display).

You can perhaps put some debug code prints to the serial in the source code, and monitor the serial. Does the sd-card init correctly? Does the ereader.setup work correctly?..

Cool, good to hear that the code/compiling works. Thanks for testing that. At least I know now that I am on kind of the right track. :slight_smile: Thank you, sir!

Just to clarify: compiling/flashing worked for me but the screen remained blank nontheless. Adding some debug code prints is a good idea but aside of that I think I got to use a different SD library, since the seeedstudio board has it’s own unit onboard. I found the same seeedstudio sd_epaper.h/.cpp in your repo, did you port those as well? Looks as if some things are arduino specific but I don’t know wether that is important. Plus, I added some information how I hooked up the board – just to make sure I got everything right.

No problem, you’re welcome. Always interesting to see what the problem could be.

Yes, I ported the seeedstudio library to test on the adafruit EPD. The only thing I think is going on with the arduino stuff in those libraries is that to be able to use the internal sram of the spark. I put the ATmega1280 flag to ‘1’. That will reserve 5808 bytes of memory for the image.

What I can understand from your Readme is that you didn’t connected the SPI interface between the spark and the seeestudioEPD. spark pins A3, A4, A5? (Actually I just added thoose pins in my seeedstudio repo readme…!)

I was finally able to continue working on this. I think I labeled the table confusing. SPI is connected. But the ePaper panel itself doesn’t provide SPI, it’s the shield that has to be connected. I corrected the naming in the readme.

Without changing the setup the console gives me the following error message:

rd::init()
SD initialization failed!!
SD_CS12
Could not open file: __ EPD__.DSP
ERROR_CODE: 1

Aside of that the ePaper panel starts to get dark blurry stripes when I switch on the external power source (the panel apparently needs 3.3V AND 5V in, spark core only provides 3.3V). That actually worries me, I hope that I don’t fry something by accident. I double checked the connections and they seem to be right. :worried:

Concerning the code: I thought the whole thing over once more. You, @androw72, surely did port these libraries but you also made the project work with your repaper board. In my last attempt I did kind of the same, trying to resolve the errors sparkDEV reported. I used Wyolum example code to start with and I sort of built a project working for repaper boards – which you confirmed.

As I don’t know the exact difference between those two boards but I do know that my seeedstudio board works just fine when it’s connected to an arduino using the dedicated libraries and sample code, I decided to start from scratch using the example code from seeed. I added one by one all libraries sparkDEV reported missing – of course including your ported ones. I resolved the redundance between SD.h and sd-card-library.h which contain basically the same.

It compiles successfully but when I flash it to the Core it flashes red 8 times, complaining about a “out of heap memory” error. Now where is that coming from!? I set the ATmega1280 flag to “0”, no changes. Oh boy. What now?

The error you got seems to happen when spark can’t communicate to the sd card. I pulled out the sd card, run the spark ereader code and got the same error. I would probably test a SD card example (i.e ‘spark-cardinfo.ino’ in the web ide) and debug that to see if it works.

Regarding the the power, the seeed shield has an automatic select between 5V and 3.3V so you shouldn’t need to connect both. Looked that way anyway when I checked the eagle schematics.

I tried to run your code again but the .cpp files were gone in the repo. So I couldn’t reproduce your memory error.