STARTUP DESIGNS FOR EMBEDDED PROGRAMS
Applies to: General Topics
Information in this article applies to:
- C166 All Versions
- C251 All Versions
- C51 All Versions
Are there any things that my embedded program should do when it
starts? For example, is there a POST or Power On Self Test that is
standard that I should use?
C Run-Time Initialization
This is the process that
clears memory to 0 and initializes the contents of global
variables. Fortunately, most of this is handled by the startup code
that is provided with the Keil C Compilers. You should probably
start a new project by copying the startup code (STARTUP.A51,
START251.A51, or START167.A66) to your project directory and
including it in your project. You may need to customize these files
for your target system.
Power Stabilization Delay
In many systems, the CPU
may start running before the power supply is completely stabilized.
The easiest way to avoid reset problems due to noisy power systems
is to insert a 100ms or so delay in the startup code. It is best to
watch the power-up sequence with a digital storage scope to see how
long this takes.
A ROM checksum is a method ot verifying
that the program code is valid. This is an easy test to perform.
Refer to GENERAL: GENERATING A ROM CHECKSUM for details.
A RAM test verifies that the RAM in your
system is working. There are, of course, numerous ways to test the
RAM in your system.
Test Other Peripherals
You should probably test any
peripherals that are required for proper operation of your
Article last edited on: 2005-07-09 10:00:04
Rate this article
Disagree? Move your mouse over the bar and click