| ??? 07/25/06 01:02 Read: times |
#120997 - i tried but a problem Responding to: ???'s previous message |
I tried to control the intensity of one LED by the following logic.
microcontroller---to---Digital to Analogue converter---to---LED 8051 DAC 0808 LCN AT89C51 I connected the circuit diagram as shown in the following figure. http://8052.com/users/ammarlamhay/ledglow.jpg logic: The Analogue to Digital converter is connected to port 3 of microcontroller 8051 ans shown in the figure http://8052.com/users/ammarlamhay/ledglow.jpg. Then LED is connected to the output pin of D/A converter. Now via following code I triesd to send digital signals to D/A converter by changing the number of pins in the following way.
digital value binary value Corresponding Hexadecimal value
(actually P3) (value assigned to
8051 via C Language)
0 00000000 00
17 00010001 11
64 01000000 40
128 10000000 80
192 110000000 C0
238 11101110 EE
255 11111111 FF
238 11101110 EE
192 110000000 C0
128 10000000 80
64 01000000 40
17 00010001 11
YOu can see that it is a crude sine wave.. slightly distorted..
The 00000000 assigned to P3 will keep LED off. 00010001 will on it. 01000000 will on it with more intensity as P3^2 has more priority that P3^3 + P3^8. and so on. Thus intensity is controlled.
this is my C code compiled on KEIL with no errors and warnings and HEX file created successfullly on Proteus.
|



