Tags:
create new tag
view all tags
%DASHBOARD{ section="dashboard_start" }% %DASHBOARD{ section="banner" image="%PUBURLPATH%/MecrispCube/EInkFeather/epd_header.jpg" title="E-Ink !FeatherWing, E-Paper Display EPD" titlestyle="color:#F00000;" }% %DASHBOARD{ section="box_start" title="Intro" width="485" height="250"}% The Adafruit 2.13" EPD display #4195 has a 250x122 resolution (there are others e.g. 1.54" 200x200, 2.9" 296x128), that's enough for about 15 lines and 40 characters. Driver [[https://github.com/spyren/Mecrisp-Cube/blob/master/Forth/Src/epd.c][epd.c]], fonts from https://www.mikrocontroller.net/topic/54860. [[https://en.wikipedia.org/wiki/Code_page_850][Code page 850]] <img src="%PUBURLPATH%/MecrispCube/OledDisplay/Codepage-850.png" alt="Code page 850, 9x14" /> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" title="Contents" width="460" height="250"}% %TOC% %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="400" }% ---+ EPD and SPI Words =epd-emit= works like the standard word =emit=. It blocks the calling thread, as long as the character is not written to the EPD display. Horizontal (x) position is in pixel (0 to 249), vertical position (y) is in lines, a line consists of 8 pixels. 0, 0 is upper left corner. Larger fonts takes more than one line. <pre> epd-emit ( c -- ) Emits a character (writes a character to the EPD framebuffer) epd-emit? ( -- ? ) EPD ready to get a character (SPI not busy) hook-emit ( -- a ) Hooks for redirecting terminal IO on the fly hook-emit? ( -- a ) epdpos! ( x y -- ) Set EPD cursor position, x horizontal position, pixel resolution, e.g. 0 to 249 for 250x122 displays. y vertical position (line), max. 15 for 250x122 displays. epdpos@ ( -- x y ) Get the current EPD cursor position epdclr ( -- ) Clears the EPD display, sets the cursor to 0, 0 epdfont ( u -- ) Select the font, u: 0 6x8, 1 8x8, 2 8X16 , 3 12X16 epdupdate ( -- ) Update the display (copy the framebuffer to the display) epdstartpart ( -- ) Start the partial update for the EPD display epdupdatepart ( -- ) Update part of the EPD display epdcmd ( a -- ) Send command to the EPD controller SSD1680. First byte contains the length of the command. epdsleep ( -- ) enter deep sleep mode epdwakeup ( -- ) wake up EPD epdpixel! ( ? x y -- ) not implemented yet epdpixel@ ( x y -- ? ) not implemented yet epdcolumn! ( u -- ) Write a column (8 pixels) to the current position. Increment position. Bit 0 on top epdcolumn@ ( -- u ) Read a column (8 pixels) from the current position >epd ( -- a1 a2 ) redirect to EPD *) >term ( a1 a2 -- ) terminate redirection *) *) part of redirection.fs </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="500" }% ---+ Usage It is easy to redirect the terminal output to the EPD display, to use the string formatting words. <pre> : epd-hallo ( -- ) hook-emit @ \ save emit hook ['] epd-emit hook-emit ! \ redirect terminal to epd-emit ." Hallo Velo! " cr ." ciao" hook-emit ! \ restore old hook epdupdate ; </pre> or even simpler <pre> : epd-hallo ( -- ) >epd \ redirect terminal to epd-emit ." Hallo Velo! " cr ." ciao" >term \ terminate redirection epdupdate ; </pre> or on a command line <pre> >epd .( Hallo Velo!) >term epdupdate </pre> show date and time on EPD (see CmsisRtos#How_to_use_Tasks for a background task). <pre> : clock ( -- ) epdclr 3 epdfont >epd .time >term epdupdate \ 2000 osdelay drop -1 -1 -1 alarm! \ set an alarm every second begin wait-alarm \ wait a second 0 0 epdpos! epdstartpart >epd .time >term epdupdatepart key? until key drop ; </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="400" }% ---+ Adafruit !EInk Feather Board * Adafruit 2.13" Monochrome eInk / ePaper Display FeatherWing - 250x122 Monochrome with SSD1680 [[https://www.adafruit.com/product/4195][4195]] * Adafruit eInk Feather Friend with 32KB SRAM [[https://www.adafruit.com/product/4446][4446]] The partial and fast update for the Adafruit #4195 is not working for me. But the very similar EPD YMS122250-0213AAAMFGN from [[https://www.displaylc.com][DISPLAY LC]] or [[http://www.yes-optoelectronics.eu/][YES Optolectronics]] use the red color memory for the partial update, about 300 ms and no flickering at all. Is Adafruit using the GDEY0213B74 (or GDEY0213B72, GDEY0213B73) https://www.good-display.com/product/391.html for its display? [[https://learn.adafruit.com/assets/57645][Schematics]] | SDCS | microSD CS | D10 | | SRCS | RAM CS | NC | | ECS | EPD CS | D9 | | RESET | EPD Reset | D13 | | DC | EPD Data/Command | D11 | | BUSY | EPD Busy | D12 -> A4 | | MOSI | SPI Master Out | D4 | | MISO | SPI Master In | D3 | | CLK | SPI Clock | D2 | | A | Button SW1 | D9 | | B | Button SW2 | D6 | | C | Button SW3 | D5 | | LED1 | LED1 | D12 | %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="box_start" width="992" height="800" }% ---+ Driver, Links ---++ SSD1680 Driver One byte display memory contains 8 pixels. Logical 0 is black, logical 1 is white. Most significant bit is first pixel. 250 x 122 | |*Gate Y*| | | | | | | | | | | | | | | | | |*Source X*| ^|0 1 2 3 4 5 6 7|8 9 10 11 12 13 14 15| | | | | | | | | | | | |112 113 114 115 116 117 118 119| 120 121 | | *Byte* | 0| 0 | 1 |2|3|4|5|6|7|8|9|10|11|12|13| 14 | 15 | | | 1| .. ||||||||||||||||| | | 2| .. ||||||||||||||||| | | | .. ||||||||||||||||| | | 249| .. ||||||||||||||||| ---+++ Portrait * 122 columns * 31 1/4 rows * resolution 122 * 250 * 20 * 31 chars (8*6 chars) | | *Row* | *Gate Y++* | | | | | | | *Column* | | | 0 | 1 | 2 | ... | 121 | | *Source X++* | | | 0 | 0 | 0 | ... | 121 | | *Source Byte* | | | 0.0 | 0.1 | 0.2 | ... | 15.1 | | | 0| 0..7| | | | | | | | 1| 8..15| | | | | | | | 2| 16..23| | | | | | | | ..| .. | | | | | | | | 31| 249..250| | | | | | ---+++ Landscape * 250 columns * 15 1/4 rows * resolution 250 * 122 * 41 * 15 chars (8*6 chars) | | *Row* | *Source X++* | | | | | | | *Column* | | | 0 | 1 | 2 | ... | 249 | | *Gate Y--* | | | 249 | 248 | 247 | ... | 0 | | | 0| 0..7| | | | | | | | 1| 8..15| | | | | | | | 2| 16..23| | | | | | | | ..| .. | | | | | | | | 15| 120..121| | | | | | ---+++ Driver SW * https://www.solomon-systech.com/product/ssd1680-80a/ * [[https://cdn-learn.adafruit.com/assets/assets/000/097/631/original/SSD1680_Datasheet.pdf][Datasheet]] * [[https://github.com/adafruit/Adafruit_EPD][Adafruit EPD Library]] * https://www.good-display.com/news/134.html partial update ---+++ Other EPDs with SSD1680 * 2.9" E-Ink Grayscale !FeatherWing #4777 https://www.adafruit.com/product/4777 * 2.13" E-Ink Monochrome !FeatherWing #4195 250x122 Pixel https://www.adafruit.com/product/4195 ([[https://learn.adafruit.com/adafruit-2-13-eink-display-breakouts-and-featherwings/pinouts][pinouts]] * E-Ink Feather Friend #4446 https://www.adafruit.com/product/4446 ([[https://learn.adafruit.com/assets/57645][schematics]]) ---+++ Graphics File Formats * Portable !BitMap, binary P4 and ASCII P1 variant * https://en.wikipedia.org/wiki/Netpbm#File_formats * http://netpbm.sourceforge.net/doc/pbm.html * X !PixMap (XPM), usable in C-Files * https://en.wikipedia.org/wiki/X_PixMap * X !BitMap (XBM), plain text binary in C .h * upper left pixel in the bitmap represented by the low bit of the first byte in the array * https://en.wikipedia.org/wiki/X_BitMap ---++++ Portable !BitMap, binary P4 * https://en.wikipedia.org/wiki/Netpbm#File_formats * http://netpbm.sourceforge.net/doc/pbm.html =.pbm= <pre> P1 # This is an example bitmap of the letter "J" 6 10 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </pre> <pre> P4 # This is an example bitmap of the letter "J" 6 10 08080808080888700000 </pre> ---++++ !ImageMagick [[https://imagemagick.org/index.php][ImageMagick]] <pre> $ convert image.png -rotate -90 -flip image.pbm $ convert image.png -rotate 90 -flop image.xbm $ convert image -colorspace gray -threshold 10% -type bilevel result $ convert image -separate -monochrome result $ convert image.png -separate -monochrome -rotate 90 -flop -negate image.xbm convert image36 -shave 2x2 image32 </pre> %DASHBOARD{ section="box_end" }% %DASHBOARD{ section="dashboard_end" }% -- %USERSIG{PeterSchmid - 2022-08-02}% <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work by <a xmlns:cc="http://creativecommons.org/ns#" href="http://spyr.ch" property="cc:attributionName" rel="cc:attributionURL">Peter Schmid</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
jpg
epd_header.jpg
r1
manage
38.7 K
2022-08-14 - 20:58
PeterSchmid
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r24
<
r23
<
r22
<
r21
<
r20
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r24 - 2023-01-18
-
PeterSchmid
Home
Site map
Cosmac web
MRR web
MecrispCube web
SuperRandonnee web
TWiki web
Ursula web
Velo web
MecrispCube Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback