

|
| Beginner's Guide to Embedding C Programming Vol 3 |
In his “Beginner’s Guide to Embedded C” and
“Beginner’s Guide to Embedded C – Volume 2” books Chuck Hellebuyck took the
reader through the very beginning of learning how to program embedded microcontrollers
in the C language using a Microchip PIC microcontroller and the Microchip
HI-TECH C compiler.
In “Beginner’s Guide to Embedded C Programming – Volume 3” Chuck Hellebuyck
takes another leap forward by showing you the steps to create the SimpleC
library of functions that make programming in C even easier. This approach
shows the reader how they can create their own functions and expand the SimpleC
library to make creating microcontroller projects much quicker than writing
in raw C code. This book will clearly be the reference for future programmers
who want to build electronic gadgets without all the painstaking steps of
writing every C statement while producing a working project in less time
and with less effort.
The SimpleC library will make the following functions as easy as one command
line:
• Controlling Digital Outputs
• Reading Digital Inputs
• Monitoring Analog Voltages
• Driving Liquid Crystal Display Modules
• Driving Digital PWM Signals
• Sending/Receiving via SPI and I2C Communication
• Writing to/Reading from External EEPROM
• Writing to/Reading from External I/O Expanders
• And More!
The book uses the open source PIC16F886 based CHIPINO module for the hardware
and also forms the platform to make future electronic projects and gadgets
easier to build.
Table of Contents
Introduction 7
Chapter 1 – Getting Started
9
Choosing a Development Board
9
Programmer Options 13
HI-TECH C Compiler 15
Final Setup 16
Chapter 2 – Using I2C Communication
19
What is I2C? 19
Inside the I2C Peripheral 22
Project Description 25
Hardware 26
Software 28
How it Works 33
Next Steps 39
Chapter 3 – Creating the SimpleC Library
41
SimpleC Software Description
42
Initialization and Time Delays 42
I/O Control 44
LCD Character Module Control 48
PWM Control 53
USART Communication 53
SPI Communication 58
I2C Communication 65
simplec1.1.h – How it Works 71
simplec1.1.c – How it Works 75
Chapter 4 – SimpleC Digital Output
99
Project Creation in MPLAB
99
Hardware 110
Software 111
How it Works 112
Next Steps 113
Chapter 5 – SimpleC Digital Input
115
Hardware 115
Software 117
How It Works 118
Next Steps 120
Chapter 6 – SimpleC LCD Control
121
Hardware 121
Software Project 1 123
How it Works Project 1 124
Software Project 2 126
How it Works Project 2 127
Next Steps 128
Chapter 7 – SimpleC Analog Input
129
Hardware 129
Software 131
How it Works 132
Next Steps 134
Chapter 8 – SimpleC SPI Communication
135
Project 1 – Serial EEPROM
135
Hardware 135
Software 137
How it Works 138
Next Steps 141
Project 2 – Inputs from MCP23S08 142
Hardware 142
Software 144
How it Works 145
Project 3 – Outputs from MCP23S08 148
Hardware 148
Software 149
How it Works 150
Next Steps 152
Chapter 9 – SimpleC Pulse Width Modulation
153
Hardware 153
Software 156
How it Works 156
Next Steps 158
Chapter 10 – SimpleC Creating Pulses
159
Hardware 159
Software 162
How it Works 163
Next Steps 165
Chapter 11 – SimpleC RS232 Communication
167
Hardware 167
Software 172
How it Works 174
Next Steps 177
Chapter 12 – SimpleC I2C 179
Hardware 179
Software 181
How it Works 182
Next Steps 184
Conclusion 185
Appendix A – CHIPINO Board Schematic
187
Appendix B – SimpleC Quick Reference
189
Index 191
|
| Send to friend |
| Recommended products list |
|