Category Archives: Embedded Labs

Lab 17: Sleep and Wake PIC microcontrollers

PIC microcontrollers’ Sleep feature is an extremely useful mechanism to minimize power consumption in battery-powered applications. In Sleep mode, the normal operation of a PIC microcontroller is suspended and the clock oscillator is switched off. The power consumption is lowest in this state. The device can be woken up by an external reset, a watch-dog timer reset, an interrupt on INT0 pin, or port-on-change interrupt. In this experiment, we will discuss how to put a PIC microcontroller into Sleep mode and compare the current consumption during Sleep mode and the normal operation mode.

Read more

In-Circuit Debugging of PIC microcontrollers

An In-Circuit Debugger (ICD) is a very powerful and effective tool for real-time debugging of a microcontroller-based system at hardware level. It allows you to run, halt and single step the program while the target microcontroller is embedded in the actual circuit. Once halted, the program variables, Special Function Registers (SFRs), RAM and EEPROM locations can be examined and modified in real-time, thus assists the designer in debugging the firmware and hardware together. In this article, I am going to describe the In-Circuit Debugging technique in PIC microcontrollers, and demonstrate the debugging procedure with a test project using the PIC16F887 microcontroller. Although the operation of

Read more

Lab 16: Understanding Interrupts

Interrupts are powerful concept in embedded systems for controlling events in a time-critical environment. In a typical embedded system, the embedded processor (microcontroller) is responsible for doing more than one task (but can do only one at a time). For example, let’s say in a programmable digital room thermostat, the microcontroller is assigned to monitor the room temperature, turn the AC or heater ON and OFF, control the LCD display, and respond to any new temperature setting from the user. Out of these the first three tasks are non-time-critical and are executed continuously in sequence one after the other, within

Read more

Using TC74 (Microchip) thermal sensor for temperature measurement

The TC74 chip is a serially accessible, digital temperature sensor from Microchip Technology that acquires and converts temperature information from its onboard solid-state sensor with a resolution of 1°C. The temperature is available as an 8-bit digital word stored in its internal temperature register, which is accessible through a 2-wire I2C compatible serial bus. This tutorial describes how to use the TC74 sensor with a PIC microcontroller to measure the surrounding temperature.

Read more

How to interface MAXIM’s DS1868 digital potentiometer with a PIC microcontroller

Potentiometers find applications in many electrical devices. For example, a light dimmer uses a potentiometer to control the brightness of lamps. In amplifiers, they are used to control the output volume of the music, or change the bass level. In an adjustable power supply we see potentiometers to vary the output voltage and current. In a frequency generator, they are used to control the duty cycle and frequency of the output signal. These potentiometers are electro-mechanical transducers that convert the rotary or linear displacement into a change in resistance. This change in resistance can be used to control anything from

Read more
« Older Entries Recent Entries »