Microcontrollers operate using embedded software (firmware) which contains all the instructions for the device to deliver its correct function... this firmware is usually in the form of a HEX application file.
Typically a brand new microcontroller has no firmware loaded. First step is often to load a HEX bootloader file. This is special firmware which enables a communications port on the microcontroller in turn to enable a simplified procedure for uploading of HEX application files via USB or BLE.
If the microcontroller has no bootloader then all application firmware (and bootloader firmware if required) need to be loaded using some form of in-system programming interface. This is different for each type of microcontroller.
1/ Microchip PIC microcontrollers
=========================
These Microcontrollers are often used without a bootloader. In this case, HEX application files are uploaded using a Microchip PICKit device which acts as a in-system programmer.
If a bootloader is also installed then the microcontroller firmware can be updated using an on-board serial port. However, many mid/low range microcontrollers do not have any on-board serial port. For those that do, a USB-to-serial interface is needed. Many current circuit designs include a CH340 IC to perform this function.
2/ Atmel AVR microcontrollers
=======================
These microcontrollers include the ATImega series such as ATImega328 which is used in Arduino project boards.
Usually a bootloader is uploaded and the application HEX files are uploaded via a USB-to-serial interface. Application firmware is typically developed in the ATMEL Studio7 design environment or the Arduino design environment.
The easiest method to upload the bootloader at the outset (if it is not already loaded) is to use an additional Arduino board programmed as an in-system programmer.
3/ Nordic Semiconductor microcontrollers
===============================
These include the Nordic Semiconductor nRF51 and nRF52 series of microcontrollers. Examples of each are the nRF51822 and nRF52832 respectively.
Application HEX files and bootloader HEX files can be loaded using a J-LINK interface. These are included in nRF development boards and they can also to used to program external nRF devices.
Application firmware is developed, typically, in SES (SEGGER environment studio). Then, using an appropriately installed bootloader, the application files are uploaded either via USB or over-the-air via BLE. In both cases a special zip file is created to implement the upload.
In general, the J-LINK interface is used during programme development and for initial upload of the bootloader. Then, application files are added/updated via USB or BLE.
With nRF51/52 series devices there is one extra detail... the devices need additional firmware to enable the BLE interface to function. This firmware is called the SoftDevice. So, the SoftDevice must also be in place if application firmware is to be added/updated by BLE.
===
I appreciate this may be if limited interest to many sfi members and visitors... but hopefully of value to anyone who is considering getting started with microcontroller firmware design and/or upload of design HEX files.
Meanwlhile I have tried to cover quite a lot in this brief post... and no doubt I have made some mistakes or perhaps I was unclear in places... If so, as always, please jump in with clarifications or corrections... all welcome...!
C
Typically a brand new microcontroller has no firmware loaded. First step is often to load a HEX bootloader file. This is special firmware which enables a communications port on the microcontroller in turn to enable a simplified procedure for uploading of HEX application files via USB or BLE.
If the microcontroller has no bootloader then all application firmware (and bootloader firmware if required) need to be loaded using some form of in-system programming interface. This is different for each type of microcontroller.
1/ Microchip PIC microcontrollers
=========================
These Microcontrollers are often used without a bootloader. In this case, HEX application files are uploaded using a Microchip PICKit device which acts as a in-system programmer.
If a bootloader is also installed then the microcontroller firmware can be updated using an on-board serial port. However, many mid/low range microcontrollers do not have any on-board serial port. For those that do, a USB-to-serial interface is needed. Many current circuit designs include a CH340 IC to perform this function.
2/ Atmel AVR microcontrollers
=======================
These microcontrollers include the ATImega series such as ATImega328 which is used in Arduino project boards.
Usually a bootloader is uploaded and the application HEX files are uploaded via a USB-to-serial interface. Application firmware is typically developed in the ATMEL Studio7 design environment or the Arduino design environment.
The easiest method to upload the bootloader at the outset (if it is not already loaded) is to use an additional Arduino board programmed as an in-system programmer.
3/ Nordic Semiconductor microcontrollers
===============================
These include the Nordic Semiconductor nRF51 and nRF52 series of microcontrollers. Examples of each are the nRF51822 and nRF52832 respectively.
Application HEX files and bootloader HEX files can be loaded using a J-LINK interface. These are included in nRF development boards and they can also to used to program external nRF devices.
Application firmware is developed, typically, in SES (SEGGER environment studio). Then, using an appropriately installed bootloader, the application files are uploaded either via USB or over-the-air via BLE. In both cases a special zip file is created to implement the upload.
In general, the J-LINK interface is used during programme development and for initial upload of the bootloader. Then, application files are added/updated via USB or BLE.
With nRF51/52 series devices there is one extra detail... the devices need additional firmware to enable the BLE interface to function. This firmware is called the SoftDevice. So, the SoftDevice must also be in place if application firmware is to be added/updated by BLE.
===
I appreciate this may be if limited interest to many sfi members and visitors... but hopefully of value to anyone who is considering getting started with microcontroller firmware design and/or upload of design HEX files.
Meanwlhile I have tried to cover quite a lot in this brief post... and no doubt I have made some mistakes or perhaps I was unclear in places... If so, as always, please jump in with clarifications or corrections... all welcome...!
C