Skip to main content


Well just as I was preparing to start this blog full speed ahead, it just so happened that I was given an opportunity to intern/co-op at Tesla headquarters in Palo Allto, California. I was planning on finishing the development of my personalized STM32 boards which I want to use in the upcoming remake of my tutorial series. Now that project and the remake of the tutorials themselves will have to wait till later this year. I return from California at the end of April.
In the meantime, I will still upload small posts (with no videos) on STM32 programming. I will also document my experience working at Tesla and give as much detail about that as I legally can.

I will be removing my old STM32 videos from YouTube once I have a full fledge arsenal of videos to replace them with. So until then you can enjoy and learn from them. Feel free to shoot me an email with any suggestions concerning the content of this blog.

Edwin Fairchild


  1. You no need to delete old videos from YouTube - every bit and piece of information is important. Even if something missing, it is valuable for people like me who starting to use advanced programming and 'true C#', not sketches and Arduino 'weird-ings'. Thanks. Milan Karakas, Croatia.

  2. This is cool. So what is Tesla having you work on?
    I have been following Tesla and especially SpaceX for some time now..

    1. At Tesla I was working on their next gen power converter with the help of the lead engineers there. This involved hardware in the loop testing, using Robot Framework and python, among other things. I did terminate it early though because some personal matters were not going as planned. I am hoping to get an internship at NASA maybe within a year or so, well see how life goes.


Post a Comment

Popular posts from this blog

Interface a Rotary Encoder the right way.

So whilst reading my favorite odyssey found here I stumbled onto something I never spotted before. It turns out that the general purpose timers support hardware interfacing with an incremental encoder. This means no more interrupts and no need to increment whatever variable you had. Now all you have to do is get the value from the Count register in the timer. Did I also mention it takes care of figuring out which direction you are turning it? Amazing! Lets talk about it.

Encoder Interface Mode Verbatim from the reference manual of the STM32F103 page 392 or Section 15.3.12  "Encoder interface mode acts simply as an external clock with direction selection. This 
means that the counter just counts continuously between 0 and the auto-reload value in the 
TIMx_ARR register (0 to ARR or ARR down to 0 depending on the direction). So the user 
must configure TIMx_ARR before starting. In the same way, the capture, compare, 
prescaler, trigger output features continue to work as normal."

STM32L0/F0/F3 I2C : Part 3 RX TX via DMA

Most modern microcontroller come with a peripheral called DMA which allows for an even more hands-off approach. The Direct Memory Access controller will get a tutorial of it's own in the future. However, it is so simple to use that I can easily explain the required bits in this tutorial without feeling like I will overwhelm the reader. In this iteration of the I2C series I will cover how to TX and RX date on the peripheral in conjunction with the DMA controller. 

First let me briefly explain in a high level what the DMA controller does. It allows you to transfer data in 3 ways: Peripheral to memoryMemory to peripheralMemory to memory. What does this mean? For example, when you receive data on I2C in your RXDR register, you can have the DMA controller move that data received into an array. At the end of the day your variables are just memory locations, so if you have declared an array it has an address associated with it, this is address is what the DMA considers  "Memory"…

STM32 I2C Does it suck?

Recently I have been annoyed with  bugs in the I2C implementation in ST's F1/L1/F40/F2 series, and  any microcontroller made by ST before 2012. There appears to be, what I can only describe as, a race condition when attempting to receive data in I2C interrupt(low priority)  or polling mode.

Just to be clear a race condition is defined as , verbatim from wiki: "the behavior of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events. It becomes a bug when one or more of the possible behaviors is undesirable."
I was humming along trying to make my YouTube tutorials when I arrived to the I2C protocol implementation. I have used I2C with the F1 series plenty of times, however I have never had the need to receive data from a slave. However for the sake of completeness I decided to implement an RXing routine in I2C for my tutorial. Only to find statements like this in the referen…