Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 11, 2016, 07:01:57 07:01


Login with username, password and session length


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

Posts: 101

Thank You
-Given: 23
-Receive: 94



« on: April 06, 2008, 10:23:43 10: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: 23
-Receive: 18



WWW
« Reply #1 on: April 06, 2008, 07:57:01 19: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, 08:00:05 20:00 by jestanoff » Logged
wellnerson1
Active Member
***
Offline Offline

Posts: 101

Thank You
-Given: 23
-Receive: 94



« Reply #2 on: April 07, 2008, 04:28:58 16: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, 01:55:20 13:55 »

Software is no problem. Check the hardware.
Logged
CodeHunter
Guest
« Reply #4 on: April 20, 2008, 02:23:44 14: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