PIC16F876A-I/SP

PIC16F876A-I/SP

Part Number: PIC16F876A-I/SP

Manufacturer: Microchip Technology

Description: IC MCU 8BIT 14KB FLASH 28SPDIP

Shipped from: Shenzhen/HK Warehouse

Stock Available: Check with us

Technical Specifications of PIC16F876A-I/SP

Datasheet  PIC16F876A-I/SP datasheet
Category Integrated Circuits (ICs)
Family Embedded – Microcontrollers
Manufacturer Microchip Technology
Series PIC? 16F
Packaging Tube
Part Status Not For New Designs
Core Processor PIC
Core Size 8-Bit
Speed 20MHz
Connectivity I2C, SPI, UART/USART
Peripherals Brown-out Detect/Reset, POR, PWM, WDT
Number of I/O 22
Program Memory Size 14KB (8K x 14)
Program Memory Type FLASH
EEPROM Size 256 x 8
RAM Size 368 x 8
Voltage – Supply (Vcc/Vdd) 4 V ~ 5.5 V
Data Converters A/D 5x10b
Oscillator Type External
Operating Temperature -40°C ~ 85°C (TA)
Package / Case 28-DIP (0.300″, 7.62mm)
Supplier Device Package 28-SPDIP

PIC16F876A-I/SP Description

This powerful CMOS FLASH-based 8-bit microcontroller is easy to program because it only needs 35 single-word instructions. It fits Microchip’s powerful PIC® architecture into a 28-pin package and is compatible with the PIC16C5X, 2 capture/compare/PWM functions, PIC12CXXX, and PIC16C7X devices. EEPROM data memory for the PIC16F876A is 256 bytes, self-programming, 5 channels of 10-bit Analog-to-Digital converters, and an ICD. These features make it perfect for more advanced A/D applications in the automotive, industrial, appliance, and consumer applications.

PIC16F876A-I/SP Features

  • RISC with high-performance CPU
  • Reset the power.
  • Start-up timer.
  • SLEEP mode uses less power.
  • completely static design.
  • protection for program code.

Detailed Description

● PCL and PCLATH

The PC, or Program Counter, has 13 bits. The low byte comes from the PCL register, which is a register that can be read and written to. The top bits (PC) can’t be read, but they can be written to indirectly through the PCLATH register. Whenever you Reset, the top parts of the PC will be wiped clean.

● Program Memory Paging

All PIC16F87XA devices can access an 8K-word program memory block running in one direction. The GOTO and CALL instructions only require 11 bits of the address to enable branching within any 2K program memory page. The upper two bits of the address are provided by PCLATH when a CALL or GOTO instruction is executed. The page choose bits must be set before performing a CALL or GOTO instruction to address the correct program memory page. The 13-bit PC is removed from the stack upon the return of a CALL instruction (or an interrupt). Hence, there is no requirement for the RETURN instructions to interact with the PCLATH bits (which POPs the address from the stack).

● EEADR and EEADRH

Up to 256 bytes of data EEPROM or up to 8K bits of program EEPROM can be referenced using the EEADRH and EEADR registers. The EEADR register only receives the LSByte when a data address value is selected. When a program address is selected, the address’s MSByte and LSByte are written to the EEADRH and EEADR, respectively. The Most Important bits of the registers are not used if the device’s memory capacity is smaller than the whole address range of the address register pair. The Most Significant bit of the EEADR is not used when accessing data EEPROM, for instance, if the device has 128 bytes of data EEPROM.

● EECON2 and EECON1 Registers

EECON1 is the register that controls how memory is accessed. The EEPGD control bit tells whether the access will be to the program or data memory. When it’s clear like when it’s reset, any operations after will work on the data memory. Any subsequent activities will use the program memory once it has been configured. The RD, control bits and WR tell the computer to read, write, or erase. In software, these bits can only be set, not cleared. When a write or read operation is done, the hardware clears them. Because software can’t clear the WR bit, a write operation can’t be stopped early by accident.

When the WREN bit is set, it lets you erase or write. The WREN bit is clear when the power comes on. During normal operation, the WRERR bit is set when an MCLR or a WDT Time-out Reset stops a write (or erase) operation. In these cases, the user can check the WRERR bit after pressing Reset and rewrite the location. In the EEADR and EEDATA registers, both the data and the address will stay the same. When the write is done, the interrupt flag bit is set. The software needs to be fixed.  EECON2 is not a register that you can touch. When you read EECON2, you will only see ‘0’s. The EEPROM write sequence is the only time the EECON2 register is used.

● Writing to Data EEPROM Memory

To write to an EEPROM data location, the user must first write the address to the EEADR register and the data to the EEDATA register. Then, the user must follow a certain write sequence to start writing for each byte. If you don’t follow the writing sequence exactly, the writer won’t start. During this code section, we strongly suggest that interrupts be turned off.

This mechanism stops errant code execution from writing to the data EEPROM by mistake (i.e., lost programs). The WREN bit should always be “clear,” except when the EEPROM is being updated. The hardware doesn’t clear the WREN bit. Once a write cycle has started, clearing the WREN bit won’t affect it. If the WREN bit is not set, the WR bit won’t be able to be set. When the write cycle is done, the hardware clears the WR bit and sets the EE Write Complete Interrupt Flag bit. This interrupt can be turned on, or this bit can be polled. Software must be used to clear EEIF.

● PORTA and the TRISA Register

PORTA is a bidirectional port with a width of 6 bits. TRISA is the data direction register that goes with this. A TRISA bit set to 1 causes the corresponding PORTA pin to function as an input. The corresponding PORTA pin becomes output when a TRISA bit is cleared to zero ((0)). (i.e., put the contents of the output latch on the selected pin). By reading the PORTA register, you can find out how the pins are set up, and by writing to it, you can change the port latch. All writing operations involve reading, changing, and writing.

Conclusion

In conclusion, the PIC16F876A microcontroller is a powerful 8-bit microcontroller with various capabilities, making it a fantastic choice for many applications. It is a flexible and dependable option for advanced A/D applications in the automotive, industrial, appliance, and consumer markets because of its high-performance CPU, low power consumption, and user-friendly interface.

You can buy the PIC16F876A microcontroller for your next project from ICRFQ, a well-known electronic parts supplier in China. So, contact ICRFQ immediately to find out how the PIC16F876A can help your project. Don’t miss out on the chance to use this powerful microcontroller, and let ICRFQ help you finish your next project well.

4.8/5 - (397 votes)
Kevin Chen