Introduction to the PIC18F46K22
The PIC18F is a family of 8-bit microcontrollers developed by Microchip Technology. This family of microcontrollers uses the Harvard architecture and has an 8-bit wide data memory plus a 16-bit wide program memory. This means that PIC18F microcontrollers deal with data in 8-bit chunks (if the data is larger than 8 bits) and use 16-bit instructions. PIC18F is the most powerful 8-bit microcontroller offered by Microchip, featuring the largest pin count and memory size compared to other Microchip 8-bit MCUs. Microchip's MPLAB X IDE is the official IDE for writing, compiling, and debugging PIC18F applications.
There are many groups of microcontrollers within the PIC18F family. In this lecture series, we will focus specifically on the PIC18F46K22 microcontroller.
// Picture of PIC18F46K22
General Information about PIC18F46K22
The PIC18F46K22 includes 64k Bytes of Flash, 32768 Single-Word Instructions, 3896 Bytes of SRAM, 1024 Bytes of EEPROM, 36 I/O Pins, 30 ADC Channels, 2 Capture/Compare/PWM (CCP) modules, 3 Enhanced CCP (ECCP) modules, 4 Master Synchronous Serial Port (MSSP) modules, 2 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) modules, 2 Comparator modules, 1 Charge Time Measurement Unit (CTMU) module, 1 SR Latch, 3 8-bit Timers, 4 16-bit Timers, and Brown-Out Reset and Low-Voltage Detection features.
Debuggers/Programmers That Support PIC18F46K22
Microchip provides several debuggers/programmers that support the PIC18F46K22. Read the tabs below to learn more about each device. Each device works with Microchip's MPLAB X IDE.
Curiosity High Pin Count (HPC) Development Board
Curiosity High Pin Count (HPC) Development Board
https://www.microchip.com/en-us/development-tool/dm164136
// Picture of HPC Board
The Curiosity HPC Board platform is great for quick prototyping and supports many 28-pin and 40-pin PIC MCUs (must be in Plastic Dual In-Line Package [PDIP]), including the PIC18F46K22. This development board includes an integrated debugger/programmer, so the microcontroller that is mounted on the board can be programmed simply by connecting the board to your computer. The board includes header pins (to connect external circuitry to the PIC), a potentiometer, four LEDs, two pushbuttons, and two MIKROE mikroBUSTM interface footprints, allowing you to connect Click boards to your project. (More info about mikroBUS can be found here https://www.mikroe.com/mikrobus)
MPLAB PICkit In-Circuit Debugger
MPLAB PICkit In-Circuit Debugger
https://www.microchip.com/en-us/development-tool/pg164150
// PICTURE OF PICkit
The PICkit in-circuit debugger/programmer allows for fast debugging of a variety of Microchip devices. The PICkit can supply up to 150 mA to the MCU, allowing low-power projects to be directly powered by the programmer. In addition, the PICkit includes a microSD card slot so you can work on your program on the go. Using Microchip's Programmer-To-Go (PTG) functionality, you can use your phone to select specific memory image files to program to the MCU.
For more information about how to use the Programmer-to-Go, visit Microchip's Online Technical Documentation page:
MPLAB PICkit Basic In-Circuit Debugger
MPLAB PICkit Basic In-Circuit Debugger
https://www.microchip.com/en-us/development-tool/pg164110
// Picture of the Basic Debugger
The PICkit Basic Debugger is a cheap alternative to the PICkit. However, the PICkit Basic only supports wired connections between the computer and the MCU. Unlike the PICkit, the PICkit Basic cannot provide power to the MCU, so an external power supply must be connected to the circuitry.
MPLAB Snap
MPLAB Snap
https://www.microchip.com/en-us/development-tool/pg164100
// Picture of Snap
The Snap is a low-cost in-circuit debugger/programmer that supports a variety of Microchip devices. Just like the PICkit Basic, the Snap is unable to provide power to the microcontroller, requiring an external power supply to be connected to the circuitry.
MPLAB ICD In-Circuit Debugger/Programmer
MPLAB ICD In-Circuit Debugger/Programmer
https://www.microchip.com/en-us/development-tool/dv164055
// Picture of ICD Debugger
The ICD In-circuit debugger/programmer is Microchip's fastest and most advanced programming tool for Microchip MCUs. The ICD can be connected to the computer using USB 2.0 or Ethernet. Its Ethernet can support speeds up to 100 Mbps. The ICD can supply up to 1 A to the circuit, and if the circuitry requires more power, the ICD will notify the user. Furthermore, the ICD can capture voltage and current data, providing critical information on the power usage of the circuitry. Using MPLAB Data Visualizer (a plug-in for the MPLAB X IDE, or can be used as a stand-alone tool), the data can be graphically analyzed.
Next Article
In the following articles, we will talk about the PIC18F46K22 peripherals, starting with pin layout and functions.