Blue pill blues

Every once in a while I get the question if the STM32F103 “blue pill” will be able to drive the TCD1304, and while the chip has enough peripherals to do all the driving and reading, it lacks a 2nd DMA-controller to handle communication.

Of course that doesn’t mean the mcu can’t be used in this application, it just means that my firmware can’t be ported to the F103 without rewriting at least parts of it.

But that isn’t what this post is about anyway, it’s actually about using a thermoelectric element to cool the TCD1304, to keep dark current down thereby enabling long(er) integration times.

Here is the CCD on top of the cold tip. The TEC-12706 is sandwhiched between the two aluminium plates. The lower plate will be secured to the chassis of the spectrograph, which in turn has a larger heatsink:

I forgot to check if the TEC is actually mounted with its cold side towards the CCD, but you get the picture. If not, here it is again from a slightly different angle:

Of course it’s more fun if the temperature can also be monitored, so there’s of course room for a thermistor in the setup:

And this is where the blue pill comes in. From the very early days of my Raman adventures I had an ili9341 lcd lying around, and it’s going to be reporting the temperature:

The STM32F103-driven ILI9341 LCD. This will likely be the only “fancy-feature” of the spectrometer. It’s only the temperature and voltage that are actually reported, the rest is just stuff to fill the screen. I wanted to put a limerick there instead, but I couldn’t find a suitable one.

The blue pill takes care of driving the lcd and reading the voltage across the TEC and the temperature of the cold tip.

Here is the STM32F103-ILI9341 source code

I realize that there’s a very useful stm32/arduino mash-up available, but I’ve become so familiar with STMicro’s SPL that I decided I’d rather stay with that, even if it means being limited to the not so pretty standard font.

I’m still working on the PSU for the TEC, so there’s regrettably not yet any actual readings of the CCD-temperature.

[1] I’ve used fagcinsk’s ILI9341 library.


4 thoughts on “Blue pill blues

  1. Gene Goldsand says:

    Hi Esben
    Even though I have been receiving your wonderful blog fine for a long making the head line about blue pills caused it to go into the Viagra spam bin.


    • Hej Gene
      Thank you for the heads up (and the kind words). Of course, I hadn’t thought about that. I guess it’s too late now for this particular post. In the future I will try and steer clear of references that could be interpreted this way.


  2. Hey esben, it looks like your project is gaining some ground again 🙂

    I really was hoping to get the 16 bit driver circuit working but to no avail, even David Allmon had to concede defeat, it was just way too fickle. Although I still have an idea for stabilizing it, but it will have to wait for now.


  3. Hej Dave
    Yes, with vacation here, I’ve been able to put a little more work into it. We will be travelling the rest of summer though, so it will be lying still (again) for the next month or so..

    It’s a shame the 16-bit ADC is causing so much trouble. If you ever feel up to it, you could probably get the nucleo board to talk to your excel-script. The interface is quite simple. You send 12-bytes (defining the integration time) over serial and wait for the nucleo to send data back (7388 bytes in total).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.