Tag archives for MPLAB Code Configurator

MPLAB® Code Configurator

The MPLAB® Code Configurator (MCC) is a user friendly Graphical User Interface (GUI) plug-in tool for MPLAB® X IDE which generates easy to understand C code that is inserted into an MPLAB® X project, based on the settings peripherals configurations and selections made in the Graphical User Interface (GUI). The generated code can be used in any application program. When starting out with a new project using Microchip 8-bit microcontrollers, setup of the configuration and all the peripherals can be time consuming, especially for new projects. The MPLAB® Code Configurator simplifies this down to a series of simple graphical selections from the menus within the MCC.

Interfacing SD Card With PIC Microcontroller – XC8

A memory card (also called a flash memory card) is a solid-state electronic data storage device used for storing digital information. They are commonly used in many electronic devices, including digital cameras, mobile phones, laptop computers, MP3 players and also in many applications where a large amount of data has to be stored either once or continuously like in data loggers. Memory cards are small, re-writable and are able to retain data without power. In this article we will learn how to interface an SD Card to a PIC Microcontroller with SPI bus to write and read from an SD card using the popular Chan's FatFs Generic FAT File System Module library with MPLAB XC8.

DC Motor Speed Control using PWM of PIC Microcontroller – XC8

DC motors are used in many industrial, commercial, and domestic applications. We have DC motors in toys, irrigation pumps, robotics, Drills and in many applications. In real life applications turning a motor ON in clockwise or anticlockwise directions or turning it OFF is not always all that is required. The speed of rotation has to be controlled as well. In this article, we are going to learn how to control the speed of a DC motor using the Pulse Width Modulation of a PIC Microcontroller with MPLAB Code Configurator

Interfacing DC Motor with PIC Microcontroller – XC8

DC motors are used in many industrial, commercial, and domestic applications. We have DC motors in toys, irrigation pumps, robotics, Drills and in many applications. In this article, we are going to learn how to interface a DC motor with a PIC Microcontroller, rotating it in either the clockwise or anticlockwise direction using MPLAB XC8 Compiler.

Interfacing The DS1307 Real Time Clock With PIC Microcontroller – XC8

The DS1307 is a low power serial real time clock/calender with full binary coded decimal (BCD) clock/calendar plus 56 bytes of Non Volatile Static RAM. The RTC provides year, month, date, hour, minute and second information. The end date of months is automatically adjusted for months fewer than 31 days including leap year compensation up to year 2100. It can operate either in 24-hour format or 12-hour format with AM/PM indicator. Data and Address are transferred serially through a bidirectional I2C bus. DS1307 comes with built-in power sensing circuit which senses power failures and automatically switches to back up supply. Timekeeping operation continues while the part operates from the backup supply. The DS1307 RTC uses an external 32.768kHz Crystal Oscillator and it does not requires any external resistors or capacitors to operate.

Pulse Width Modulation (PWM) with PIC Microcontroller – XC8

Pulse width modulation (PWM) is a technique of controlling the amount of power delivered to an electronic load by switching ON and OFF a digital signal. This is the simplest technique that can be used to produce analog voltages from a digital one. The fraction of the period for which the signal is ON to the total period is known as the duty cycle. The average DC value of the signal can be varied by varying the duty cycle. The duty cycle can be anywhere between 0 (signal is always off) to 1 (signal is constantly on). Suppose, if the signal has +5 V while it is ON and 0 V during OFF condition, then by changing the duty cycle of the signal, the amount of energy transferred to device can be varied. This method is commonly used for controlling speeds of DC motors, brightness of lamps, Sine wave inverters, Digital to Analog Converter (DAC) etc.

PIC Microcontroller Communication with SPI Bus – XC8

The SPI or Serial Peripheral Interface is a synchronous serial communication and allows multiple devices to communicate with a micocontroller(s). There are many devices that support the SPI protocol and can easily communicate with a microcontroller via SPI: A/D converters, D/A converters, SD Cards, DS1306 Real Time Clocks, MAX7219 serial display drivers, 25LC256 Serial EEPROM, etc. The devices don't have to be identical as long as they support SPI protocol. In this article we are going to configure the SPI Peripheral with MPLAB Code Configurator and PIC18F Peripheral Library.

PIC Microcontroller Communication with I²C Bus – XC8

The I²C or Inter-Integrated Circuit is a serial communication and allows multiple devices to communicate with a micocontroller(s) over only two wires. The devices don't have to be identical as long as they support I²C protocol. In our illustration, the first device with address 1 is a digital temperature sensor, the second one is a real time clock and the third one is a serial LCD display and the bus could carry on even more devices. Communication takes place from the master (PIC) to the individual selected slave only as shown in this illustration. Configuration with PIC18F Peripheral Libraries and MPLAB Code configurator are discussed in this article

PIC Microcontroller Communication with RS232 Bus – XC8

RS232 serial communication is one of the oldest communication where data is sent or received one bit at a time. This protocol can easily be used to communicate between a PC and various devices supporting this type of protocol like PIC microcontrollers, GPS, GSM modem etc. While other interfaces like Ethernet, FireWire, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232 standard, intended to interface with a modem or with a similar communication device. The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications between a device and a PC or between devices. UART is also a common integrated feature in most microcontrollers today which is useful for communicating serial data (text, numbers, etc.) to your PC. In this article we're going to learn how to use the RS232 communication with MPLAB XC8 Compiler using the PIC18F Peripheral Library and MPLAB Code Configurator.

Analog to Digital Converter in PIC Microcontroller – XC8

Analog to Digital converters allow analog continuous voltages to be converted into a discreet digital numbers inside the PIC as the PIC can only process digital numbers. This can enable a PIC to be connected to analog sensors such as temperature sensors, pressure sensors, humidity sensors, optical sensors, and power sensors. Any sensor which can generate a voltage between 0V and a maximum 5V can be used. If the output voltage is higher than 5V, a method to step it down should be used such as a voltage divider with resistors.