Archives for December, 2013
There are three types of memories in a PIC Microcontroller, The Flash Program Memory, The Data Memory (RAM) and The EEPROM Data Memory. The code that is written by the user to perform a specific task by the microcontroller is stored in the Flash. Flash memory makes it possible to program a microcontroller many times because it is re-writable, this memory can be written into and erased many times. RAM Data Memory is used for storing data temporarily during program execution and it is volatile. The third memory is EEPROM memory which is an abbreviation for Electrically Erasable Programmable Read Only Memory. EEPROM memory can be read and write electrically, can be accessed through program. It is a non volatile memory but has slower response time. EEPROM memory can be used to store data which should not be loss during power loss or CPU reset. such data could be like device parameters or settings which could be entered once and stored in the EEPROM. In this article, we will learn how to read or write data to the microcontroller built-in EEPROM.
The ability to generate sound is very important in embedded applications. A small buzzer could be used to generate specific sounds or beeps for audible alarms or status. In an electronic piano or electronic toys for example, different tones and melodies could be generated electronically. There are countless of electronic applications that can require sound or just a small beep. Most microncontrollers have a CCP module which stands for Capture/Compare/PWM, this peripheral is used to time and control different events and generate PWM signals. This article explains the concept behind generating sound from the PIC microcontroller using MikroC Pro for PIC Sound Library which simplifies everything.
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.