diff options
author | uvok cheetah | 2020-02-23 20:34:36 +0100 |
---|---|---|
committer | uvok cheetah | 2020-02-23 20:35:12 +0100 |
commit | 3cbd61c3a7a72881d3bffc9fd9ac212ca3e2286a (patch) | |
tree | 4f6a2a33dc04cfe3cd9aad636360ec5836126795 | |
parent | 140023ea50d769c5cfe25aaf978588deddd3a31c (diff) |
Add MSP430 SPI blogpost
-rw-r--r-- | _posts/2020-02-23-msp430-spi-weirdness.md | 29 |
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! |