1. Trang chủ
  2. » Công Nghệ Thông Tin

Programming 8 bit pic microcontrollers in C pot

278 1K 4

Đ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

Thông tin cơ bản

Định dạng
Số trang 278
Dung lượng 3,8 MB

Nội dung

[...]... 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... 4-MHz clock, the timer counts in microseconds (1-MHz instruction clock) The number of bits in the timer (8 or 16) w w w.ne w nespress.com Ch01-H8960.indd 13 6/10/20 08 4:56:55 PM 14 Part 1 Capture Signal Instruction Clock Clock Source Select Prescaler (Clock Divide) Capture Register Binary Counter Compare Register External Pulse Postscaler (Output Divide) Timer Overflow/ Time-out (Interrupt) Flag Match... main program download These are controlled by individual bits in a special www.n ewn es p res s c o m Ch01-H8960.indd 8 6/10/20 08 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 87 7 chip has two main clock modes, CR and XT The CR mode needs a simple capacitor and resistor circuit attached to CLKIN,... Table 1.3: Interrupts Sources in the PIC1 6F877 Interrupt Source Interrupt Trigger Event Interrupt Label Timer0 Timer0 register overflow INT_TIMER0 Timer1 Timer1 register overflow 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... 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/20 08 4:56: 58 PM PIC Microcontroller Systems 19 HOST PC PIC MCU Line Driver Interface TX1 Transmit RX1 Receive ϩ/Ϫ 12 V RX2 TX2 COM PORT Ground Ground Figure 1.10: USART Operation Bit Period 1 Time 0 Idle Start Bit Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit. .. period control Further details are provided in Interfacing PIC Microcontrollers by the author and the MCU data books When programming in C, only a limited knowledge of timer operation is necessary, as the C functions generally take care of the details A/D Converter Certain PIC pins can be set up as inputs to an analog-to-digital converter (ADC) The 87 7 has eight analog inputs, which are connected to... consumption The MCU configuration fuses must be set to the required clock mode when 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... detect function triggers an interrupt that allows the program to be restarted in an orderly way Code Protection (CP) The chip can be configured during programming to prevent the 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... between compilers in the library function syntax, but the general rules are the same Usually, a choice of compilers is available for any given MCU family Options for the PIC at time of writing are Microchip’s own C 18 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... Instruction Register File Address Program Address Working (W) Register Literal Status File Select Register Arithmetic & Logic Unit Opcode Status (Flag) Register Data Bus (8 bits) EEPROM 256 bytes MCU control lines Instruction Decode & CPU control Ports, Timers ADC, Serial I/O Timing control Clock Reset Port A B C D E Figure 1.3: PIC1 6F877 MCU Block Diagram subroutines, a similar process occurs The stack . Labcenter Electronics Ltd. Custom Computer Services Inc. ( www.ccsinfo.com ) Custom Computer Services Inc. specializes in compilers for PIC microcontrollers. The main range comprises PCB compiler. reference source. PIC, PICmicro, MPLAB, MPASM, PICkit, dsPIC, and PICDEM are trademarks of Microchip Technology Inc. Labcenter Electronics ( www.labcenter.co.uk ) Labcenter Electronics is. AM6/10/20 08 10:36:25 AM www.newnespress.com Preface This book is the third in a series, including ● PIC Microcontrollers: An Introduction to Microelectronic Systems. ● Interfacing PIC Microcontrollers:

Ngày đăng: 27/07/2014, 06:21

TỪ KHÓA LIÊN QUAN