
What is a Microcontroller ?

A Microcontroller is, of course, used to control some process or aspect of the environment. A good example of a typical microcontroller application is the monitoring of a house. As the temperature rises ,the controller causes the windows to open. If the temperature goes above a certain threshold, the air conditioner is activated . If any unsafe condition is detected ,the doors and windows are locked. In addition if the unsafe condition persists ,the system is able to dial a preset telephone number and sound a warn message. This is just a simple example but the microcontroller is able to perform more complex tasks.
At one time , controller were built exclusively from logic components,as a result ,they were usually huge and heavy. Later on ,microprocessors arrived and here the entire controller could fit on a small circuit board. This is still common.
As the process of miniaturization continued ,all the components required for a controller were built right onto a single chip. The microcontroller or one chip computer was born. A microcontroller is a highly integrated chip which includes on one chip, all or most of the parts needed for a controller. It tipically includes :
CPU
RAM
EPROM,PROM,ROM
I/O
TIMERS
INTERRUPT CONTROLLER
Microcontrollers are a "one chip solution"
THE PIC micro
This device was first developed around 1980 , designed by General Instrumenst, it was a "Peripheral Interface Device" and today is commonly known as the "PIC".
My Microcontroller based project
This application is designed to control AC power using a Triac driven by a PIC microcontroller, with the advantage that a phase shift network is not required and may be powered directly from AC. It must NOT be for DC because I am using Triac and not SCR.
This is the beginning of a project to control DC power using a hybrid bridge, two rectifiers and two tyristores or Hybrid Module.
On this circuit, two buttons are used in order to increase or decrease power. they are connected to GP1(pin6) and GP3(pin4). I am using a table to convert TMR0 value into firing angle. The half period is split to get 64 possible firing pulses or 128 each 180 electrical degrees ,one pulse for the positive half and one for the negative.
At the beginning of each half period, zero crossing is detected by the microcontroller using GP0(pin7) then TMR0 is reset. The prescaler is assigned to TMR0 and set to 1:64. Since the Frecuency of the internal Oscilator is 4MHz ,the maximun value TMR0 will reach is :
8.33ms/64x1us = 130
The maximun value from the table must be smaller than 130 in order to give the PIC time enough for reading the push buttons and compare TMR0 value and the value returned from the table.
When one of the buttons is pressed a one second timing loop is performed to read a new value from the table and thereafter a new value is read every 0.1 second until the maximun value from the table is reached.
Take a look at the following diagrams