diff options
Diffstat (limited to '_site')
| -rw-r--r-- | _site/archive/arduino-due/index.html | 149 | ||||
| -rw-r--r-- | _site/archive/arduino-uno/index.html | 49 | ||||
| -rw-r--r-- | _site/archive/awesome-books/index.html | 86 | ||||
| -rw-r--r-- | _site/archive/index.html | 4 | ||||
| -rw-r--r-- | _site/assets/css/main.css | 1 | ||||
| -rw-r--r-- | _site/feed.xml | 2 | ||||
| -rw-r--r-- | _site/index.html | 4 | ||||
| -rw-r--r-- | _site/posts.xml | 2 | ||||
| -rw-r--r-- | _site/projects/bumblebee/index.html | 23 | ||||
| -rw-r--r-- | _site/projects/matrix-digital-rain/index.html | 30 |
10 files changed, 186 insertions, 164 deletions
diff --git a/_site/archive/arduino-due/index.html b/_site/archive/arduino-due/index.html index 13e006e..86f4fb0 100644 --- a/_site/archive/arduino-due/index.html +++ b/_site/archive/arduino-due/index.html @@ -2,12 +2,12 @@ <html> <head> <meta charset="utf-8"> - <title>Bare-metal ARM Cortex M3 chips</title> + <title>Bare-metal ATSAM3X8E chips</title> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Bare-metal ARM Cortex M3 chips</title> + <title>Bare-metal ATSAM3X8E chips</title> <link rel="stylesheet" href="/assets/css/main.css"> <link rel="stylesheet" href="/assets/css/skeleton.css"> </head> @@ -40,34 +40,38 @@ <main> <div class="container"> - <h2 class="center" id="title">BARE-METAL ARM CORTEX M3 CHIPS</h2> + <h2 class="center" id="title">BARE-METAL ATSAM3X8E CHIPS</h2> <h6 class="center">05 OCTOBER 2024</h5> <br> - <div class="twocol justify"><p>This post is about programming bare metal SAM3X8E Arm Cortex M3 chips found on -Arduino Due boards. I had to learn how to do this because none of the -high-level tools for programming Arduino Dues are available for OpenBSD, which -I use for much of my personal computing.</p> + <div class="twocol justify"><p>This article is a step-by-step guide for programming bare-metal ATSAM3X8E chips +found on Arduino Due boards. It also includes notes on the chip’s memory layout +relevant for writing linker scripts. The steps described in this article were +tested on an OpenBSD workstation.</p> <h2 id="toolchain">Toolchain</h2> -<p>Since we will not be using pre-packaged development tools, we need to assemble -our own toolchain. As usual, we need a compiler toolchain to build programs for -the target chip. As we will be bypassing the embedded bootloader, we will also -need a hardware programmer and an on-chip debugger to flash programs to the -chip. I used the following toolchain.</p> +<p>To interact directly with a bare-metal ATSAM3X8E chips, we must bypass the +embedded bootloader. To do that, we need a hardware programmer capable of +communicating with the chip over the Serial Wire Debug (SWD) protocol. Since +the workstation we upload the program from presumably doesn’t speak SWD, the +hardware programmer acts as a SWD-USB adapter. The <a href="https://www.st.com/en/development-tools/st-link-v2.html" class="external" target="_blank" rel="noopener noreferrer">ST-LINK/V2</a> programmer fits this +bill.</p> -<ul> - <li><a href="https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain" class="external" target="_blank" rel="noopener noreferrer">Arm GNU compiler -toolchain</a>.</li> - <li><a href="https://openocd.org/" class="external" target="_blank" rel="noopener noreferrer">OpenOCD</a> on-chip debugger.</li> - <li><a href="https://www.st.com/en/development-tools/st-link-v2.html" class="external" target="_blank" rel="noopener noreferrer">ST-LINK/V2</a> -programmer.</li> -</ul> +<p>The <a href="https://openocd.org/" class="external" target="_blank" rel="noopener noreferrer">OpenOCD</a> on-chip debugger software supports +ATSAM3X8E chips. OpenOCD, on startup, runs a telnet server that we can connect to +to issue commands to the ATSAM3X8E chip. OpenOCD translates plain-text commands +into the binary sequences the chip understands, and sends them over the wire.</p> + +<p>Finally, we need the <a href="https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain" class="external" target="_blank" rel="noopener noreferrer">ARM GNU Compiler +Toolchain</a> to compile C programs for the chip. The ARM GNU compiler +toolchain and OpenOCD, as a consequence of being free software, are available +on every conceivable platform, including OpenBSD.</p> <h2 id="electrical-connections">Electrical connections</h2> -<p>The following diagram outlines the electrical connections between the different -components necessary to move a compiled program from a PC to the MCU.</p> +<p>The following photos illustrate the electrical connections between the Arduino +Due, PC, and the ST-LINK/V2 programmer required to transfer a compiled program +from a PC to the MCU.</p> <table style="border: none; width: 100%;"> <tr style="border: none;"> @@ -82,69 +86,70 @@ components necessary to move a compiled program from a PC to the MCU.</p> </tr> </table> -<p>Arduino Due exposes the SAM3X8E’s Serial Wire Debug (SWD) interface via its -DEBUG port. The ST-LINK/v2 programmer uses the SWD protocol to communicate with -the chip.</p> +<p>Arduino Due exposes the ATSAM3X8E’s SWD interface via its DEBUG port. The +ST-LINK/v2 programmer connects to that to communicate with the chip.</p> <h2 id="uploading-the-program">Uploading the program</h2> -<p>Follow the steps below to upload a program to the SAM3X8E chip. The -source.tar.gz tarball at the end of the page contains a sample program with a -OpenOCD config file and a linker script.</p> - -<ol> - <li>Start OpenOCD: - <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ openocd -f openocd-due.cfg -</code></pre></div> </div> - </li> - <li>Open a telnet session and set the GPNVM1 bit to 1: - <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ telnet localhost 4444 +<p>The source.tar.gz tarball at the end of this page contains a sample C program +(the classic LED blink program) with OpenOCD configuration and linker scripts. +First, use the following command to build it:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ + -nostartfiles \ + -nostdlib \ + -o a.elf main.c +</code></pre></div></div> + +<p>Then, open a telnet session with OpenOCD and issue the following sequence of +commands to configure the chip and upload the compiled program to it:</p> + +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ openocd -f openocd-due.cfg +$ telnet localhost 4444 > halt > at91sam3 gpnvm show > at91sam3 gpnvm set 1 > at91sam3 gpnvm show -</code></pre></div> </div> - </li> - <li>Build the program using the custom linker script. - <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ - -nostartfiles \ - -nostdlib \ - -o a.elf main.c -</code></pre></div> </div> - </li> - <li>Upload the program using OpenOCD: - <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ openocd -f openocd-due.cfg -c "program a.elf verify reset exit" -</code></pre></div> </div> - </li> -</ol> +$ openocd -f openocd-due.cfg -c "program a.elf verify reset exit" +</code></pre></div></div> -<p>Refer to the OpenOCD manual (AT91SAM3 flash driver section) for a complete list -of commands supported for the ATSAM3X8E.</p> +<p>The first of the above commands starts OpenOCD. In the telnet session, the +first command halts the chip in preparation for receiving commands. Next, we +inspect the current GPNVM bit setting (more on this later). If the bit is unset +(the gpnvm show command returns 0), we set it to 1 and verify the update.</p> -<h2 id="gpnvm-bits-and-the-linker-script">GPNVM bits and the linker script</h2> +<p>The final command, issued from outside the telnet session, uploads the program +to the chip. Those are the bare minimum set of commands required to program the +chip. The AT91SAM3 flash driver section of the OpenOCD manual lists all +available commands for the ATSAM3X8E chip.</p> + +<h2 id="gpnvm-bits">GPNVM bits</h2> <p>By design, ARM chips boot into address 0x00000. ATSAM3X8E’s memory consists of a ROM and a dual-banked flash (flash0 and flash1), residing in different -locations of the chip’s address space.</p> - -<p>The GPNVM bits control which of them maps to 0x00000. When GPNVM1 is cleared -(default), the chip boots from the ROM, which contains Atmel’s SAM-BA -bootloader. So, the chip runs the embedded bootloader instead of our program.</p> - -<p>When the GPNVM1 bit is 1 (and the GPNVM2 bit is 0), flash0 at address 0x80000 -maps to 0x00000. When both GPNVM bits are 0, flash1 maps to 0x00000. Since we -place our program in flash0 using the linker script, we set the GPNVM1 bit and -leave the GPNVM2 bit as it is.</p> - -<p>The linker script places the vector table at the first address of the flash. -ARM chips expect this unless we relocate the vector table using the VTOR -register. The first entry of the vector table must be the stack pointer, and -the second must be the reset vector.</p> - -<p>Finally, the ATSAM3X8E uses a descending stack. So, in the linker script, we -initialize the stack pointer to the highest memory location available. In the -reset vector, we zero out memory, initialize registers, and perform other tasks -before passing control to the main program.</p> +locations of the chip’s address space. The GPNVM bits control which of them +maps to 0x00000. When GPNVM1 is cleared (the default), the chip boots from the ROM, +which contains Atmel’s SAM-BA bootloader.</p> + +<p>Conversely, when the GPNVM1 bit is 1 (and the GPNVM2 bit is 0), flash0 at +address 0x80000 maps to 0x00000. When both GPNVM bits are 0, flash1 maps to +0x00000. Since we place our program in flash0 in the linker script, we set the +GPNVM1 bit and leave the GPNVM2 bit unchanged to ensure the chip +executes our program instead of the embedded bootloader at startup.</p> + +<h2 id="linker-script">Linker script</h2> + +<p>At a minimum, the linker script must place the vector table at the first +address of the flash. This is mandatory for ARM chips unless we relocate the +vector table using the VTOR register.</p> + +<p>The first entry of the vector table must be the stack pointer. The stack +pointer must be initializes to the highest memory location available to +accommodate the ATSAM3X8E’s descending stack.</p> + +<p>The second entry of the vector table must be the reset vector. In the reset +vector, we can perform tasks such as zeroing out memory and initializing +registers before passing control to the main program.</p> <p>Files: <a href="source.tar.gz">source.tar.gz</a></p> </div> diff --git a/_site/archive/arduino-uno/index.html b/_site/archive/arduino-uno/index.html index 7509267..3b0234d 100644 --- a/_site/archive/arduino-uno/index.html +++ b/_site/archive/arduino-uno/index.html @@ -2,12 +2,12 @@ <html> <head> <meta charset="utf-8"> - <title>Programming ATmega328P chips</title> + <title>ATmega328P chips</title> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Programming ATmega328P chips</title> + <title>ATmega328P chips</title> <link rel="stylesheet" href="/assets/css/main.css"> <link rel="stylesheet" href="/assets/css/skeleton.css"> </head> @@ -40,15 +40,15 @@ <main> <div class="container"> - <h2 class="center" id="title">PROGRAMMING ATMEGA328P CHIPS</h2> + <h2 class="center" id="title">ATMEGA328P CHIPS</h2> <h6 class="center">10 APRIL 2025</h5> <br> - <div class="twocol justify"><p>This post is a step-by-step guide for wiring up ATmega328P ICs to run at 5V -with a 16MHz crystal and 3.3V with an 8MHz crystal. While the 5V -configuration is common, the 3.3V configuration can be advantageous in -low-power applications and when interfacing with parts that run at 3.3V.</p> - -<h2 id="5v-16mhz-configuration">5V-16MHz configuration</h2> + <div class="twocol justify"><p>This is a quick reference for wiring up ATmega328P ICs to run at 5V and 3.3V. +While the 5V configuration is common, the 3.3V configuration can be useful in +low-power applications and when interfacing with parts that themselves run at +3.3V. In this guide, the 5V setup is configured with a 16MHz crystal +oscillator, while the 3.3V configuration makes use of an 8MHz crystal +oscillator.</p> <p>The steps that follow refer to the following pinout.</p> @@ -65,6 +65,8 @@ low-power applications and when interfacing with parts that run at 3.3V.</p> </tr> </table> +<h2 id="5v-16mhz-configuration">5V-16MHz configuration</h2> + <ol> <li>Connect pin 1 to 5V via a 10kΩ resistor.</li> <li>Connect a 16MHz crystal oscillator across pins 9 and 10.</li> @@ -73,23 +75,30 @@ low-power applications and when interfacing with parts that run at 3.3V.</p> <li>Connect pins 8 and 22 to ground.</li> </ol> -<p>In addition to the connections described above, it’s a good idea to add 0.1μF +<p>In addition to the the connections above, it’s a good idea to add 0.1μF decoupling capacitors between pins 7, 20, and 21 and ground. <a href="Makefile">Here’s</a> a sample Makefile for avr-gcc and avrdude.</p> <h2 id="33v-8mhz-configuration">3.3V-8MHz configuration</h2> -<p>The following steps use Arduino Uno as an ISP and Arduino utilities to program -ATmega328P’s bootloader and the fuses (e.g., BOD level) for a 3.3V supply.</p> +<p>Standard ATmega328P chips are preconfigured to run at 5V. To run one at 3.3V, +we must first modify its fuses (e.g., BOD level). If the chip contains a +pre-installed bootloader that expects a 16MHz clock (such as the Arduino Uno +bootloader), it must be replaced with one that is more amenable to an 8MHz +clock.</p> + +<p>In the following steps, we use an Arduino Uno as an in-system programmer to +replace the embedded bootloader and modify the appropriate fuses.</p> <ol> - <li>Upload the ‘ArduinoISP’ sketch to the Uno.</li> - <li>Wire up the ATmega328P as described in the previous section. Replace the 5V -supply with a 3.3V supply and use an 8MHz crystal instead of the 16MHz + <li>Upload the ‘ArduinoISP’ sketch to the Arduino Uno.</li> + <li>Wire up the ATmega328P IC as described in the previous section, while +replacing the 5V supply with a 3.3V supply and 16MHz crystal with an 8MHz crystal.</li> <li>Connect the SPI ports (SCK, MISO, and MOSI) of the two MCUs.</li> - <li>Connect Uno’s SS pin to the IC’s pin 1 (RESET).</li> - <li>The IC can be powered by the Arduino Uno’s 5V pin.</li> + <li>Connect the Arduino Uno’s SS pin to the IC’s RESET pin (pin 1).</li> + <li>Connect the IC’s V<sub>CC</sub> to a 5V supply (e.g., the Arduino Uno’s 5V +pin).</li> <li>Burn the bootloader to the ATmega328P: <ul> <li>Select ‘ATmega328P (3.3V, 8MHz)’ from Tools > Processor.</li> @@ -100,14 +109,14 @@ crystal.</li> </ol> <p>The ATmega328P is now ready to run at 8MHz with a 3.3V power supply. You can -upload programs to the ATmega328P as you usually would using avrdude. +upload programs to the ATmega328P as you normally would using avrdude. <a href="3v3.Makefile">Here’s</a> a sample Makefile with adjusted parameters (e.g., baud rate) for an 8MHz clock.</p> <p>In both configurations, if you intend to use the ATmega328P’s analog-to-digital converter with the internal 1.1V or AV<sub>cc</sub> voltage as reference, do -not connect AREF (pin 21) to V<sub>cc</sub>. Refer to section 23.5.2 ADC -Voltage Reference in the datasheet for more information.</p> +not connect AREF (pin 21) to V<sub>cc</sub>. Refer to section 23.5.2 in the +datasheet for more information.</p> </div> <p class="post-author right">by Wickramage Don Sadeep Madurange</p> diff --git a/_site/archive/awesome-books/index.html b/_site/archive/awesome-books/index.html index c9f1934..8f2f45e 100644 --- a/_site/archive/awesome-books/index.html +++ b/_site/archive/awesome-books/index.html @@ -43,65 +43,74 @@ <h2 class="center" id="title">AWESOME BOOKS</h2> <h6 class="center">20 APRIL 2025</h5> <br> - <div class="twocol justify"><p>This article contains a list of my favourite books.</p> - -<h2 id="cloud-atlas">Cloud Atlas</h2> + <div class="twocol justify"><h2 id="cloud-atlas">Cloud Atlas</h2> <p>This highly creative novel rekindled my love of fiction. Cloud Atlas is a -collection of six tales linked across time. As the novel unfolds, each story -riffles over the previous ones, like a pack of playing cards.</p> +collection of six tales linked across time. As the book unfolds, the stories +riffle over one another like a pack of cards. David Mitchell brings the Cloud +Atlas world and the characters in it to life with beautiful, vivid +descriptions. The novel explores themes ranging from social to spiritual, +including the struggle for freedom against oppression, interconnectedness, and +rebirth.</p> <h2 id="enders-game">Ender’s Game</h2> -<p>In this sci-fi novel, Andrew “Ender” Wiggin, a young boy, is drafted to lead a -squad of young children in an offensive against an alien race. It’s a complex -story that touches upon various political and philosophical issues. Those -perceived as gifted by others (and alienated for it) will likely connect with -Ender.</p> +<p>In this sci-fi novel, Andrew “Ender” Wiggin, an 11-year-old boy, is drafted to +lead a squad of young children in an offensive against an alien race. Ender’s +Game is a complex story that explores themes of war, leadership, and the +challenges gifted individuals must face as they navigate a lonely life marked +by envy, alienation, and, sometimes, much-needed friendship.</p> <h2 id="flowers-for-algernon">Flowers for Algernon</h2> -<p>This novel, written as a series of progress reports, tells the story of Charlie -Gordon, a developmentally disabled man who acquires superhuman cognitive -abilities through an experimental medical procedure. For some reason, I felt a -deep connection with Charlie. If I had to pick a favourite book on this list, -that would be this.</p> +<p>This novel, written as a series of progress reports, tells the tragic story of +Charlie Gordon, a developmentally disabled man who acquires superhuman +cognitive abilities through an experimental medical procedure. Charlie’s birth +family abandons him because he is not smart enough; his friends abandon him +because he is too smart. In the end, to spare everyone’s feelings, Charlie must +end up in the Warren Home.<sup><a href="#footnote-1">1</a></sup> This is my +favourite book in the list.</p> <h2 id="dead-souls">Dead Souls</h2> -<p>Nikolai Gogol is one of the most original authors I’ve read. Dead Souls is the -story of Ivanovich Chichikov, a traveling merchant who trades dead serfs. -Instead of simply describing them, Gogol develops realistic characters in -minute detail by employing theatrical clashes between them.</p> +<p>Dead Souls is the story of Ivanovich Chichikov, a traveling merchant who trades +dead serfs. Gogol’s writing style is similar to Dostoyevsky’s. Considering how +Gogol’s work predates Dostoyevsky’s, Gogol is one of the most original authors +I’ve read. Instead of simply describing them, Gogol develops realistic +characters in minute detail by employing theatrical clashes between them.</p> <h2 id="the-overcoat">The Overcoat</h2> <p>Gogol’s The Overcoat is one of the finest short stories I’ve read. Akaky -Akakievich, an impoverished government clerk, must buy a new overcoat. I -recommend reading Gogol before Dostoyevsky. What Gogol invented, Dostoyevsky -perfected.</p> +Akakievich, an impoverished government clerk, buys a new overcoat. I recommend +reading Gogol before Dostoyevsky. What Gogol invented, Dostoyevsky perfected.</p> <h2 id="demons">Demons</h2> <p>After reading Demons, a story about an attempted revolution, I realized that -Dostoevsky’s reputation is well-deserved. Dostoyevsky was a great observer of -the human psyche. The depth with which he depicts his characters is -unparalleled. Demons is a book that anyone aspiring to bring about change -through revolution must read.</p> +Dostoyevsky’s reputation is well-deserved. Dostoyevsky was a great observer of +human nature. He depicts characters in profound detail. Dostoyevsky’s writing +can feel long and meandering at times. However, as character development goes, +Dostoyevsky wastes no stroke of the brush. Demons is a book that anyone +aspiring to bring about change through revolution, especially in the name of +someone else’s ideals, must read.</p> <h2 id="the-outsider">The Outsider</h2> -<p>Camus’s quote, “In our society, any man who doesn’t cry at his mother’s funeral -is liable to be condemned to death,” summarizes the book quite well. To -appreciate the philosophical elements of this absurdist novel, you may also -want to check out The Myth of Sisyphus.</p> +<p>Camus’s own quote, “In our society, any man who doesn’t cry at his mother’s +funeral is liable to be condemned to death,” summarizes the book quite well. +The book is about the philosophy of the absurd: the contention between our +propensity to seek meaning in a seemingly silent and indifferent universe. To +appreciate the philosophical elements of this novel, check out The Myth of +Sisyphus.</p> <h2 id="frankenstein">Frankenstein</h2> -<p>I’m not sure why I found this story so charming. Perhaps it’s a deep-felt -empathy for Victor Frankenstein. Maybe it’s the rustic descriptions of places -I’d never seen. After reading the book, I traveled Frankenstein’s trail from -Germany through Lucerne, Geneva, and Scotland.</p> +<p>I first got to know the Frankenstein story through its popular derivatives. The +book changed my impression of the story from one about a familiar monster to +one about a poignant genius deserving empathy. Mary Shelley’s intricate writing +style is singularly captivating. In this list, Frankenstein is the most +beautifully written book.</p> <h2 id="strange-case-of-dr-jekyll-and-mr-hyde">Strange Case of Dr Jekyll and Mr Hyde</h2> @@ -125,6 +134,15 @@ two books are more relevant today than they’ve ever been.</p> Aksenty Ivanovich’s diary, the story documents the government clerk’s descent into madness. His obsession with social status and self-aggrandizement leads him on a trajectory of envy, wounded pride, and outright insanity.</p> + +<div class="footnotes" role="doc-endnotes"> + <ol> + <li> + <a href="https://www.cliffsnotes.com/literature/f/flowers-for-algernon/about-flowers-for-algernon" class="external" target="_blank" rel="noopener noreferrer"> Cliff's Notes </a> + </li> + </ol> +</div> + </div> <p class="post-author right">by Wickramage Don Sadeep Madurange</p> </div> diff --git a/_site/archive/index.html b/_site/archive/index.html index 228167a..91a7361 100644 --- a/_site/archive/index.html +++ b/_site/archive/index.html @@ -85,7 +85,7 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/archive/arduino-uno/" class="link-decor-none">Programming ATmega328P chips</a> + <a href="/archive/arduino-uno/" class="link-decor-none">ATmega328P chips</a> </td> <td class="posts-td posts-td-time"> <span class="post-meta"> @@ -98,7 +98,7 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/archive/arduino-due/" class="link-decor-none">Bare-metal ARM Cortex M3 chips</a> + <a href="/archive/arduino-due/" class="link-decor-none">Bare-metal ATSAM3X8E chips</a> </td> <td class="posts-td posts-td-time"> <span class="post-meta"> diff --git a/_site/assets/css/main.css b/_site/assets/css/main.css index 24940f0..401f623 100644 --- a/_site/assets/css/main.css +++ b/_site/assets/css/main.css @@ -202,7 +202,6 @@ pre::-webkit-scrollbar { white-space: nowrap; margin: 0 auto; animation: typing 3s steps(40, end); - animation-delay: 0s; } .typewriter-2 { diff --git a/_site/feed.xml b/_site/feed.xml index 9b981df..c5108d6 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2025-11-07T19:32:33+08:00</updated><id>http://localhost:4000/feed.xml</id><title type="html">ASCIIMX | Archive</title><author><name>Wickramage Don Sadeep Madurange</name></author><entry><title type="html">Neo4J A* search</title><link href="http://localhost:4000/archive/neo4j-a-star-search/" rel="alternate" type="text/html" title="Neo4J A* search" /><published>2025-09-14T00:00:00+08:00</published><updated>2025-09-14T00:00:00+08:00</updated><id>http://localhost:4000/archive/neo4j-a-star-search</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Back in 2018, we used the Neo4J graph database to track the movement of marine vessels. We were interested in the shortest path a ship could take through a network of about 13,000 route points. Performance issues with Neo4J’s shortest-path algorithms limited our search to about 4,000 route points.]]></summary></entry><entry><title type="html">MOSFETs</title><link href="http://localhost:4000/archive/mosfet-switches/" rel="alternate" type="text/html" title="MOSFETs" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>http://localhost:4000/archive/mosfet-switches</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Recently, I needed a low-power circuit for one of my battery-operated projects. Much of the system’s power savings depended on its ability to switch off power to components, such as servos, electronically when not needed. That’s how I stumbled upon MOSFETs, transistors capable of controlling circuits operating at voltages far above their own.]]></summary></entry><entry><title type="html">Awesome books</title><link href="http://localhost:4000/archive/awesome-books/" rel="alternate" type="text/html" title="Awesome books" /><published>2025-04-20T00:00:00+08:00</published><updated>2025-04-20T00:00:00+08:00</updated><id>http://localhost:4000/archive/awesome-books</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This article contains a list of my favourite books.]]></summary></entry><entry><title type="html">Programming ATmega328P chips</title><link href="http://localhost:4000/archive/arduino-uno/" rel="alternate" type="text/html" title="Programming ATmega328P chips" /><published>2025-04-10T00:00:00+08:00</published><updated>2025-04-10T00:00:00+08:00</updated><id>http://localhost:4000/archive/arduino-uno</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This post is a step-by-step guide for wiring up ATmega328P ICs to run at 5V with a 16MHz crystal and 3.3V with an 8MHz crystal. While the 5V configuration is common, the 3.3V configuration can be advantageous in low-power applications and when interfacing with parts that run at 3.3V.]]></summary></entry><entry><title type="html">Bare-metal ARM Cortex M3 chips</title><link href="http://localhost:4000/archive/arduino-due/" rel="alternate" type="text/html" title="Bare-metal ARM Cortex M3 chips" /><published>2024-10-05T00:00:00+08:00</published><updated>2024-10-05T00:00:00+08:00</updated><id>http://localhost:4000/archive/arduino-due</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This post is about programming bare metal SAM3X8E Arm Cortex M3 chips found on Arduino Due boards. I had to learn how to do this because none of the high-level tools for programming Arduino Dues are available for OpenBSD, which I use for much of my personal computing.]]></summary></entry></feed>
\ No newline at end of file +<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-11-09T08:32:15+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Archive</title><author><name>Wickramage Don Sadeep Madurange</name></author><entry><title type="html">Neo4J A* search</title><link href="/archive/neo4j-a-star-search/" rel="alternate" type="text/html" title="Neo4J A* search" /><published>2025-09-14T00:00:00+08:00</published><updated>2025-09-14T00:00:00+08:00</updated><id>/archive/neo4j-a-star-search</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Back in 2018, we used the Neo4J graph database to track the movement of marine vessels. We were interested in the shortest path a ship could take through a network of about 13,000 route points. Performance issues with Neo4J’s shortest-path algorithms limited our search to about 4,000 route points.]]></summary></entry><entry><title type="html">MOSFETs</title><link href="/archive/mosfet-switches/" rel="alternate" type="text/html" title="MOSFETs" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/archive/mosfet-switches</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Recently, I needed a low-power circuit for one of my battery-operated projects. Much of the system’s power savings depended on its ability to switch off power to components, such as servos, electronically when not needed. That’s how I stumbled upon MOSFETs, transistors capable of controlling circuits operating at voltages far above their own.]]></summary></entry><entry><title type="html">Awesome books</title><link href="/archive/awesome-books/" rel="alternate" type="text/html" title="Awesome books" /><published>2025-04-20T00:00:00+08:00</published><updated>2025-04-20T00:00:00+08:00</updated><id>/archive/awesome-books</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Cloud Atlas]]></summary></entry><entry><title type="html">ATmega328P chips</title><link href="/archive/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P chips" /><published>2025-04-10T00:00:00+08:00</published><updated>2025-04-10T00:00:00+08:00</updated><id>/archive/arduino-uno</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This is a quick reference for wiring up ATmega328P ICs to run at 5V and 3.3V. While the 5V configuration is common, the 3.3V configuration can be useful in low-power applications and when interfacing with parts that themselves run at 3.3V. In this guide, the 5V setup is configured with a 16MHz crystal oscillator, while the 3.3V configuration makes use of an 8MHz crystal oscillator.]]></summary></entry><entry><title type="html">Bare-metal ATSAM3X8E chips</title><link href="/archive/arduino-due/" rel="alternate" type="text/html" title="Bare-metal ATSAM3X8E chips" /><published>2024-10-05T00:00:00+08:00</published><updated>2024-10-05T00:00:00+08:00</updated><id>/archive/arduino-due</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This article is a step-by-step guide for programming bare-metal ATSAM3X8E chips found on Arduino Due boards. It also includes notes on the chip’s memory layout relevant for writing linker scripts. The steps described in this article were tested on an OpenBSD workstation.]]></summary></entry></feed>
\ No newline at end of file diff --git a/_site/index.html b/_site/index.html index 510b4c0..73af875 100644 --- a/_site/index.html +++ b/_site/index.html @@ -95,7 +95,7 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/archive/arduino-uno/" class="link-decor-none">Programming ATmega328P chips</a> + <a href="/archive/arduino-uno/" class="link-decor-none">ATmega328P chips</a> </td> <td class="posts-td posts-td-time"> <span class="post-meta"> @@ -108,7 +108,7 @@ <tr> <td class="posts-td posts-td-link"> - <a href="/archive/arduino-due/" class="link-decor-none">Bare-metal ARM Cortex M3 chips</a> + <a href="/archive/arduino-due/" class="link-decor-none">Bare-metal ATSAM3X8E chips</a> </td> <td class="posts-td posts-td-time"> <span class="post-meta"> diff --git a/_site/posts.xml b/_site/posts.xml index fdc2211..842a968 100644 --- a/_site/posts.xml +++ b/_site/posts.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="http://localhost:4000/posts.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2025-11-07T19:32:33+08:00</updated><id>http://localhost:4000/posts.xml</id><title type="html">ASCIIMX</title><author><name>Wickramage Don Sadeep Madurange</name></author></feed>
\ No newline at end of file +<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-11-09T08:32:15+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>Wickramage Don Sadeep Madurange</name></author></feed>
\ No newline at end of file diff --git a/_site/projects/bumblebee/index.html b/_site/projects/bumblebee/index.html index c2da039..23f1a66 100644 --- a/_site/projects/bumblebee/index.html +++ b/_site/projects/bumblebee/index.html @@ -43,23 +43,24 @@ <h2 class="center" id="title">BUMBLEBEE: BROWSER AUTOMATION</h2> <h6 class="center">02 APRIL 2025</h5> <br> - <div class="twocol justify"><p>Bumblebee is a web browser that turns browser sessions into C# scripts. Its -objective is to eliminate the need for authoring scripts for testing, web -scraping, and other browser automation tasks.</p> + <div class="twocol justify"><p>Bumblebee is a web browser that converts browser sessions into C# scripts for +playback. It eliminates the need for authoring browser automation scripts.</p> <video style="max-width:100%; margin-bottom: 10px" controls="" poster="thumb.png"> <source src="bee.mp4" type="video/mp4" /> </video> -<p>Bumblebee is a Windows Forms application written in C#. The rendering of web -content is handled by the embedded Microsoft Edge browser (via WebView). The -text editor on the right is <a src="https://github.com/desjarlais/Scintilla.NET" class="external" target="_blank" rel="noopener noreferrer">Scintilla.NET</a>. It -enables users to override the script at any point during the session. There are -application settings that let users debounce events, ignore hidden elements -and scripts, and more.</p> +<p>Bumblebee is a Windows Forms application written in C#. Web content is rendered +by the embedded Microsoft Edge browser (via WebView). The text editor on the +right is <a src="https://github.com/desjarlais/Scintilla.NET" class="external" target="_blank" rel="noopener noreferrer">Scintilla.NET</a>. Users can +override the generated script at any point during the session. The users can +configure Bumblebee to debounce events, ignore hidden elements, etc.</p> -<p>Unfortunately, I can’t share the source code for Bumblebee. I developed it for -an employer. Hence, the software is proprietary.</p> +<p>Bumblebee works by injecting a custom JavaScript program that tracks user +interactions. The tracker intercepts and sends them to the Bumblebee backend as +events for analysis. In addition to the front-end events, Bumblebee also +intercepts events internal to the web browser, which it then interprets to +generate C# code for the Selenium WebDriver in real time.</p> </div> <p class="post-author right">by Wickramage Don Sadeep Madurange</p> diff --git a/_site/projects/matrix-digital-rain/index.html b/_site/projects/matrix-digital-rain/index.html index ad4bb97..1b941c7 100644 --- a/_site/projects/matrix-digital-rain/index.html +++ b/_site/projects/matrix-digital-rain/index.html @@ -43,36 +43,26 @@ <h2 class="center" id="title">THE MATRIX DIGITAL RAIN</h2> <h6 class="center">12 JANUARY 2024</h5> <br> - <div class="twocol justify"><p>The famous digital rain from the movie The Matrix implemented in C for -the Unix terminal without using any GUI/TUI kits:</p> + <div class="twocol justify"><p>The famous digital rain from The Matrix, implemented in C.</p> <video style="max-width:100%;" controls="" poster="thumb.png"> <source src="matrix.mp4" type="video/mp4" /> </video> -<p>Domsson’s <a href="https://github.com/domsson/fakesteak" class="external" target="_blank" rel="noopener noreferrer">Fakesteak</a> inspired -this project. I added the following features while trying to keep the original -project’s simplicity intact as much as possible:</p> +<p>This project is a fork of Domsson’s beautiful <a href="https://github.com/domsson/fakesteak" class="external" target="_blank" rel="noopener noreferrer">Fakesteak</a>.</p> -<ul> - <li>Customize the rain color to match the theme of the setup.</li> - <li>Support for UTF-32 characters.</li> - <li>The ghosting effect of old monochrome displays.</li> - <li>The rain more closely resembles the original from the first movie.</li> -</ul> +<p>There are three color settings: head, tail, and background. They are configured +by setting the 24-bit RGB channels using <code class="language-plaintext highlighter-rouge">COLOR_*_RED</code>, <code class="language-plaintext highlighter-rouge">COLOR_*_GRN</code>, and +<code class="language-plaintext highlighter-rouge">COLOR_*_BLU</code> definitions. The ghosting effect of old monochrome screens is +achieved by scaling the RGB channels. This results in a rain effect that +closely resembles the original from the first Matrix movie.</p> -<p>To use them, you need a terminal emulator that supports 24-bit RGB colors and -Unicode characters.</p> - -<p>The background, head, and tail colors of the rain can be configured via -<code class="language-plaintext highlighter-rouge">COLOR_BG_*</code>, <code class="language-plaintext highlighter-rouge">COLOR_HD_*</code>, and <code class="language-plaintext highlighter-rouge">COLOR_TL_*</code> settings. The <code class="language-plaintext highlighter-rouge">UNICODE_MIN</code> and -<code class="language-plaintext highlighter-rouge">UNICODE_MAX</code> values control the character set used for the rain. For instance, -use <code class="language-plaintext highlighter-rouge">0x30A1</code> and <code class="language-plaintext highlighter-rouge">0x30F6</code> for Katakana:</p> +<p>In addition, this implementation supports UTF-32 character sets. The +<code class="language-plaintext highlighter-rouge">UNICODE_MIN</code> and <code class="language-plaintext highlighter-rouge">UNICODE_MAX</code> controls the Unicode block used. For +instance, setting them to <code class="language-plaintext highlighter-rouge">0x30A1</code> and <code class="language-plaintext highlighter-rouge">0x30F6</code> rains Katakana:</p> <p><img style="width: 100%;" src="katakana.png" /></p> -<p>Happy ricing!</p> - <p>Files: <a href="source.tar.gz">source.tar.gz</a></p> </div> <p class="post-author right">by Wickramage Don Sadeep Madurange</p> |
