Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Sunday, September 20, 2009

16F917 CCP Block PWM

PIC 16F917 PWM Generation:

PWM can easily be generated on the PIC 16F917 using the CCP block . If you are new to this concept then let me introduce it to you.

New Microcontrollers contain dedicated hardware blocks for generating signals and for doing special functions. An example of these blocks is the CCP block in many Microchip Microcontrollers.

In this post, I 'll introduce you with the CCP block of the PIC 16F917 Microcontroller.

It is called Capture , Compare and PWM block. Here, we explain the PWM function.

As the name implies, it generates PWM signals in hardware instead of the software PWM signal we generated using the PIC 16F84 in an old post of this blog.

The advantage of this concept is that you save code space and processing time for another functions and tasks.

So how can you configure this block ?

You 'll find an extensive explanation for this topic on the PIC 16F917 datasheet.

And I used this link to calculate the values for the block configuration registers.

http://www.micro-examples.com/public/microex-navig/doc/097-pwm-calculator



You can find the design files and source code for the project here .

Now you can use this project to control any circuit with PWM signals generated with PIC 16F917 CCP PWM block as you did before by using PIC 16F84.

You can control DC motor speed , LED intensity and make Mood Light.

If you have any questions or feedback, contact me.





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, July 29, 2009

PIC 16F84 Sound Generation

Do you know that you can generate tones of sound with the PIC16F84?

Yes you can generate these tones similar to the Midi tones of the old mobile phones. This is a very simple and funny circuit and you can try it on the simulation software Proteus ISIS 7 before building it.

Actually the circuit is so small nearly contains no components other than the microcontroller, the crystal oscillator and some resistors.



The software generates the tones according to the predefined words which represent tones.

The circuit lets you choose one of two tones with two push buttons.

You can find the Proteus ISIS Design files DSN, Code ( Assembly ) and HEX file as a sample project in Proteus ISIS 7. From the menu bar , press open file . You 'll find the project under the Proteus --> Samples --> VSM for PIC16 --> PIC Doorbell.

So , open the design now and if you like , start building the circuit and make you own tones.

Have a nice time.




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.

Monday, July 13, 2009

New Microcontroller Chip : PIC16f917

Microchip PIC 16F917

I used the Microchip PIC 16F917 in simple programs and tried the good features of it. I ordered some samples from Microchip.com and they sent them to me. I searched online for a simple programmer that I use it to program the chip the same way I do with the PIC 16F84. I found it here . And I uploaded it here in case you couldn't find it .

The programming circuit is very simple and uses the serial port.

Here is the schematic diagram :



After you build this simple circuit, you can use the program to load the HEX file.

This is a snapshot of the software :





The Microchip PIC 16F917 microcontroller is a very nice and modern chip. You can find its datasheet here :



You can see the circuit I built lately here :



You 'll see more projects using this chip. And I 'll be posting projects for the PIC 16F84.

By the way, The PIC 16F917 is backward compatible with the PIC 16F84. That means if you write a code for PIC 16F84 in assembly or C or even compiled it to HEX file , you can still use it with the PIC 16F917 without a change in code or a recompilation.


Happy programming. Have a nice time.




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, June 17, 2009

LED Chaser : Larson Scanner 16F84A . Knight Rider KiTT Car

I love LEDs !!!


In this lesson we’ll not learn any new technique from the technical point of view. But this is a cool project. I love LEDs. That‘s true. I cannot deny that. In this project I designed a nice and a simple thing. It is called a chaser. It consists of a row of LEDs. Only one LED is ON during a certain time and all the others are OFF. Then the next one is ON. And so on until reaching the last LED in the row. Then the LED before the last on is ON until reaching the start of the row. The light continues going back and forth. For those who saw the series ‘Night Rider ‘, it reminds you of the front logo of the car Kitt. It is based n the PIC16F84A





As usual, I give you the code and the design files of this project to see the simulation running on the Proteus ISIS 7 here. And for those who like it, the project can easily be built within minutes.






Here is the actual circuit









If you need any information, you can comment or send me an Email.

Thank you for dropping by.




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.

Thursday, April 2, 2009

DC MOTOR PWM CONTROL :


In this post, we 'll learn the DC motor control using PWM signal. We learned how to generate PWM signal using PIC 16F84 Microcontroller.

Hardware :

The PWM signal drives a 2N2222 transistor which acts as an electronic switch. The transistor switches the motor driving current on and off at high rate.

In the following figure, there are two circuits. The control circuit ( the microcontroller ) and the driving circuit ( the motor and the transistor ).

The DC motor draws relatively high current than the current in the microcontroller circuit. The transistor isolates the two circuits.


By changing the duty-cycle of the PWM signal, we get different average DC voltage
for each duty-cycle value . The result is the change of the motor speed corresponding to that duty-cycle.





Software:

We use the PWM routine with two defined duty cycle values. The duty cycle value duty1 is the larger value which drives the motor faster than duty2 value. When the Boost button is pressed, the first duty cycle value is selected. When the button is released, the second value is selected.



The software routine is very simple. As usual, you can download the Proteus 7 model from here.

If you need any help or have any feedback, just let me know.





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.
This means that you can enjoy something for free and still support our blog to keep posting useful stuff.


Amazon.com - Read eBooks using the FREE Kindle Reading App on Most Devices


This is the well-know Amazon Kindle platform. If you sign up for the free reader from Amazon to read any book, we get commission. 
There are many useful book for free on Amazon Kindle. Even you can find best sellers offered for free on Kindle format.
The best part is you can have the application on any platform. You can even read any book without installing any application by using Amazon Cloud-Reader on your browser.


Join Amazon Kindle Unlimited 30-Day Free Trial

You can join Amazon Kindle for 30 days free to have access to many paid book for free. You can cancel you subscription anytime.


Try Amazon Prime 30-Day Free Trial


The Amazon Prime is a special paid service from Amazon that offers good promotions and one-day free shipment for Amazon Shoppers. You can try this service for 30 days. You can cancel you subscription anytime.

Shop Amazon - Give the Gift of Amazon Prime


Try Audible and Get Two Free Audiobooks


Audible is the audio books website from Amazon. Many Kindle books are sold on Audible. You can try this service for free and get 2 free book. You can cancel you subscription anytime.


Shop Amazon - Create an Amazon Baby Registry

If you have a new baby borne or expecting one, you can create your free baby registry to easily save products and get offers and promotions on baby requirements.

  4. Visit our new website outatime.tech.

Thank you for visiting our blog.

Friday, March 27, 2009

I wish I met you in person to introduce you to Islam

I wish I meet you in person to thank you for visiting my blog and for knowing your opinion.
And to get more ideas from all around the world about Microchip PIC.

I also want to meet you to tell you about my religion , Islam. Yes, I am Muslim. And I am proud of being a Muslim. And since I had the chance to communicate with open minded , highly educated people from all the world , I can give you an Introduction to Islam. This religion that I want to tell the whole world the truth about it and how it makes the world a better place for the humanity. So , I invite you to check this Introduction to Islam.

If you need to know more about Islam from trusted sources, you can order free book from here.

Saturday, March 7, 2009

PWM Mood Light using PIC 16F84

Generating PWM signal using PIC 16F84

PWM ( Pulse Width Modulation ) is a square signal involves changes in the duration of the on time ( duty cycle ) . It can be easily generated by the PIC 16F84 . This PWM signal can be used in many applications ( for example : DC motor speed , LED brightness intensity , Mood Light Lamps ) .

PWM can be used when no DAC ( Digital-to-Analog Converter ) is available in the microcontroller chip or as a stand alone chip. The average DC voltage values are equivalent to analoge values as where you used DAC for motor speed control .

And for light brightness intensity , at high frequency , the blinking process is not observed by human eyes and what you see is only brightness intensity corresponding to the duty cycle ( time at which light is ON)

At longer duty cycle , LED is ON for longer time , so you see it brighter.












At shorter duty cycle , LED is ON for shorter time , so you see it less brighter.




The previous examples used constant duty cycles at each time which means constant brightness LED and constant speed for motor.

To make Mood Light LED, you need to change the duty cycle of the PWM signal by increasing and decreasing it back and forth.

You get this one .


Note :

You see this image still, just click it and save it to your PC you 'll see it animating ( PWM is variable ) .



I connected this circuit to the LED and it did just as I expected , it looked brighter then dimmed and then brighter again.


You can have the circuit and the code files from here.


If you need any help configuring the compilation settings for Hi-Tech and ISIS 7 , you can check the previous posts. If you need further help about code and hardware you are welcome to contact me.





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