electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Need help regarding AVR PWM


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Need help regarding AVR PWM
Author Message
shoeb.eee



Joined: 28 Mar 2009
Posts: 8


Post27 Oct 2009 18:53   

Need help regarding AVR PWM


I'm new in AVR. But know some basic assembly language programming. I can program a square wave and simulate it. It is possible by using delay and output to the desired PORT. Increasing/decreasing time delay variable frequency will be obtained.

But I'm failed to program with PWM to do the same thing. I searched into the web and found some example of AVR PWM in asm code but the code also contains the delay function. If I use delay function, what is the actual task of PWM.

I need to know what thing the PWM actually do and why does time delay is used? I got the following link which contains an example of PWM.

http://www.gifford.co.uk/~coredump/ledpwm.htm

Please help me
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post29 Oct 2009 3:35   

Re: Need help regarding AVR PWM


The link you posted does not use the hardware pwm. Look at this link:
http://www.avrbeginners.net/architecture/timers/pwm_led.html

it uses a 90S2313, but the code can easily be adapted to attiny2313 or even atmega8.
Back to top
nandhu015



Joined: 11 Feb 2006
Posts: 640
Helped: 46
Location: Tamilnadu, India


Post29 Oct 2009 4:23   

Need help regarding AVR PWM


look at this, a nice tutorial

http://aquaticus.info/pwm

Nandhu
Back to top
shoeb.eee



Joined: 28 Mar 2009
Posts: 8


Post30 Oct 2009 10:12   

Re: Need help regarding AVR PWM


Thanks a lot everybody.

Please suggest me some simulator software (except AVR Studio)
Back to top
Google
AdSense
Google Adsense




Post30 Oct 2009 10:12   

Ads




Back to top
Naveed Ahmed



Joined: 31 Aug 2008
Posts: 22
Location: Pakistan


Post30 Oct 2009 15:54   

Re: Need help regarding AVR PWM


Dear it is not the efficient way for generating a PWM on the port using delay functions.

Use any AVR ATMEGA32 or any ATtiny MCU and using Timers in Fast PWM mode you can easily generate the PWM on that particular pin.

By just changing the value of one register OCR, you can vary the PWM easily.

Thanks.


Regards
Naveed Khowaja
Back to top
shoeb.eee



Joined: 28 Mar 2009
Posts: 8


Post31 Oct 2009 17:58   

Need help regarding AVR PWM


Please suggest me some simulator software
Back to top
nandhu015



Joined: 11 Feb 2006
Posts: 640
Helped: 46
Location: Tamilnadu, India


Post01 Nov 2009 2:36   

Need help regarding AVR PWM


This is from avrfreaks

New VMLAB rel 3.15 available
Posted by amtools on Thursday, October 15, 2009

VMLAB rel 3.15 adds an important feature: a User Programming Interface that allows coding new AVR models and its peripherals, even if not currenty supported with internal models.

This software is fully freeware.

Download it from http://www.amctools.com
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Need help regarding AVR PWM
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Help need regarding PWM(PIC16f877a) (10)
help regarding PWM in verilog (2)
Need help in AVR- want to do C programming for AVR (2)
avr pwm ?? (6)
pwm using avr (2)
PWM and AVR (1)
question regarding PWm (2)
PWM implementation in AVR Microcontroller (2)
PWM Sinewave Generator PIC/AVR (2)
AVR uC with ADC and PWM? (9)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS