Appendix B Ledblinker.c - Motorola Digital dna MSC8101ADS Manual

Table of Contents

Advertisement

Running LEDblinker from Internal SRAM

Appendix B LEDblinker.c

10
Freescale Semiconductor, Inc.
/*
file name: LedblinkerOutOfFlash.c
v0.1
drs
15May01
original
v0.2
dm
07June01 clean up
v0.3
drs
30Jan02
clean up
v0.4
drs
01Apr02
Add comments for Sinit()
Description: Flash green and red LED on MSC8101ADS board
(green on, green off, red on, red off, then repeat all)
Notes:
1.
Change loop time in FlashLed if running out of internal
SRAM/Flash.
2.
Take out Sinit() if running code from internal SRAM (ie. using
debugger)
*/
#include "msc8101.h" // memory map registers and locations
#define OFF 0
#define RED 1
#define GREEN 2
#define GP_LED0_PIL 0x02000000
#define GP_LED1_PIL 0x01000000
// function prototypes
void Led( UWord16 );
void FlashLed( UWord16 );
void init( void );
// global variables
UWord32 *BCSR0; // Board Control and Status Register Address Values.
Register bit
UWord32 *BCSR1;
UWord32 *BCSR2;
t_8101IMM *IMM; /* IMM base pointer */
void main(void)
{
Sinit();
init();
// initialize variables, pointers, LEDs, ...
while ( 1 ) {
FlashLed( GREEN );
FlashLed( RED );
}
}
/*------------------------------------------------------------------------
--
*
* FUNCTION NAME: init
* DESCRIPTION:
8101 and 8101ADS initialization
*
*/
void init( void ) {
For More Information On This Product,
Go to: www.freescale.com
// TAKE OUT IF RUNNING FROM INTERNAL SRAM
// Initialize IMMR and disable watchdog

Advertisement

Table of Contents
loading

Table of Contents