Introduction to PIC16F690
- PIC16F690 is an 8-bit PIC microcontroller, developed by Microchip, that comes with 20-pin interface.
- High-performance RISC CPU is incorporated on the board that helps in executing the instructions with a decent pace.
- Crystal oscillator up to 20 MHz can be interfaced with the board that creates the clock pulses.
- Operating voltage is identical to other controllers in the PIC community and ranges from 2 to 5.5 V. Program memory and RAM memory is 7K and 256 bytes respectively. EEPROM also comes with memory space around 256 bytes.
- Other features that make this device compatible with a wide number of external components include I2C, SPI, and USART communications.
- ADC module is very useful to convert analog values to digital ones and play a vital role for sensor interfacing.
- PIC16F690 comes with two different packages called PDIP and QFP where both contain 20-pins onboard.
PIC16F690 Pinout and DescriptionYou have got a brief overview of this controller. In this section, we uncover the pinout and pin details, so you get a clear idea about the function of each pin.
PinoutFollowing figure shows the pinout of PIC16F690.
- Both PIC packages are very helpful for project development where PDIP is mainly used for individual projects and QFN is incorporated in the industrial electronic devices.
Pin DescriptionFollowing figure shows the complete pin description of each pin that will highlight the main functions each pin capable of doing.
|Pin#||Pin Name||Pin Description|
|19||RA0 AN0/ULPWU C1IN+ IOC ICSPDAT||Digital I/O Pin Analog Channel 0 Comparator Interrupt Basic|
|RA1 AN1/VREF+ C12IN0- IOC ICSPCLK||Digital I/O Pin Analog Channel 1 Comparator Interrupt Basic|
|RA2 AN2 C1OUT T0CKI IOC||Digital I/O Pin Analog Channel 2 Comparator Timer Interrupt|
|4||RA3 IOC MCLR VPP||Digital I/O Pin Interrupt Master Clear Reset Programming Voltage Input|
|3||RA4 AN3 T1G IOC OSC2/CLKOUT||Digital I/O Pin Analog Channel 3 Timer Interrupt Oscillator Output|
|2||RA5 T1CKI IOC OSC1/CLKIN||Digital I/O Pin Timer Interrupt Oscillator Input|
|13||RB4 AN10 SDI/SDA IOC||Digital I/O Pin Analog Channel 10 SSP Interrupt|
|12||RB5 AN11 RX/DT IOC||Digital I/O Pin Analog Channel 11 Serial Receive Pin Interrupt|
|11||RB6 SCL/SCK IOC||Digital I/O Pin SSP Interrupt|
|10||RB7 TX/CK IOC||Digital I/O Pin Serial Transmit Pin Interrupt|
|16||RC0 AN4 C2IN+||Digital I/O Pin Analog Channel 4 Comparator|
|15||RC1 AN5 C12IN1-||Digital I/O Pin Analog Channel 5 Comparator|
|14||RC2 AN6 C12IN2- P1D||Digital I/O Pin Analog Channel 6 Comparator ECCP|
|7||RC3 AN7 C12IN3- P1C||Digital I/O Pin Analog Channel 7 Comparator ECCP|
|6||RC4 C2OUT P1B||Digital I/O Pin Comparator ECCP|
|5||RC5 CCP1 P1A||Digital I/O Pin ECCP|
|8||RC6 AN8||Digital I/O Pin Analog Channel 8|
|9||RC7 AN9||Digital I/O Pin Analog Channel 9|
|1||VDD||Voltage Supply Pin|
2. PIC16F690 FeaturesIn this section, we discuss the main features of PIC16F690 so you get a hold of this chip before you make a final decision to install it in the relevant project. Following table shows the complete features of PIC16F690.
|No. of Pins||20|
|Operating Voltage||2 to 5.5 V|
|No. of I/O Pins||18|
|10-Bit ADC||12 Channels|
|Oscillator||up to 20 MHz|
|Timer (3)||8-Bit Timer (2) 16-Bit Timer (1)|
|Brown Out Reset||Yes|
|Master Clear Reset||Yes|
|Power up Timer||Yes|
|Selectable Oscillator Option||Yes|
|Maximum Current Drawn Each Pin||25mA|
|Data Retention Capability||40 Years|
|Power Saving Sleep Mode||Yes|
3. PIC16F690 FunctionsThis PIC comes with an ability to perform a number of valuable functions like other controllers in the PIC community. Following are the main functions of PIC16F690.
TimerTimers are very useful for creating a delay in the running function. PIC16F690 comes with three timers where two are 8-bit and one is 16-bit timer that can be configured both ways i.e. timer and counter. The former is used to create delay and increments the instruction cycle while later is used to count the number of intervals in specific running function and increments the rising and falling edge of the pin.
USART ModulePIC16F690 contains USART module that consists of two pins called TX and RX where former is a transmission pin used for transmitting serial data to other devices and later is a receive pin used for receiving serial data.
In-Circuit Serial ProgrammingIn-Circuit Serial Programming is another valuable feature incorporated into the device that gives the flexibility to program the controller after its installation in the relevant project.
Watchdog TimerPIC16F690 comes with built-in timer called watchdog timer that can be configured with programming. It is mainly used to reset the controller when the running program gets stuck in an infinite loop. This timer prevents the device from any malfunctioning and provides a preventive measure by resetting the device before it goes to any invalid software glitch. More often than not, watchdog timer acts like a countdown timer that starts from 1000 and gradually goes down to zero.
Sleep ModePower saving sleep mode is another valuable function added in the chip that generates a low current power down mode. The sleep mode can be abandoned using an interrupt, watchdog timer or external reset.
4. PIC Compilers
- MPLAB C18 Compiler is a standard compiler, introduced by Microchip, that is mainly used for PIC controllers. You can download this compiler online from the Microchip Official Site.
- Third-party software can also be used for compiling the program and MikroC Pro For PIC is available for this purpose.
- You must check this list of Top 3 PIC C Compilers where you can pick any compiler based on your technical requirements.
- The code we write in the compiler generates a hex file that is transferred to the PIC Microcontroller.
- You need a burner to transfer the compiled program to the controller. PICKit3 is widely used for this purpose. There are other unofficial burners used for burning the code, however, PICKit3 is mostly preferred and used for PIC controllers.
5. PIC16F690 Memory OrganizationMemory plays a vital role to store the number of instruction on the controller. It is mainly divided into three types called Program Memory EEPROM Memory RAM Memory Program memory comes with 13-bit program counter that can address 8k x 14 memory space where reset vector stays at 0000h and interrupt vector stays at 0004h. It has a total memory space around 7k and is known as ROM or non-volatile memory that stores the program permanently and doesn't depend on the voltage source.
- EEPROM also stores information permanently but comes with one exception i.e. i.e. the instructions in EEPROM can be controlled and modified during the controller operation.
- Registers play a vital role in the controller that are the data holding places and can hold storage address, instruction and any kind of data containing bit sequence or individual characters.
6. PIC16F690 Block DiagramBlock diagram is very helpful to have a deeper look at how different pins and components operate and attach to each other. The following figure shows the block diagram of PIC16F690. This PIC module comes with three ports A, B and C and each one contains 6, 4 and 8 pins respectively.
7. PIC16F690 Projects and Applications
- Students project for interfacing sensor and motor controlling
- Central heating projects
- For serial communication
- Production of temperature data logger
- Main part of the embedded system
- Used in industrial automation
- Used in security systems
- Gas sensor projects
- Starter Kits