Programming microcontrollers
In order for microcontrollerA computer chip used instead of a CPU that contains a processor, memory and inputs/outputs. to work correctly they must be programmingThe process of writing computer software.. This can be achieved using a wide range of softwareThe programs, applications and data in a computer system. Any parts of a computer system that aren't physical., hardwareThe physical parts of a computer system, eg a graphics card, hard disk drive or CD drive. and different programming languageA language used by a programmer to write a piece of software. .
Programming methods
Microcontrollers can be programmed using a range of different methods. These include:
- text-based programming languageA programming language that uses text-based commands, rather than visual elements., such as BASIC, C++ and Python
- block-based programming editorA programming editor that works by dragging and connecting blocks of instructions.
- flowchartAlso known as a flow diagram. A diagram that shows the step-by-step flow of an algorithm. software
Each have their own advantages and disadvantages:
Example of a flowchart program
The program below acts as a simple timer. When an input pinThe pins on an integrated circuit appear in two rows and are manufactured as dual in line (DIL) packages. detects a high (on) signal, it turns an output on for twenty seconds. Software such as PICAXE Editor, GENIE and Yenka can be used for writing flowchart programs.
Downloading a program
Once written and tested, the program must be downloaded onto the microcontroller. Many systems support in-circuit programmingHardware and software that allows a microcontroller to be programmed without being removed from the circuit.. This means the microcontroller does not have to be removed from the circuit to be programmed. For some systems, the chip may have to be taken from the circuit and placed in a special downloaderA device that allows a program to be downloaded from a computer onto a microcontroller.. A serialA cable used to transfer data to a microcontroller. or USB cable is commonly used to download the program.
Question
Describe what is meant by 鈥榠n-circuit鈥 programming.
The microcontroller is programmed without removing it from the circuit.