Intermediate C Programming for the PIC Microcontroller
Intermediate C Programming for the PIC Microcontroller, Apress
Simplifying Embedded Programming
Von Hubert Henry Ward, im heise Shop in digitaler Fassung erhältlich
Simplifying Embedded Programming
Von Hubert Henry Ward, im heise Shop in digitaler Fassung erhältlich
Produktinformationen "Intermediate C Programming for the PIC Microcontroller"
Delve into the exciting world of embedded programming with PIC microcontrollers in C. The key to learning how to program is to understand how the code works – and that is what you’ll learn here.
Following C Programming for the PIC Microcontroller, this book continues exploring the coding required to control the PIC microcontroller and can be used as a standalone single reference, or paired with the previous title to enhance your programming skills. You'll see how to control the position of a servo motor and use the compare aspect of the CCP module to create a square wave with varying frequency. You'll also work with the capture aspect of the CCP to determine the frequency of a signal inputted to the PIC and use external and internal interrupts.
This book breaks down the programs with line-by-line analysis to give you a deep understanding of the code. After reading it you’ll be able to use all three aspects of the Capture, Compare and PWM module; work with different types of interrupts; create useful projects with the 7 segment display; and use the LCD and push button keyboard.
WHAT YOU’LL LEARN
* Create a small musical keyboard with the PIC
*
Manage a stepper motor with the PIC* Use the main features of the MPLABX IDE
*
Interface the PIC to the real world*
Design and create useful programs based around the PIC18F4525
WHO THIS BOOK IS FOR
Engineering students and hobbyist who want to try their hand at embedded programming the PIC micros.
Hubert Ward has nearly 25 years of experience as a college lecturer delivering the BTEC, and now Pearson's, Higher National Certificate and Higher Diploma in Electrical & Electronic Engineering. Hubert has a 2.1 Honours Bachelor's Degree in Electrical & Electronic Engineering. Hubert has also worked as a consultant in embedded programming. His work has established his expertise in the assembler and C programming languages, within the MPLABX IDE from Microchip, as well as designing electronic circuits, and PCBs, using ECAD software. Hubert was also the UK technical expert in Mechatronics for three years, training the UK team and taking them to enter in the Skills Olympics in Seoul 2001, resulting in one of the best outcomes to date for the UK in Mechatronics.
Introduction
The Aims and Objectives of the Book
The Objectives of the Book
The Prerequisites
Chapter 1: Creating a Header File
Header Files
Creating a Header File
Creating a Project in MPLABX
Including the Header File
Create the Project Source File
Analysis of Listing 1.1
SynopsisChapter 2: Controlling a Seven Segment Display
The Seven Segment Display
Common Anode LED
Common Cathode
The Program
The Algorithm The Flowchart
The Listing for the Seven Segment Display
Improving the Seven Segment Display Program
The Issue with the Program
Arrays
Using Pointers
Analysis
The Improved Program
Exercise 2.1
Synopsis
Chapter 3: The 24 Hour Clock
The Seven Segment Display
The Algorithm
The Initialization of the PIC.
Analysis of Listing 3.1
A 24 Hr Clock with the LCD Display
Analysis of the Header File for the LCD
The Analysis of Listing 3.2 Improvements for the 24Hr Clock LCD Program
Using Switch and Case Key Words
Analysis of the New Subroutine
Chapter 4: Creating a Square Wave
Why Create a Square Wave?
Musical Notes
Exercise 4.1
The Speed of the Simple DC Motor
PWM Pulse Width Modulation
Creating a Square Wave
Creating a 500Hz Square Wave
The Mark Time or Duty Cycle
Creating Two Square Wave Outputs
Setting the Speed of a DC Motor
Driving the Motor
Creating a Three speed DC Motor Program
Varying the Space Width
Using A Variable Input Voltage to Control the Speed of a DC Motor
Creating a Musical Note
Creating the Middle C Note
Create a Musical Keyboard
The Analysis of Listing 4.6
Summary of Chapter 4Chapter 5: Making Music
Creating a Musical Note
Creating the Middle C Note
Chapter 6: The Stepper Motor
The Servo Motor
Controlling the Positions of the Servo Motor with a Variable ResistorChapter 7 :Interrupts
The Fetch and Execute Cycle
The Program Counter PC
The Sources of Interrupts
Setting the Interrupts
The Algorithm for the Interrupt Test Program The Analysis of the Listing 7.1.
Following C Programming for the PIC Microcontroller, this book continues exploring the coding required to control the PIC microcontroller and can be used as a standalone single reference, or paired with the previous title to enhance your programming skills. You'll see how to control the position of a servo motor and use the compare aspect of the CCP module to create a square wave with varying frequency. You'll also work with the capture aspect of the CCP to determine the frequency of a signal inputted to the PIC and use external and internal interrupts.
This book breaks down the programs with line-by-line analysis to give you a deep understanding of the code. After reading it you’ll be able to use all three aspects of the Capture, Compare and PWM module; work with different types of interrupts; create useful projects with the 7 segment display; and use the LCD and push button keyboard.
WHAT YOU’LL LEARN
* Create a small musical keyboard with the PIC
*
Manage a stepper motor with the PIC* Use the main features of the MPLABX IDE
*
Interface the PIC to the real world*
Design and create useful programs based around the PIC18F4525
WHO THIS BOOK IS FOR
Engineering students and hobbyist who want to try their hand at embedded programming the PIC micros.
Hubert Ward has nearly 25 years of experience as a college lecturer delivering the BTEC, and now Pearson's, Higher National Certificate and Higher Diploma in Electrical & Electronic Engineering. Hubert has a 2.1 Honours Bachelor's Degree in Electrical & Electronic Engineering. Hubert has also worked as a consultant in embedded programming. His work has established his expertise in the assembler and C programming languages, within the MPLABX IDE from Microchip, as well as designing electronic circuits, and PCBs, using ECAD software. Hubert was also the UK technical expert in Mechatronics for three years, training the UK team and taking them to enter in the Skills Olympics in Seoul 2001, resulting in one of the best outcomes to date for the UK in Mechatronics.
Introduction
The Aims and Objectives of the Book
The Objectives of the Book
The Prerequisites
Chapter 1: Creating a Header File
Header Files
Creating a Header File
Creating a Project in MPLABX
Including the Header File
Create the Project Source File
Analysis of Listing 1.1
SynopsisChapter 2: Controlling a Seven Segment Display
The Seven Segment Display
Common Anode LED
Common Cathode
The Program
The Algorithm The Flowchart
The Listing for the Seven Segment Display
Improving the Seven Segment Display Program
The Issue with the Program
Arrays
Using Pointers
Analysis
The Improved Program
Exercise 2.1
Synopsis
Chapter 3: The 24 Hour Clock
The Seven Segment Display
The Algorithm
The Initialization of the PIC.
Analysis of Listing 3.1
A 24 Hr Clock with the LCD Display
Analysis of the Header File for the LCD
The Analysis of Listing 3.2 Improvements for the 24Hr Clock LCD Program
Using Switch and Case Key Words
Analysis of the New Subroutine
Chapter 4: Creating a Square Wave
Why Create a Square Wave?
Musical Notes
Exercise 4.1
The Speed of the Simple DC Motor
PWM Pulse Width Modulation
Creating a Square Wave
Creating a 500Hz Square Wave
The Mark Time or Duty Cycle
Creating Two Square Wave Outputs
Setting the Speed of a DC Motor
Driving the Motor
Creating a Three speed DC Motor Program
Varying the Space Width
Using A Variable Input Voltage to Control the Speed of a DC Motor
Creating a Musical Note
Creating the Middle C Note
Create a Musical Keyboard
The Analysis of Listing 4.6
Summary of Chapter 4Chapter 5: Making Music
Creating a Musical Note
Creating the Middle C Note
Chapter 6: The Stepper Motor
The Servo Motor
Controlling the Positions of the Servo Motor with a Variable ResistorChapter 7 :Interrupts
The Fetch and Execute Cycle
The Program Counter PC
The Sources of Interrupts
Setting the Interrupts
The Algorithm for the Interrupt Test Program The Analysis of the Listing 7.1.
Artikel-Details
- Anbieter:
- Apress
- Autor:
- Hubert Henry Ward
- Artikelnummer:
- 9781484260685
- Veröffentlicht:
- 28.09.20