Programming 8-BIT PIC Microcontrollers in C with interactive hardware simulation pot

278 708 4
Programming 8-BIT PIC Microcontrollers in C with interactive hardware simulation pot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... 1 PIC Microcontroller Systems 1.1 PIC1 6 Microcontrollers ● MCU features ● Program execution ● RAM file registers ● Other PIC chips The microcontroller unit (MCU) is now big, or rather small, in electronics It is one of the most significant developments in the continuing miniaturization of electronic hardware Now, even trivial products, such as a musical birthday card or electronic price tag, can include... INT_TIMER1 CCP1 Timer1 capture or compare detected INT_CCP1 Timer2 Timer2 register overflow INT_TIMER2 CCP2 Timer2 capture or compare detected INT_CCP2 Change on single pin RB0 INT_EXT Port B pins Change on any of four pins, RB4–RB7 INT_RB Parallel Slave Port Data received at PSP (write input active) INT_PSP Analog Converter A/D conversion completed INT_AD Analog Comparator Voltage compare true INT_COMP... writing are Microchip’s own C1 8 compiler, Hi-Tech PICC, and CCS C CCS was selected for the current work because it is specifically designed for the PIC MCU, supports the 16 series devices, and has a comprehensive set of peripheral driver functions MPLAB C Project The primary function of the compiler is to take a source text file PROJNAME .C and convert it to machine code, PROJNAME.HEX The hex file can... MIPS, and the dsPIC (digital signal processor) high-specification range 1.2 PIC1 6 MCU Configuration ● Clock oscillator types ● Watchdog, power-up, brown-out timers ● Low-voltage programming ● Code protection ● In- circuit debug mode When programming the PIC microcontroller, certain operational modes must be set prior to the main program download These are controlled by individual bits in a special www.n... the chip is programmed Many PIC chips now have an internal oscillator, which needs no external components It is more accurate than the RC clock but less accurate than a crystal It typically runs at 8 MHz and can be calibrated in the chip configuration phase to provide a more accurate timing source Configuration Options Apart from the clock options, several other hardware options must be selected Watchdog... Microchip Inc.) instructions contain both the operation code and operand (immediate data, register address, or jump address) The mid-range PIC has a limited number of instructions (35) and is therefore classified as a RISC (reduced instruction set computer) processor Looking at the internal architecture, we can identify the blocks involved in program execution The program memory ROM contains the machine... process is described in detail in PIC Microcontrollers by the author The program could be written in raw binary code, but this would require manual interpretation of the instruction set Therefore, the machine code is generated from assembly code, where each instruction has a corresponding mnemonic form that is www.n ewn es p res s c o m Ch01-H8960.indd 22 6/10/2008 4:57:03 PM PIC Microcontroller Systems... machine code being read back from the chip to protect commercially valuable or secure code Optionally, only selected portions of the program code may be write protected (see WRT_X% later) In- Circuit Programming and Debugging Most PIC chips now support in- circuit programming and debugging (ICPD), which allows the program code to be downloaded and tested in the target hardware, under the control of the... special www.n ewn es p res s c o m Ch01-H8960.indd 8 6/10/2008 4:56:54 PM PIC Microcontroller Systems 9 configuration register separated from the main memory block The main options are as follows Clock Options The ‘877 chip has two main clock modes, CR and XT The CR mode needs a simple capacitor and resistor circuit attached to CLKIN, whose time constant (C ϫ R) determines the clock period R should be between... in Section 5.4 1.4 PIC1 6 Serial Interfaces ● USART asynchronous link ● SPI synchronous bus ● I 2C synchronous bus Serial data connections are useful because only one or two signal wires are needed, compared with at least eight data lines for a parallel bus plus control signals The typical www.n ewn es p res s c o m Ch01-H8960.indd 18 6/10/2008 4:56:58 PM PIC Microcontroller Systems 19 HOST PC PIC MCU . gaining ground in the industrial and commercial sectors. Interfacing PIC Microcontrollers and Programming PIC Microcontrollers present sample applications. including ● PIC Microcontrollers: An Introduction to Microelectronic Systems. ● Interfacing PIC Microcontrollers: Embedded Design by Interactive Simulation.

Ngày đăng: 06/03/2014, 17:20

Từ khóa liên quan

Mục lục

  • Cover Page

  • Foreword

    • Foreword

    • Preface

      • Preface

        • Links, Resources, and Acknowledgments

        • About the Author

        • Introduction

          • Introduction

          • Part 1: PIC Microcontroller Systems

            • Part 1: PIC Microcontroller Systems

              • 1.1 PIC16 Microcontrollers

              • 1.2 PIC16 MCU Configuration

              • 1.3 PIC16 MCU Peripherals

              • 1.4 PIC16 Serial Interfaces

              • 1.5 PIC16 MPLAB Projects

              • 1.6 PIC16 Program and Debug

              • Assignments 1

              • Part 2: C Programming Essentials

                • Part 2: C Programming Essentials

                  • 2.1 PIC16 C Getting Started

                  • 2.2 PIC16 C Program Basics

                  • 2.3 PIC16 C Data Operations

                  • 2.4 PIC16 C Sequence Control

                  • 2.5 PIC16 C Functions and Structure

                  • 2.6 PIC16 C Input and Output

                  • 2.7 PIC16 C More Data Types

                  • 2.8 PIC16 C Compiler Directives

Tài liệu cùng người dùng

Tài liệu liên quan