Friday 12 January 2024

Microcontrollers, Bootloaders, Serial Programming , FTDI , USB & TTL

Micro-controllers are everywhere these days.
In the synth world especially. So its good to know a bit about them and some basic programming concepts.
 

This link is useful for a brief intro into the different types of microcontrollers:
 
The pic above is a specific AVR microcontroller.
AVR microcontrollers are manufactured by Atmel. They are very common & have several advantages over other types of microcontroller.  
 
 Some mostly used AVR microcontrollers are:-

    ATmega8 microcontroller
    ATmega16 microcontroller
    ATmega32 microcontroller
    ATmega328 microcontroller
 
Amtel is not the only microcontroller maker.
 

 This is a ARM cortex STM32
It's made by STMicroelectronics.
They are a French-Italian multinational electronics and semiconductors manufacturer headquartered in Plan-les-Ouates near Geneva, Switzerland.
I'm mentioning them specifically, as you will see them used quite a lot in synth modules. 

There are two ways to program a microcontroller. One is to reprogram the entire chip using a programmer. The other is to use a bootloader  

A bootloader is a bit of software that is pre-programmed onto the chip.
It runs in a separate memory space on the microcontroller separated from the main application space.
In the case of a simple microcontroller it can accept firmware upgrades that allows the chip to re-program itself. 
In a full blown computer its  the program that is responsible for booting a computer
When a computer is turned off, its software‍—‌including operating systems, application code, and data‍—‌remains stored on non-volatile memory.
So when the computer if turned on, its that first bit of software that loads the OS, etc etc. 
 
Using a bootloader in a simple microcontroller is safer way to program, as you can't easily brick the chip.
But to upload using a bootloader you need a computer-serial connection (such as an FTDI cable).
 
This is a FTDI USB to TTL serial converter module.
 
It is the bridge between the USB connection of the computer and the TTL serial connection
on your PCB.
Note, that when we use the term ‘serial’ for these converters we are referring to TTL serial data
 
This from Jaycar

 Notice the 6 pins.
 
 This is a cheap Ebay module. about $5 AUD
 

Notice the switch which convert between 3.3V to 5V

These devices are used for general serial applications. It is popularly used for communication to and from microcontroller development boards such as ESP-01s and Arduino micros, which do not have USB interfaces.
 
The USB power has over current protection, using 500MA self-restore fuse
RXD/TXD transceiver communication indicator

Pin definition: DTR,RXD,TXD,VCC,CTS,GND
 
--------
 FTDI adapters can send any serial data back and forth including updating AVRs with a bootloader on them. But you need to get that bootloader on there first, which basically requires an AVR programmer (like a USBtinyISP ),. 
 
Unfortunately, they are not the same device! 

-----------
Note: 
You may also be able to use a FTDI cable

The FTDI cable is a USB to Serial (TTL level) converter which allows for a simple way to connect TTL interface devices to USB.
 ---------
 
 + Microcontroller... What you need to program a MCU 
Microcontrollers... Programmers
 
 
 

No comments:

Post a Comment