Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Friday, February 27, 2009

Lookup table Sine Wave Generation

Sine Wave Generation using PIC 16f84A :

In this lesson, we 'll learn to use the PIC 16F84A to generate a sine wave signal using lookup table method .

These are pre-calculated values of a certain signal ( here will be a sine wave ) , then the signal is transmitted at execution time . You can consider this an inverse process of the digitization . At execution time, the signal is sent to the output port of the Microcontroller at the rate you determine. You then get the original signal.

Attached a text file that explains how I calculated the values.

The hardware circuit is very simple. It is called Resistor Ladder Network.





When you configure and run your program , you should get an output signal like this





You can get the circuit for Proteus ISIS 7 and the code from here.

If you need any help for configuring the simulator , check my older posts.

You can also contact me directly if you need any further help.




If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Wednesday, February 4, 2009

Introduction to Interrupt : PIC16F84A



-->
What is the Interrupt?

What‘s the difference between polling and Interrupt?
Let ‘s take an example when you need to know if you have a phone call , you can know this using one of two ways :

1- Go to the telephone and pickup the handset to see if you have a phone call. You‘ll need to do this many times. And you will stop what you do every time.
2- Wait until the phone rings , then you go to it and pick up the hand-set.

Polling is like the first example and Interrupt is like the second example. You need to use interrupt in some applications. It sure decreases the load on the microcontroller and saves its time while doing another thing.
There are two types of interrupt: software and hardware interrupts.

In the following application, we will use Timer interrupt ( one of the Software interrupts ) which is initiated by the Timer0 overflow.

The timer is a free counting register that increments depending on the crystal oscillator speed and the prescaler settings. We can use the timer to calculate accurate time periods. And because we are using interrupt , we don 't have to keep track of time while we are doing another thing. In the following example , the main program functions to monitor a push button and displays a number on a 7 segment display. The number on the display indicates the period in seconds.

Without using interrupt, we would have to calculate the time of the period and taking the display time into account.





Today, I revisited this page which contains many Microcontroller projects. This is the Cornell University Electrical Engineering students projects page. Many ideas can be found here.



If you like this blog you can support us by many ways:
   
   1. Leave comments stating your point of view about this article.

   2. Buy our book on Amazon Learn By Making.

   3. Click on links of our sponsors without adding any extra cost on you if you make purchase from them. Actually, many of these offers are totally free.
  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Tank