[ N O C T E R N I T Y ] Contributing to the general pollution of the internet

13Nov/120

Stuck on the CS43L22

I have not been making much progress lately. I am trying to get the board to produce sound through its CS23L22 chip. So far, I've managed to:

  • make it accept commands through I2C (which I know succeeded because, well, the commands do not timeout),
  • enable and configure the I2S bus.

I've been sending data on it (basically a simple 440Hz sine wave), but there is no output. I know the bus' clock is configured correctly, because I've been pumping the data onto it directly through SPI3's data register, and toggling a LED every 22100 samples, which works just right (the LED blinks with a period of 2s). I also know that the chip works (because it does produce sound when I run the board's original firmware).

I'm quite sure it's something extremely silly I'm forgetting to do, or doing in the wrong order somewhere... but I have no clue where and what it is.

7Nov/120

RS232 != TTL

Ok, I've said it before, but repeating it one more time won't hurt: when it comes to electronics or hardware, I am completely ignorant. So, yesterday morning, I spent the best part of 3 hours trying to plug the STM32's UART ports on a PC DE9 interface, trying to get the code to work and fiddling with Minicom's settings.

Then I looked it up. As it turns out, signals from the microcontroller are encoded using TTL (where a voltage close to 0V indicates a zero, while a voltage close to the chip's power supply voltage indicates a one), while RS232 relies on a negative voltage to indicate a zero.

*cough* I felt really silly.

So I looked up how to interface both. There are many schematics and explanation on the web; this explanation is quite good, and I ended up using their schematics and some parts I already had to build one (well, I didn't add the LEDs because I didn't see much point in these).

Here's the result:

And, if that can help, here are the schematics for the board itself (not exactly the one shown above, as I'd made a bit of a mistake):

And the list of parts:

Parts
R1 R2 R3 R4 R5 10kΩ
C1 10µF, 50V
D1 1N914
Q1 2N3906
Q2 2N3904