I’m impressed. I’m lost…

I’ve received 5x ESP32 (because, you know, STM is now pretty hard to get).

First evening: unpacked one, flashed MicroPython, sta_if.scan()… nothing. What? It sees something only if very close to the router. Panicked, installed Arduino (no!!!!), flashed… nothing. It was late…

The next day, unpacked the other four, flashed Arduino WiFiScan. And everything works! Whaaaaat? Time to get my flatiron hot, and open this shield!

Do you see it?

Do you see the problem?

Continue reading “I’m impressed. I’m lost…”

A lot of small tasks…

This week was full of smaller tasks, do this, check that…

From bigger things: done Python script to combine multiple BOM.xlsx to one (adding quantity for the same parts, checking for errors (e.g. if one part has defined multiple different packages))

Bought more RAM (yeah, 12GB)!

Fixed some bugs in nRF24L01+ library.

And I did some research in security for data exchange… I want to do my own protocol, with some security level (at least prevention from replay attacks), and ideally with a kind of automatic network configuration.

MQTT protocol idea looks very promising, it would be nice to make low-level alternative for the microcontrollers.

My plan is to take MQTT, one-net (sadly, this project is already dead), and nRFmesh Arduino library, and blend them together into something new, lightweight, cool, and (hopefully) secure.

So, this week I’ve learned something about XTEA (-1, -2, -3), XXTEA, nonce, cnonce, and other strange things.

Vacation

Still enjoying my vacation.

Ice cream, parks, museums, and good weather.

Still, I managed to assembly two boards (yeah, the flatiron soldering project works!)

Now testing FRAM (512 bytes only, but can be written 1012 times, and at 35°C can retain data 200 years, and it is really RAM). Very funny addressing of internal memory (MSB of RAM address is part of device I2C address… )

Now, after an extremely long pause, I’m trying to bring nRF24L01+ modules to life. not so happy with standard libraries, I think I’ll be inventing my own bicycle

Add and mix Flatiron, DMA, notes, Super Mario, Python, Tkinter…

My flat-iron soldering device works, the temperature can be precisely regulated, the profile can be changed, and the device follows it precisely enough.

But it was not enough… I needed sound! I wanted a simple piezo, but I couldn’t find one in my boxes. But I’ve found some small laptop speakers.

Speakers need sinus (okay, okay, square signal also good enough, but sinus is much better). STM32F103C8T6 has no DAC, so I need to use the PWM. For high frequencies and good enough time resolution, it should be very frequently updated. (For ~5kHz sinus and 7-bit amplitude resolution, with core clock 48MHz I need to update the PWM… let’s calculate: 48 000 000 / 2^7 / 5 000 ~ every 75 clocks. This is really time-consuming, for example, each for needs about 12 clocks. It is almost impossible to do it with a CPU. DMA comes to the rescue!

You need just to say where to take the data and where to put this data, increment the pointer or not, how many times to do this, and should it automatically cycle, or not. Oh yes, and turn the DMA trigger too, so it automatically updates DMA when it is ready to do so.

Turned it on… nothing. Changed channel… nothing. Cleaned build, recompiled… nothing. Enabled with debugger registers – works! Two days clicking here and there – nothing… Disabled in CubeMX everything and turned it on again – yes, now it works. Oh, it was simply wrong order, CubeMX tried to init the DMA registers and only then to enable the DMA…

Okay, now I can put the sinus and even play some notes, but it was not enough.

My colleague gave me an excellent idea – Mario sounds! Some more days learning about notes, pauses, sharps, and flats, watching some youtube videos “how to play Mario level complete”, and now it plays “coin” sound then goes to next reflow step, “level complete” at cooldown and “lose a life” in case of error. Nice!

Now I’m programming py program to automatically read the data, display it and save it… My first interface with Tkinter! Sooo proud!

HAL_SPI_Receive & RXONLY bug (STM32)

I need to get data from MAX6675 Cold-Junction-Compensated K-Thermocouple to-Digital Converter (0°C to +1024°C).

I need only to read 16 bit and I good. Sounds easy? Not so fast!

Almost every MAX6675 library used full-duplex SPI mode with sending dummy bytes to /null.

I don’t need that, I thought. Let’s configure Cube:

  • Mode: Receive Only Master
  • Data Size: 16 bits

Great, now a bit code:

Continue reading “HAL_SPI_Receive & RXONLY bug (STM32)”

Flat Iron for PCB soldering (WIP)

My VFD demonstrator (on-table clock) is almost ready

I plan to add BME280 for temperature/RH/pressure measurement…

But Flat-Iron soldering plate project takes my mind… I started from smaller things, like HD44780, and was surprised, how crapy some libraries are…

I’ve checked first, older one, and this was horrible. A lot of peaks, long transmission (3.5ms!)

So I’ve found newer one (with HAL (I think it is okay)), and it had also horrible timings (short delays are too long, and long delays are too short…)

Continue reading “Flat Iron for PCB soldering (WIP)”