AN2157 Freescale Semiconductor / Motorola, AN2157 Datasheet - Page 10

no-image

AN2157

Manufacturer Part Number
AN2157
Description
MSC8101 Programming the MSC8101ADS Flash Memory
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Running LEDblinker from Internal SRAM
Appendix B LEDblinker.c
10
/*
file name: LedblinkerOutOfFlash.c
v0.1
v0.2
v0.3
v0.4
Description: Flash green and red LED on MSC8101ADS board
(green on, green off, red on, red off, then repeat all)
Notes:
1.
SRAM/Flash.
2.
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)
{
}
/*------------------------------------------------------------------------
--
*
* FUNCTION NAME: init
* DESCRIPTION:
*
*/
void init( void ) {
Change loop time in FlashLed if running out of internal
Take out Sinit() if running code from internal SRAM (ie. using
drs
dm
drs
drs
Freescale Semiconductor, Inc.
Sinit();
init();
while ( 1 ) {
}
For More Information On This Product,
15May01
07June01 clean up
30Jan02
01Apr02
Go to: www.freescale.com
8101 and 8101ADS initialization
FlashLed( GREEN );
FlashLed( RED );
original
clean up
Add comments for Sinit()
// initialize variables, pointers, LEDs, ...
// TAKE OUT IF RUNNING FROM INTERNAL SRAM
// Initialize IMMR and disable watchdog

Related parts for AN2157