Chapter 2 examines the simple I/O port programming and shows sample programs on how to access the special function registers associated with the general purpose I/O (GPIO) ports. We also explore the new ISO C99 data types since they are widely used in IDE compilers for the embedded systems. Chapters Overview In Chapter 1, we examine the C language data types for 32-bit systems. Although we used the TI Launchpad Evaluation Kit to test the programs, the programs runs on other TI kits as long as they are based on Tivaâ„¢ C Series ARM ®آCortexâ„¢-M4F-based microcontrollers series. Among them are TI Launchpad Evaluation kits. TI ARM Trainer The TI has many inexpensive trainers for the ARM Tiva C series. They do work with other compilers including the TI CCStudio. For this book, we have used the Keil ARM compiler IDE to write and test the programs. TI provides Code Composer Studioâ„¢ (CCStudio) free of charge. Some vendors also provide their own compiler IDE for their ARM chips. Compilers and IDE Tools For programming the ARM chip, you can use any of the widely available compilers from Keil (IAR (or any other one. We know this approach is difficult and tedious, but the rewards are great. In this book, we have taken the second approach since our primary goal is to teach how to program the peripherals of an ARM chip. Much of these functions can be modified and used with another vendor if you decide to change the ARM chip vendor. The second approach is to access the peripheral's special function registers directly using C language and create your own custom library since you have total control over each function. For students and developers, the problem with this approach is you have no control over the functions and it is very hard to customize them for your project. These device library functions are copyrighted and cannot be used with another vendor's ARM chip. The vast majority of the vendors/ companies making the ARM chip provide a proprietary device library of functions allowing access to their peripherals. Use the functions written by the vendor to access the peripherals. Two approaches in programming the ARM chips When you program an ARM chip, you have two choices: 1. These few Assembly language programs also help to see the contrast between the C and Assembly versions of the same program in ARM. We have provided a couple of Assembly language programs for I/O ports in Chapter 2 for those who want to experiment with Assembly language in accessing the I/O ports and their special function registers. Throughout the book, we use C language to access the special function registers and program the TI ARM Tiva peripherals. This volume covers the peripheral programming of the TI (Texas Instruments) ARM Tiva chip. See the following link: For the peripheral programming of the ARM, we had no choice but to dedicate a separate volume to each vendor. Our ARM Assembly book is called "ARM Assembly Language Programming and Architecture" and is available from Amazon in Kindle format. We have dedicated the first volume in this series to the ARM Assembly language programming and architecture since the Assembly language is standard and runs on any ARM chip regardless of who makes them. This is due to the fact that special function registers and their physical address locations to access the I/O ports are not standardized and every licensee implements it differently. In other words, while one can write an Assembly language program for the ARM chip, and it will run on any ARM chip, a program written for the I/O ports of an ARM chip for company A will not run on an ARM chip from company B. While the licensee must follow the ARM CPU architecture and instruction set, they are free to implement peripherals such as I/O ports, ADCs, Timers, DACs, SPIs, I2Cs and UARTs as they please. Preface Since the early 2000s, hundreds of companies have licensed the ARM CPU and the number of licensees is growing very rapidly. Education can, alone, cause it to reveal its treasures, and enable mankind to benefit therefrom." Baha'u'llahĭedication To the faculty, staff, and students of BIHE university for their dedication and steadfastness. "Regard man as a mine rich in gems of inestimable value. Muhammad Ali Mazidi Shujen Chen Sarmad Naimi Sepehr NaimiĬopyright ©آ2014 Mazidi and Naimi All rights reserved TI ARM Peripherals Programming and Interfacing Using C Language for ARM Cortex
0 Comments
Leave a Reply. |