From 5066fbedd5b92797ceca9f6841785ee03b362a57 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 25 Oct 2025 15:29:33 +0800 Subject: Add post layout. --- _site/about/index.html | 44 +++++----- _site/assets/css/skeleton.css | 4 +- _site/blog/post-1/index/index.html | 44 +++++----- _site/index.html | 44 +++++----- _site/projects/e-reader/index.html | 136 +++++++++++++++++++++++++++++++ _site/projects/e-reader/index/index.html | 81 ------------------ _site/projects/index.html | 44 +++++----- 7 files changed, 234 insertions(+), 163 deletions(-) create mode 100644 _site/projects/e-reader/index.html delete mode 100644 _site/projects/e-reader/index/index.html (limited to '_site') diff --git a/_site/about/index.html b/_site/about/index.html index 6546e0b..74ed4be 100644 --- a/_site/about/index.html +++ b/_site/about/index.html @@ -1,28 +1,32 @@ - - About - - - - + + About + + + + + + - +
- -
+ + + +

About page

diff --git a/_site/assets/css/skeleton.css b/_site/assets/css/skeleton.css index 8f05a22..e9cb181 100644 --- a/_site/assets/css/skeleton.css +++ b/_site/assets/css/skeleton.css @@ -129,7 +129,7 @@ body { –––––––––––––––––––––––––––––––––––––––––––––––––– */ h1, h2, h3, h4, h5, h6 { margin-top: 0; - margin-bottom: 2rem; + margin-bottom: 1rem; font-weight: 300; } h1 { font-size: 4.0rem; line-height: 1.2; letter-spacing: -.1rem;} h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; } @@ -141,7 +141,7 @@ h6 { font-size: 1.5rem; line-height: 1.6; letter-spacing: 0; } /* Larger than phablet */ @media (min-width: 550px) { h1 { font-size: 5.0rem; } - h2 { font-size: 4.2rem; } + h2 { font-size: 2.6rem; } h3 { font-size: 3.6rem; } h4 { font-size: 3.0rem; } h5 { font-size: 2.4rem; } diff --git a/_site/blog/post-1/index/index.html b/_site/blog/post-1/index/index.html index de0e7ef..81b756a 100644 --- a/_site/blog/post-1/index/index.html +++ b/_site/blog/post-1/index/index.html @@ -1,28 +1,32 @@ - - Index - - - - + + Index + + + + + + - +
- -
+ + + +

An apple is a sweet, edible fruit produced by an apple tree.

diff --git a/_site/index.html b/_site/index.html index 7e4c4f3..cff0950 100644 --- a/_site/index.html +++ b/_site/index.html @@ -1,28 +1,32 @@ - - ASCIIMX - - - - + + ASCIIMX + + + + + + - +
- -
+ + + +
    diff --git a/_site/projects/e-reader/index.html b/_site/projects/e-reader/index.html new file mode 100644 index 0000000..bc23c7b --- /dev/null +++ b/_site/projects/e-reader/index.html @@ -0,0 +1,136 @@ + + + + + Prototype e-reader + + + Prototype e-reader + + + + + + + + + +
    + +
    + + + +
    +
    + +

    [ No ] +  

    + + +

    PROTOTYPE E-READER

    + + +
    +

    +
    24 OCTOBER 2023
    + +
    +

    This project features a prototype e-reader powered by a 7.5-inch Waveshare e-paper display and an +ESP-WROOM-32 development board.

    + + + +

    Overview

    + +

    In 2017, during a short stint as a project manager, I was tasked with +installing some e-paper displays in a car park. Not knowing how they worked, I +remember marveling at their sight like a muggle witnessing magic. As someone +who enjoys reading, I found e-paper to be a true innovation. This project was +born out of that enduring curiosity and love of e-paper technology.

    + +

    The prototype, while far from ready for daily use, has some nifty features that +fellow hobbyists and tinkerers may find interesting. The reader can display +books of arbitrary sizes by streaming them over HTTP. It employs sleep modes to +minimize power consumption when not in use and records the reading progress in +the chip’s RTC memory.

    + +

    The following schematic outlines the electrical connections of the e-reader.

    + +

    circuit

    + +

    The biggest challenge when building an e-reader using an ESP32 board is its low +memory and lack of storage. My ESP-WROOM-32 board has 512 KB of SRAM and 4 MB +of flash memory, which the freeRTOS, ESP-IDF, and my own program have to share. +To put things into perspective, compare that to a Kindle Paperwhite, which has +at least 256 MB of memory and 8 GB of storage.

    + +

    Despite its constraints, as microcontrollers go, ESP32 is a powerful +system-on-a-chip with a 160 MHz dual-core processor and integrated WiFi. So, I +thought it’d be amusing to embrace the constraints and build my e-reader using +just a $5 MCU and the power of C programming.

    + +

    The file format

    + +

    The file format dictates the complexity of the embedded software. So, I’ll +begin there. The e-reader works by downloading and rendering a rasterized +monochrome image of a page (a .ebm file).

    + +

    The EBM file contains a series of bitmaps, where each bitmap corresponds to a +page of a book sized to fit the e-paper display. Each byte contains information +for rendering eight pixels. For my display, which has a resolution of 480x800, +the bitmaps are laid out along 48 KB boundaries. This simple file format lends +well to HTTP streaming, which is its main advantage, as we will soon see.

    + +

    The enclosed pdftoebm.py script in the tarball at the end of the page converts +PDF documents to an EBM file. I use it to make EBM files before uploading them +to a web server.

    + +

    How does it work?

    + +

    As the e-reader has no storage, it can’t store books locally. Instead, I first +have to upload the EBM file I want to read to a web server. The location of the +file is configured via the EBM_ARCH_URL setting in the Kconfig.projbuild +file. To read a different book, I create an EBM file with the same name and +upload it to the original location. That way, I don’t have to recompile the +embedded software.

    + +

    Upon powering up, the e-reader checks the reading progress stored in the RTC +memory. It then downloads three pages (current, previous, and next) to a +circular buffer in DMA-capable memory. When the user turns a page, one of the +two cores of the MCU transfers it from the buffer to the display over a Serial +Peripheral Interface (SPI). The other downloads a new page in the background. I +use the ESP-IDF task API to pin the two routines to each core.

    + +

    I designed the EBM format with HTTP streaming in mind. To download a page based +on the current reading progress, the e-reader specifies the page offset and the +chunk size using the HTTP Range header.

    + +

    Afterword

    + +

    It’s been six years since the car park and the displays. At the time, I knew +nothing about embedded systems or display drivers. It took a long time to +develop the skill set, but now, at last, I know how those displays worked and +how to build my own.

    + +

    Files: source.tar.gz

    + +
    + +

    by W. D. Sadeep Madurange

    +
    +
    + + + diff --git a/_site/projects/e-reader/index/index.html b/_site/projects/e-reader/index/index.html deleted file mode 100644 index dd58a14..0000000 --- a/_site/projects/e-reader/index/index.html +++ /dev/null @@ -1,81 +0,0 @@ -

    This project features a prototype e-reader powered by a 7.5-inch Waveshare e-paper display and an -ESP-WROOM-32 development board.

    - -

    <video style=”max-width:100%” controls=”” poster=thumb.png>

    - - -

    </video>

    - -

    Overview

    - -

    In 2017, during a short stint as a project manager, I was tasked with -installing some e-paper displays in a car park. Not knowing how they worked, I -remember marveling at their sight like a muggle witnessing magic. As someone -who enjoys reading, I found e-paper to be a true innovation. This project was -born out of that enduring curiosity and love of e-paper technology.

    - -

    The prototype, while far from ready for daily use, has some nifty features that -fellow hobbyists and tinkerers may find interesting. The reader can display -books of arbitrary sizes by streaming them over HTTP. It employs sleep modes to -minimize power consumption when not in use and records the reading progress in -the chip’s RTC memory.

    - -

    The following schematic outlines the electrical connections of the e-reader.

    - -

    circuit

    - -

    The biggest challenge when building an e-reader using an ESP32 board is its low -memory and lack of storage. My ESP-WROOM-32 board has 512 KB of SRAM and 4 MB -of flash memory, which the freeRTOS, ESP-IDF, and my own program have to share. -To put things into perspective, compare that to a Kindle Paperwhite, which has -at least 256 MB of memory and 8 GB of storage.

    - -

    Despite its constraints, as microcontrollers go, ESP32 is a powerful -system-on-a-chip with a 160 MHz dual-core processor and integrated WiFi. So, I -thought it’d be amusing to embrace the constraints and build my e-reader using -just a $5 MCU and the power of C programming.

    - -

    The file format

    - -

    The file format dictates the complexity of the embedded software. So, I’ll -begin there. The e-reader works by downloading and rendering a rasterized -monochrome image of a page (a .ebm file).

    - -

    The EBM file contains a series of bitmaps, where each bitmap corresponds to a -page of a book sized to fit the e-paper display. Each byte contains information -for rendering eight pixels. For my display, which has a resolution of 480x800, -the bitmaps are laid out along 48 KB boundaries. This simple file format lends -well to HTTP streaming, which is its main advantage, as we will soon see.

    - -

    The enclosed pdftoebm.py script in the tarball at the end of the page converts -PDF documents to an EBM file. I use it to make EBM files before uploading them -to a web server.

    - -

    How does it work?

    - -

    As the e-reader has no storage, it can’t store books locally. Instead, I first -have to upload the EBM file I want to read to a web server. The location of the -file is configured via the EBM_ARCH_URL setting in the Kconfig.projbuild -file. To read a different book, I create an EBM file with the same name and -upload it to the original location. That way, I don’t have to recompile the -embedded software.

    - -

    Upon powering up, the e-reader checks the reading progress stored in the RTC -memory. It then downloads three pages (current, previous, and next) to a -circular buffer in DMA-capable memory. When the user turns a page, one of the -two cores of the MCU transfers it from the buffer to the display over a Serial -Peripheral Interface (SPI). The other downloads a new page in the background. I -use the ESP-IDF task API to pin the two routines to each core.

    - -

    I designed the EBM format with HTTP streaming in mind. To download a page based -on the current reading progress, the e-reader specifies the page offset and the -chunk size using the HTTP Range header.

    - -

    Afterword

    - -

    It’s been six years since the car park and the displays. At the time, I knew -nothing about embedded systems or display drivers. It took a long time to -develop the skill set, but now, at last, I know how those displays worked and -how to build my own.

    - -

    Files: source.tar.gz

    diff --git a/_site/projects/index.html b/_site/projects/index.html index 15ffb96..d1fcb18 100644 --- a/_site/projects/index.html +++ b/_site/projects/index.html @@ -1,28 +1,32 @@ - - Projects - - - - + + Projects + + + + + + - +
    - -
    + + + +
    -- cgit v1.2.3