Write a code in C language that runs on Microcontroller AT89C51CC03, 8051.
crystal speed 28.2078 MHz
For this program you will read the value on a potentiometer using the A/D converter and use that value to adjust the duty cycle that an LED is turned on using PWM. This will allow you to make a dimmable LED. The A/D converter has a reference voltage of 2.5 volts and its input should not exceed this value. Likewise the input should not go below zero. Use the potentiometer arrangement show below on the A/D channel zero. The value of R should be either 1K, 5 K, or 10 K. Connect an LED to PWM Channel 0. This arrangement allows the user to select an A/D input voltage from 0 to 2.5 volts. Write a program to accept this input and produce a PWM signal on channel 0 which has a duty cycle proportional to the A/D voltage.