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.
using ADC n PWM to light up the LED dimmer.. i using c8051f226dk.. give mi solution... erm i using microcontroller 8051 IC chip.. i gt the attachment help mi. and i attach to PDF file take a look
if possible give mi the code i will study myself or i ask some question..cos i have no idea... if possible if cannot den jus teach mi will do..
a)my procedures is develop firmware for ADC to acquire potentiometer setting
b)develop firmware for PWM generation
c)integrate ADC acquistion for PWM generation
d) develop current driver circuit for LED.. any idea? can help to slove?
can help mi? i jus wan some guide n i will learn myself.. jus give mi some hint will do.. den i learn myself.. i have a variable resister also and i dunno put where or connect where?
Added after 54 minutes:
can someone guide mi and give some hint.. i need urgent.. i need guide
erm hw to do the program using ADC n PWM to generate the LEd dimmer? using c8051f226dk. hw does it wrk? tel mi more and the code i wanted dunno correct anot.. u have the datasheet rite? den can help mi? if possible i give u wat i have type and let u take a look?
thank for replying mi. next week monday.. can help mi ma? i need it urgent because i have no idea what to do also.. cos first time handle this project.. thank.
i alreadi start the flashing the LED wish can work. and now i wan go another steps which is going to do ADC but i don't have any idea about ADC.. so can give some guide? following is my PDF file name.. is my data sheet and kinda help mi abit. thank for replying mi..
{
ADBUSY = 0x01; //starts the adc conversion
while(ADCINT); //polling for ADCINT which tells us the end of conversion
ADCINT = 0x00;
on_time = ((unsigned int)ADC0H)*256;
for ( index = 0 ; index < total_period ; index++)
{
if (on_time--)
{
LED = 0x01; //switching on the LED
}
else
{
LED = 0x00; //switching off the LED
}
}
}
}
void adc_init ()
{
AMX0SL = 0x3f; // enable AMUX & configure for p3.7 as i/p pin
ADC0CF = 0x60; // set conversion clk at one sys clk and PGA at gain =1
ADC0CN = 0xC0; // ADC is enabled and ADBUSY=0 (changed here)
REF0CN = 0x03; // VDD is selected as Vref. Here are you using VDD for variable resistor also?
}
void port_init()
{
P3MODE = 0X7F; // Except the P3.7 pin all are configured as digital I/O
}
i run the code but nothing happen.. hw come? and i have connect mine variable resistor to the ADC input but nothing happen.. y? any idea? what does the code do?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.