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.

How to generate PWM to turn on 1 led from 0V to 5V wAT89s51?

Status
Not open for further replies.

thomgun_lc

Member level 5
Joined
Jun 29, 2004
Messages
80
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
911
at89s51 pwm

Hi,I have try to build a little project to do some PWM mode. But my problem is i want to build PWM so i can turn on the led from dark to bright so it has a gradation, not blinking. I use two timer but i only can program with one mode only like 2,5v,1v, 4,5v,not gradation mode.So,does any body know how to make a gradation voltage using PWM with AT89s51?Can i know an assemly program also? 8O
 

build pwm

I ussually programming this AT89s51 using IDE Raissonance so i write this program with assembly code does anyone know how to generate gradation voltage using PWM mode in AT89s51?
 

c51 pwm

Using two timers you can generate PWM in standard 8051 uC. But the problem with this is that the frequency of output signal won't be very high which results in poor fading of LED. I've tried this thing and results were very poor. Also a lot of CPU time is wasted in generating this signal.

Insted try using 89C51RB2 or RC2 or RD2. They have in-built PWM module.

Still if you wan't to do it in 89S51, check this https://www.specs.de/users/danni/appl/soft/c51/pwm/index.htm
 

pwm for led turn on

to build PWM i use two timer.Timer 0 for hafwave 1 and timer 1 for next halfwave so if i want to make high output,i can set the Th0 and TL0 at -1000 and TL1 and TH1 i set for 1. It start at port0.0 at ffh.When timer 0 is on,it will high based on the value of Th0 and tl0,then i use CPL so the port 0 is in low and i set the timer 1 on, after timer1 overflow then i use CPL again. But it only generate 1 Voltage only (ex 5 only).How is the program to make fading led?In assembly language?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top