Startup Without Peripheral Libraries

Almost all microcontroller manufacturers provide peripheral libraries that are intended to make development using their products faster and easier.  In some instances, these libraries work well and really accelerate development.  On the other hand, some libraries contain bugs, only cover a subset of the peripheral features, add huge amounts of overhead, or require so much research and exploration that you might as well just use the reference guides and program the registers yourself.

I generally only use the manufacturer provided peripheral libraries for items that are very complex such as USB and Ethernet.  Instead, I read the references and program the registers myself.  I have discovered that once you start doing more complex things with your chosen MCU, sooner or later you need to understand the peripherals on the register level.  The best way for me to do this is to simply start out using the registers.

Whether you use your own peripheral code or the libraries, you need to be comfortable with what they are doing and verify that it matches the documentation as you understand it.

In my motor control microcontroller performance comparison post, I used a selection of different MCUs.  This series of posts is intended to cover how I got them working using only the bare minimum of libraries.

I will cover the following processors.  However, the basic code should work for all variations in the same family:


Leave a Reply

Your email address will not be published. Required fields are marked *