Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help for peogramming(atmega 8)

Status
Not open for further replies.
Hi,
Have you started coding on this?
You have to use Sinusoidal Pulse Width Modulation (SPWM). Since ATMEGA8 doesn't have an ECCP module like some of the PICs or the similar modules in AVR AT90PWM, coding will be slightly tricky, but it will be achievable. You need to use the time base and change the duty cycle according to the value retrieved from a sine table stored in the ROM. Only send this signal to the lower MOSFETs in the bridge and keep the corresponding high-side MOSFET on for 10ms when required. I think a carrier frequency of 1MHz is way too high. Use something in the range of 16-100kHz.

Hope this helps.
Tahmid.
 

Hi,
I don't have any books, but you could search around for some tutorials.
Btw, are you wanting to use this for a complete DC-AC inverter?
 
So, why sine wave? I know it's better, but isn't commercially quasi-sine [modified square] wave more successful, especially in the lower wattage inverters?
 

no Tahmid, I'm designing something exceptional. sine wave but not in the usual way. Hope you will help me in some case, as I'm weak in microcontrollers but expert in analog. I need both in this circuit designing. so I need your help in microcontroller programming.
 

Hello,
You can do it in two ways:
1) Have a counter running from 0 to TOP, where TOP is the number that is going to dictate frequency, along with the rate of counting up. Assign this value to one or more PORT(s) and then use R-2R ladder to generate an analogue output from the digital value from the port.
2) Use PWM to have a fixed frequency using output compare modules - one for frequency, one for duty cycle, and start with a duty cycle of 0. On every duty cycle compare match, increment the value of the duty cycle counter, or the duty cycle compare register. Have an RC or LC filter at the output and you have a sawtooth.

You'll need some sort of low pass filter on the PWM signal to create an analog level out of a PWM signal. Use a simple RC filter and set the time constant of the RC to about 10 times the PWM period. That generates the mean value of full on full off weighted by their respective durations. LC can be used, but RC is simple enough.

Hope this helps.
Tahmid.

---------- Post added at 15:04 ---------- Previous post was at 13:58 ----------

You can easily use Timer/Counter 1 (TC1) and OCR1A for TOP, OCR1B for duty cycle and operation of Compare Modules in "Normal/CTC Mode".

Hope this helps.
Tahmid.
 

Tahmid,
I'm having trouble with avr studio 4.12. It didn't show any errors first, working well. but recently whenever I open it, showing 'MFC closing....' then it stops. I tried with some other virsions but same problem..
what can I do?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top