Diagnostico

Solo disponible en BuenasTareas
  • Páginas : 27 (6623 palabras )
  • Descarga(s) : 0
  • Publicado : 9 de septiembre de 2012
Leer documento completo
Vista previa del texto
M
• PIC16F870 • PIC16F871 • PIC16F872 • PIC16F873

PIC16F87X
Pin Diagram
PDIP, SOIC
MCLR/VPP RA0/AN0 RA1/AN1 RA2/AN2/VREF RA3/AN3/VREF RA4/T0CKI RA5/AN4/SS VSS OSC1/CLKIN OSC2/CLKOUT RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/CCP1 RC3/SCK/SCL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0/INT VDD VSS RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDAEEPROM Memory Programming Specification

This document includes the programming specifications for the following devices:
• PIC16F874 • PIC16F876 • PIC16F877

1.0

PROGRAMMING THE PIC16F87X

The PIC16F87X is programmed using a serial method. The Serial mode will allow the PIC16F87X to be programmed while in the user’s system. This allows for increased design flexibility. Thisprogramming specification applies to PIC16F87X devices in all packages.

MCLR/VPP RA0/AN0 RA1/AN1 RA2/AN2/VREF RA3/AN3/VREF RA4/T0CKI RA5/AN4/SS RE0/RD/AN5 RE1/WR/AN6 RE2/CS/AN7 VDD VSS OSC1/CLKIN OSC2/CLKOUT RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/CCP1 RC3/SCK/SCL RD0/PSP0 RD1/PSP1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

PIC16F876/873/872/870

40 39 38 37 36 35

RB7 RB6 RB5 RB4 RB3 RB2RB1 RB0/INT VDD VSS RD7/PSP7 RD6/PSP6 RD5/PSP5 RD4/PSP4 RC7/RX/DT RC6/TX/CK RC5/SDO RC4/SDI/SDA RD3/PSP3 RD2/PSP2

1.1

PIC16F877/874/871

Programming Algorithm Requirements

34 33 32 31 30 29 28 27 26 25 24 23 22 21

The programming algorithm used depends on the operating voltage (VDD) of the PIC16F87X device. Algorithm 1 is designed for a VDD range of 2.2V ≤ VDD < 5.5V. Algorithm 2 isfor a range of 4.5V ≤ VDD ≤ 5.5V. Either algorithm can be used with the two available programming entry methods. The first method follows the normal Microchip Programming mode entry of applying a VPP voltage of 13V ± .5V. The second method, called Low Voltage ICSPTM or LVP for short, applies VDD to MCLR and uses the I/O pin RB3 to enter Programming mode. When RB3 is driven to VDD from ground, thePIC16F87X device enters Programming mode.

1.2

Programming Mode

The Programming mode for the PIC16F87X allows programming of user program memory, data memory, special locations used for ID, and the configuration word.

 2002 Microchip Technology Inc.

DS39025F-page 1

PIC16F87X
PIN DESCRIPTIONS (DURING PROGRAMMING): PIC16F87X
During Programming Pin Name Function RB3 RB6 RB7 MCLRVDD VSS PGM CLOCK DATA VTEST MODE VDD VSS Pin Type I I I/O P* P P Pin Description Low voltage ICSP programming input if LVP configuration bit equals 1 Clock input Data input/output Program Mode Select Power Supply Ground

Legend: I = Input, O = Output, P = Power * In the PIC16F87X, the programming high voltage is internally generated. To activate the Programming mode, high voltage needs to beapplied to the MCLR input. Since the MCLR is used for a level source, this means that MCLR does not draw any significant current.

DS39025F-page 2

 2002 Microchip Technology Inc.

PIC16F87X
2.0
2.1

PROGRAM MODE ENTRY
User Program Memory Map

The contents of data EEPROM memory have the capability to be embedded into the HEX file. The programmer should be able to read data EEPROMinformation from a HEX file and conversely (as an option), write data EEPROM contents to a HEX file, along with program memory information and configuration bit information. The 256 data memory locations are logically mapped starting at address 0x2100. The format for data memory storage is one data byte per address location, LSB aligned.

The user memory space extends from 0x0000 to 0x1FFF (8K). InProgramming mode, the program memory space extends from 0x0000 to 0x3FFF, with the first half (0x0000-0x1FFF) being user program memory and the second half (0x2000-0x3FFF) being configuration memory. The PC will increment from 0x0000 to 0x1FFF and wrap to 0x0000, 0x2000 to 0x3FFF and wrap around to 0x2000 (not to 0x0000). Once in configuration memory, the highest bit of the PC stays a ‘1’, thus...
tracking img