summaryrefslogtreecommitdiff
path: root/_posts/2020-02-23-msp430-spi-weirdness.md
diff options
context:
space:
mode:
Diffstat (limited to '_posts/2020-02-23-msp430-spi-weirdness.md')
-rw-r--r--_posts/2020-02-23-msp430-spi-weirdness.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/_posts/2020-02-23-msp430-spi-weirdness.md b/_posts/2020-02-23-msp430-spi-weirdness.md
new file mode 100644
index 0000000..982c962
--- /dev/null
+++ b/_posts/2020-02-23-msp430-spi-weirdness.md
@@ -0,0 +1,29 @@
+---
+layout: post
+title: MSP430 SPI weirdness
+date: 2020-02-23 20:25 +0100
+language: en
+categories: [tech]
+---
+
+So, I've been fiddling around with my MSP430 Launchpad for a while,
+with the goal to build myself an ePaper doorsign. As ePaper I used
+the Waveshare ones which are controlled via SPI.
+
+It took a lot of fiddling around, head scratching, shouting and swearing,
+and probing with a logic analyzer (Logic Shrimp, which has its own issues with
+Sigrok / PulseView, or v.v., since the dump was reversed) to find out how
+to configure clock phase and polarity.
+
+Since I also want to use an MFRC522 reader to "select" the content to display,
+I took another dive into the datasheet to figure out which SPI mode I had to
+select.
+
+Then it hit me: Texas Instruments' definition of `CPHA=0` and `CPHA=1` was
+"backwards" from what I'm used to from STmicroelectronics' STM32F1. It's
+also backwards from what Wikipedia says.
+
+For TI, `CPHA=0` means "Change on leading clock egde, capture on trailing",
+while `CPHA=1` means "Capture on trailing clock edge, change on trailing".
+
+This is pretty annoying!