In envisaging a new microcontroller design, it is prudent to follow a design procedure that will take you from the initial problem statement to a programmed microcontroller that can be embedded in application hardware. In this article, we look at key steps to follow when you are designing a new microcontroller-based system.
Contents
Explain the desired function of the device, that is, what the intended microcontroller system is supposed to accomplish.
Sketch a block diagram that demonstrates all of the key components of the design and shows how they are interconnected. Each component can be illustrated as a square with a descriptive label inside or preferably, as a pictorial representation. Utilize single lines to connect the components regardless of the number of wires that may be involved, and incorporate arrowheads to indicate the direction of signal flow.
Identify and list the types of inputs and outputs needed, and what functions are required to be done by the microcontroller. For example, you are required to identify the number of every type of I/O line you may need, including digital inputs, digital outputs, analog-to-digital converters (A/D), digital-analog-converters (D/A), and the serial ports.
Depending on types and the number of inputs and outputs that have been identified in step 3, select one or more microcontrollers that have enough on-chip resources. The expected amount of program and data memory required will also guide you on which choices are appropriate. For example, a very complex program with significant data storage requires a microcontroller with sufficient memory capacity.
Using the microcontroller input and output circuit specifications to design the appropriate interface circuitry using pull-up resistors, buffers, transistors, relays, and amplifiers where necessary. Much of the information can be found in the Microcontroller documentation i.e. datasheets and through your own research.
Related:
Most microcontroller programmers use C, while others use assembly language. If you are working with PIC microcontrollers, you may also use PICBASIC Pro especially when working with simple programs. Note that, we have other key factors that can influence which programming language to use. For example, if your programming solution requires complicated calculations, algorithms or data structures, then C is the appropriate choice, on the other hand, if you application requires extremely fast execution speed or if the memory capacity is a limiting factor, then assembly language is the better choice.
Related articles:
Sketch a detailed schematic showing the required components, input and output interface circuitry, and wire connections.
A flowchart is a graphical representation of the required functionality of your software; this is illustrated in the figure below:
The flow control block is used as a destinationfor a GOTO branch or a loop e.g. for or while loops. The functional block represents one or more instructions that perform some task. The decision block is used to represent logic decisions.
After creating the program flowchart, implement it in software by writing code to create the desired functionality.
Software development tools like IDE can help in developing the code. Compile your code into machine code and download the resulting hex file (burn the code) to the microcontroller. This can be done using a programming device available for the specific microcontroller you are working with. After downloading the code, assemble the system hardware, including the microcontroller, and interface circuitry. After that, fully test the system for the desired functionality. These last two steps can be done incrementally, as you build the functionality, while carefully testing each addition before continuing. A case in point is handling each input incrementally, and testing the output functionality.
Related articles:
The world of electronics is constantly evolving, allowing designers and manufacturers to push the boundaries…
PIC microcontrollers are fabricated by Microchip Technology. PIC16C84 and PIC16F84 are the two microcontrollers in…
The ADD instruction tells the microcontroller’s CPU to add the source byte to register A…
8-bit microprocessors are limited in their speed (the number of instructions that can be executed…
The 68HC11 (also abbreviated as 6811 or HC11) is an 8-bit microcontroller that was introduced…
Mutual exclusion typically imposes some conditions on access to a given resource by two or…