Example Source Code - Silicon Laboratories C8051F540DK User Manual

Table of Contents

Advertisement

C8051F540DK
5.4. Programming Utilities
The Silicon Labs IDE is the primary tool for downloading firmware to the MCU during development. There are two
software programming tools that are intended for use during prototyping or in the field: The MCU Production
Programmer and the Flash Programming Utilities. The MCU Production Programmer is installed with the IDE to the
directory C:\Silabs\MCU\Utilities\Production Programmer\ (default). The Flash Programming Utilities can be
optionally installed from the CD and is installed to C:\Silabs\MCU\Utilities\FLASH Programming\ (default).

6. Example Source Code

Example source code and register definition files are provided in the "SiLabs\MCU\Examples\C8051F54x\"
directory during IDE installation. These files may be used as a template for code development. The comments in
each example file indicate which development tool chains were used when testing. Example applications include a
blinking LED example which configures the green LED on the target board to blink at a fixed rate. Also included are
examples for each of peripherals of the MCU, such as the UART.
6.1. Register Definition Files
Register definition files C8051F540.inc, C8051F540_defs.h and compiler_defs.h define all SFR registers and bit-
addressable
control/status
bits.
These
files
are
installed
into
the
"SiLabs\MCU\Examples\C8051F54x\Header_Files\" directory during IDE installation. The register and bit names
are identical to those used in the C8051F54x data sheet.
6.2. Blinking LED Example
The
example
source
files
F540_Blinky.asm
and
F540_Blinky.c
installed
in
the
default
directory
"SiLabs\MCU\Examples\C8051F54x\Blinky" show examples of several basic C8051F540 functions. These include
disabling the watchdog timer (WDT), configuring the Port I/O crossbar, configuring a timer for an interrupt routine,
initializing the system clock, and configuring a GPIO port pin. When compiled/assembled and linked, this program
flashes the green LED on the C8051F540 Target Board about five times a second using the interrupt handler with
a C8051F540 timer.
6
Rev. 0.1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C8051F540DK and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents