Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 23, 2024, 04:34:37 04:34


Login with username, password and session length


Pages: [1]
Print
Author Topic: How to generate 50hz frequency from PIC16F84A or 877A  (Read 6028 times)
0 Members and 1 Guest are viewing this topic.
silvabelbr
Guest
« on: December 05, 2007, 01:32:32 01:32 »

I am working on a project to construct an inverter using PIC16F84A or 877A. the micro is to control the whole operation of the inverter and also to generate the frequency and also using pulse width modulation regulation. pls any idea, circuit diagram and source code will be appreciated. thanks in anticipation.
Logged
free
Active Member
***
Offline Offline

Posts: 115

Thank You
-Given: 71
-Receive: 13


« Reply #1 on: December 05, 2007, 01:50:22 01:50 »

If your project is possible without PIC, you can use SG3525, it's good for inverter without PIC code.
Logged

Some dream to escape reality, some to change it forever.
- Soichiro Honda -
frasenci
Translator
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 142
-Receive: 84


« Reply #2 on: December 05, 2007, 11:05:55 11:05 »

I guess you could use an simple 555 timer IC for generating the 50 Hz trigger.
Used 555 for similar applications in the past and worked well.
You only have to tune it . There exists some software to calculate the components needed
Hope this helps
Greetings
Logged
ero
Junior Member
**
Offline Offline

Posts: 43

Thank You
-Given: 12
-Receive: 27


« Reply #3 on: December 06, 2007, 12:00:53 12:00 »

The best way to produce 50 HZ signal is to use the timer0 interrupt on each 10 ms. Prepare the system to have the timer0 interrupt on every 10 ms and put one simple command to int section as follows;
PortX.y=1-PortX.y
or TOOGLE PortX.y
By the way you can do another things on the other side of the program without interrupting the 50 Hz signal.

Ero

Logged
sam_des
Senior Member
****
Offline Offline

Posts: 254

Thank You
-Given: 126
-Receive: 148


« Reply #4 on: December 06, 2007, 06:13:21 18:13 »

Hello silvabelbr,

It's very simple to generate the 50-Hz PWM using F877/A.
I suppose that you are building Push-Pull Square wave inverter.
If so, use TIMER2 of f877 to generate interrupts every fixed interval say 500uSec. I'll give pseudo-code --

pwm_init()
{
  side = 1;
  pwm_tick = 0;
  pwm_side1 = on;
  pwm_side2 = off;
}

timer2_interrupt()
{
   // we'll be here every 500us
  if( side == 1 )
  {                                               // doing side-1
     if( ++pwm_tick == 19 )              // 9.5ms/500us = 19
     {
       pwm_side1 = off;
     }
     if( ++pwm_tick == 20 )                // 500us dead-time
     {
        side = 2;                                // next time do side-2
        pwm_tick = 0;                        // start again
        pwm_side2 = on;                    // now side-2
     }
   }
   else                                           // doing side-2
   {
     if( ++pwm_tick == 19 )              // 9.5ms/500us = 19
     {
       pwm_side2 = off;
     }
     if( ++pwm_tick == 20 )                // 500us dead-time
     {
        side = 1;                                // next time do side-1
        pwm_tick = 0;                        // start again
        pwm_side1 = on;                    // now side-1
     }
   }

    // timer2 will automatically reload
}

With small changes you can add duty-cycle control. Using a smaller pwm_tick like 100us instead of 500us will improve duty-cycle resolution.

Adding inverter output voltage, current & battery voltage feedback will complete your basic inverter scheme. You can add many other features as well.

But, if you are trying to build sine-wave inverter then, pwm generation is not so obvious & cetainly not so easy with PIC-14, though it is possible. (I've done it  Grin)

If you have any doubts, I'll be glad to help.

BTW, sorry for C-syntax, that's what I am used to  Wink

reagrds,
sam_des
« Last Edit: December 06, 2007, 06:22:07 18:22 by sam_des » Logged

Never be afraid to do something new. Remember Amateurs built the Ark, Professionals built the Titanic !
silvabelbr
Guest
« Reply #5 on: December 10, 2007, 12:04:08 00:04 »

Thank you sam_des!!!! Grin

Very gooooooooood.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC