Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 29, 2024, 06:49:14 06:49


Login with username, password and session length


Pages: [1]
Print
Author Topic: Atmel mega16 PWM Problem  (Read 3289 times)
0 Members and 2 Guests are viewing this topic.
wellnerson1
Active Member
***
Offline Offline

Posts: 122

Thank You
-Given: 33
-Receive: 152


« on: April 06, 2008, 09:23:43 09:23 »

I have generated a PWM based on my requirement through Timer1,OC1A. The generated PWM is satisfying all my requirements but the Voltage output level is only around 600mV Vpp instead of 5Vpp.
How should the level can be lifted to 5Vpp? Please suggest some idea whether any change in configuration is required? Huh (Vcc is 5V for Atmel mega16)
Logged
jestanoff
Junior Member
**
Offline Offline

Posts: 46

Thank You
-Given: 25
-Receive: 18



WWW
« Reply #1 on: April 06, 2008, 06:57:01 18:57 »

If you use this code on port D5 must have square wave.
DDRD=0x20; //Set port D5 output
TCCR1A=0xC3; //Set OC1A on Compare Match, clear OC1A at TOP
TCCR1B=0x09; //Fast PWM, 10-bit, clk I/O /1 (No prescaling)
OCR1AH=0x02;
OCR1AL=0x00;
If the amplitude do not reach supply voltage, disconnect portd5 from any load and test with oscilloscope.
« Last Edit: April 06, 2008, 07:00:05 19:00 by jestanoff » Logged
wellnerson1
Active Member
***
Offline Offline

Posts: 122

Thank You
-Given: 33
-Receive: 152


« Reply #2 on: April 07, 2008, 03:28:58 15:28 »

This is my code snippet for PWM Setting
DDRD=0x20;
TCCR1A=0x83;
TCCR1B=0x0A;
OCR1AH=0x01;
OCR1AL=0xF4;
As per jestanoff's advice the load has been removed from Port Pin the Voltage is Perfectly the Supply Voltage. Also then i have connected an 10mm LED that's also went fine. Now i'm checking my PCB for any fault. Thanks to jestanoff for sharing some idea's and spending your valuable time in responding to me through SONSIVRI. Wink
Logged
cjq_sh
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 1
-Receive: 1


« Reply #3 on: April 18, 2008, 12:55:20 12:55 »

Software is no problem. Check the hardware.
Logged
CodeHunter
Guest
« Reply #4 on: April 20, 2008, 01:23:44 13:23 »

If the voltage level is lower than 1V then you may need to use a pull-up resistor. Somehow, the Atmega cannot pull the voltage to high level.
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