NetBurner Mod5213 Programming Guide, Rev. 1.0 Page 2
Table of Contents
1 INTRODUCTION........................................................................................................................................................ 4
1.1 DEVELOPMENT KIT CONTENTS........................................................................................................................... 4
1.2 THE MOD5213 .................................................................................................................................................... 5
1.2.1 ColdFire 5213 Processor Block Diagram ................................................................................................. 5
1.2.2 Mod5213 Features....................................................................................................................................... 5
1.3 APPLYING POWER TO THE MOD5213................................................................................................................. 6
2 DEVELOPMENT KIT SETUP .................................................................................................................................. 6
3 RUNNING THE FACTORY DEMO ......................................................................................................................... 7
3.1 SETUP.................................................................................................................................................................. 7
3.2 DESCRIPTION OF THE FACTORY DEMO .............................................................................................................. 8
3.3 FACTORY DEMO COMMANDS.............................................................................................................................. 8
3.4 APPLICATION SOURCE CODE.............................................................................................................................. 9
4 COMPILE, DOWNLOAD AND RUN AN EXAMPLE PROGRAM.................................................................... 15
4.1 HARDWARE SETUP............................................................................................................................................ 15
4.2 OPEN THE SIMPLEGPIO PROJECT................................................................................................................... 15
4.3 COMPILE AND DOWNLOAD THE SIMPLEGPIO APPLICATION............................................................................ 17
4.4 SIMPLEGPIO SOURCE CODE ........................................................................................................................... 18
5 CREATING YOUR FIRST CUSTOM PROGRAM .............................................................................................. 19
5.1 USING THE APPWIZARD.................................................................................................................................... 19
5.2 APPWIZARD SOURCE CODE LISTING ............................................................................................................... 20
5.3 USING THE .CPP SOURCE CODE FILE EXTENSION ........................................................................................... 21
5.4 MODIFYING THE APPWIZARD EXAMPLE ........................................................................................................... 22
6 DETERMINING FLASH AND SRAM USAGE .................................................................................................... 23
7 HOW SERIAL FLASH DOWNLOADS WORK ................................................................................................... 24
8 POLLED AND INTERRUPT DRIVEN SERIAL PORT DRIVERS .................................................................... 25
8.1 POLLED VS. INTERRUPT DRIVEN....................................................................................................................... 25
8.2 EXAMPLE SERIAL POLLING AND INTERRUPT DRIVEN PROGRAMS ................................................................... 25
8.3 MODIFYING INTERRUPT SERIAL BUFFER VALUES ............................................................................................ 27
8.4 THE NETBURNER SERIAL API .......................................................................................................................... 27
8.4.1 Open a Serial Port ..................................................................................................................................... 27
8.4.2 Check if a Character is Available to be Read ........................................................................................ 28
8.4.3 Get a Character.......................................................................................................................................... 28
8.4.4 Write a Character....................................................................................................................................... 29
8.4.5 Close a Serial Port..................................................................................................................................... 29
8.4.6 Assign a Serial Port as Stdio.................................................................................................................... 29
8.4.7 Assign a Serial Port as Stderr .................................................................................................................. 30
8.4.8 Create a Serial File Pointer ...................................................................................................................... 30
9 GENERAL PURPOSE I/O AND THE NETBURNER PIN CLASS................................................................... 31
9.1 WHICH PINS CAN BE USED AS GPIO? ............................................................................................................ 32
9.2 WHAT IS THE NETBURNER PIN CLASS? ........................................................................................................... 32
9.3 PIN CLASS API SUMMARY ................................................................................................................................33
9.4 A SIMPLE PIN CLASS GPIO EXAMPLE ............................................................................................................. 33
9.5 A SIMPLE PIN CLASS SPECIAL FUNCTION EXAMPLE ....................................................................................... 34