how to control output voltage amplitude of 89c51 to fed led light
LEDs are currnt devices, you want to control current, NOT voltage
Nothing, of course, to do with Keil: electronicsclub.info/leds.htm
A possible way is LED Dimming by Pulse Width Modulation (PWM).
Can anyone plz provide me .asm or .c program code generating pwm of diff dutycycle such as 60%,70%,80%.
I got the award for this function. I let you use it.
void WMP_OUTPUT( int PCT , int CYCULS) { int COUNT; LOOP1: if ( CYCULS == 0 ) goto END; CYCULS = CYCULS - 1; COUNT = 0; P1.1 = 1; LOOP2: if ( CNT == PCT ) goto BRANCH1; CNT = CNT + 1; goto LOOP2; BRANCH1: P1.1 = 0; LOOP3: if ( CNT == 100 ) goto BRANCH2; CNT = CNT + 1; goto LOOP3; BRANCH2: goto LOOP1; }
Was that the Pretend You're Programming In Assembler Award?
Or the Most Unnecessary Uses Of 'goto' Award?
Or what?!
I got it 32 years ago. I was 7.
PCA cookbook application-notes.digchip.com/.../27-46415.pdf