Microcontroller datasheets can easily run to more than 600 pages today. Thankfully, Elektor has plenty of resources, such as beginner articles and books to help you get started. However, at some point, you are going to have to acquaint yourself with the real microcontroller documentation.

Although the microcontroller datasheet runs to so many pages, you're unlikely to find all the information you are looking for. To complement the datasheet, you will also have to find documentation for tools that turn source code into firmware, tools for developing code and debugging, and tools for mass-production programming. If you’re new to the world of microcontrollers, this guide will help you to understand where things are documented, how to read the hieroglyphics of their contents, and where to find out if there were any mistakes in what you were reading.


Subscribe
Tag alert: Subscribe to the tag Microcontrollers and you will receive an e-mail as soon as a new item about it is published on our website!

Microcontroller Documentation Example: PIC16F18877

To kick of part one of this series of three articles about microcontroller documentation, let’s focus on a simple, 8-bit microcontroller such as the Microchip Technology PIC16F18877, and what documentation is offered. Open that link and then click on “Documents.” You'll see that we are offered the datasheet, errata, some “Supporting Collateral” covering some application-specific items and evaluation boards, the programming specifications, and a long list of application notes. Further down there is some source code to accompany some of the application notes, some sales brochures, and a white paper on analog-to-digital converters (ADCs).

What Is in the Microcontroller Datasheet?

We’re going to start by downloading the datasheet for the PIC16F18877. Datasheets for microcontrollers can be quite daunting and, perhaps surprisingly, not everything you need to know is included. Figure 1 shows what you should find as a minimum.
 
Microcontroller documentation: Cover pages of PIC16F1877 datasheet
Figure 1: The opening pages list the features integrated into the microcontroller. (Source: Microchip Technology)
  • Detailed information on one or more microcontrollers — Often, several different microcontrollers with various numbers of pins and packages will be created from a single silicon die. Rather than create and maintain documentation for each variant, you’re more likely to find several devices covered in a single datasheet. This is the case here, as explained on page 1, with two variants covered: the PIC16F18857 and PIC16F18877.
     
  • Block diagram of the microcontroller — This typically includes the processing core (the level of detail varies; the more complex the core, the simpler its diagrammatic implementation), the memories, buses, and peripherals. From this, you can quickly ascertain the basic capabilities of the microcontroller. The microcontroller block diagram (Figure 2) appears on page 18, while a block diagram of the processing core is on page 33.
 
Block diagram of PIC16F1877 microcontroller
Figure 2: The block diagram is a good starting point to ascertain the overall capabilities of the microcontroller (left) and sometime the processing core too (right). (Source: Microchip Technology)
  • Packaging options — These will range from through-hole types (if still available) to a range of surface-mount options. In this example, they start on page 4.
     
  • Memory-size options — The microcontroller may well be offered with differing sizes of RAM, flash, EEPROM, and any other memory types, such as caches. In our example, we get a quick overview on page 3. The table lists memory sizes along with how many of each peripheral are implemented (Figure 3).
 
Memory options for PIC16F1877
Figure 3: Take a look at the memory options for the PIC16F18x7 variants, along with the peripherals implemented. (Source: Microchip Technology)
  • On-chip peripheral block diagrams — The functionality of on-chip peripherals are more easily explained in diagrams than words. Block diagrams provide a vital source of understanding as well as clarity on pin connections and clock sources, where the microcontroller features multiple clock outputs from its oscillator and, if implemented, PLL (phase-locked loop). We’ll take a look at some examples shortly in part 2 of the series.
     
  • Register descriptions — Each peripheral can be configured in a specific manner. For example, a UART (universal asynchronous receive/transmit serial interface) can often be configured for different baud rates, number of bits, etc. The register description explains how to configure the peripheral, and how to ascertain its state after something happens, such as receiving a byte of data. How these are deciphered is covered later in part two of the series.
     
  • Electrical specifications — These inform the user the limits in voltage and current that can be applied to or drawn from the microcontroller’s pins. These are typically defined twice: once as absolute maximum values, and once more as minimum, typical, and maximum values during normal operation. There are also timing characteristics, as shown in Figure 4, and can be found starting at page 592 in this datasheet.
 
PIC16F1877 electrical characteristics tables
Figure 4: Electrical specifications are provided as absolute limits, as well as minimum, typical, and maximum value for DC and AC values, as well as timing limits. (Source: Microchip Technology)
  • Recommendations for tools – You’ll need tools to convert source code to assembler and tools to debug the results. Most datasheets provide some sort of recommendation of the available tools. Here they are covered briefly on page 638.

Looking Ahead to Block Diagrams

With the basic structure of a microcontroller datasheet understood, we will next examine how registers are described and how to decipher the block diagrams. We will also be looking in detail at the two most important blocks of any microcontroller —  the clock and oscillator — and the implementation of the reset circuitry.
 

Editor's note: Read the entire series on Microcontroller Documentation.

Subscribe
Tag alert: Subscribe to the tag Embedded & AI and you will receive an e-mail as soon as a new item about it is published on our website!