Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/25/06 01:02
Read: times


 
#120996 - 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.

#include <reg52.h>
#define SIZE 12

void wait(void)
{
   int x;
   for( x = 0; x <= 32700; x++ );
}
void main(void)
{
   unsigned long crude[SIZE] = { 0x00, 0x11, 0x40, 0x80,
    0xC0, 0xEE, 0xFF, 0xEE, 0xC0, 0x80, 0x40, 0x11 };
   int i;
   for( ; ; )
   {
      for( i = 0; i < SIZE; i++ )
	  {
	     P1 = crude[i];
		 wait();
	  }
	}
}
MY PROBLEM: But my problem is that as there is only ON and OFF in electronics so I can not see the intensity on software proteus. I also switched multimeter there but no change in cutrrent is shown may be due to sudden change in intensity in one second to other intensity level(total levels made in this program are 12 so almost 11 seconds to execute the whole on---to---highest intensity---to---off.). MY QUESTION Is it correct to burn on 8051 and see the response?

List of 72 messages in thread
TopicAuthorDate
control intensity of LED's            01/01/70 00:00      
   parallel post            01/01/70 00:00      
      Micro            01/01/70 00:00      
         pp1            01/01/70 00:00      
            Craig, we NEED a spell-checker!            01/01/70 00:00      
               That'd block all Erik's posts, then ;-)            01/01/70 00:00      
                  Well, what would that hurt?            01/01/70 00:00      
               Super large dictionary            01/01/70 00:00      
                  Those are "out there"            01/01/70 00:00      
                     Some problems I see...            01/01/70 00:00      
                        True enough ... nothing's perfect            01/01/70 00:00      
                           Homonyms            01/01/70 00:00      
                              exactly!            01/01/70 00:00      
                                 spell-checker            01/01/70 00:00      
               No no no no no            01/01/70 00:00      
                  what a colourful reply.            01/01/70 00:00      
   You might have better success....            01/01/70 00:00      
      Options            01/01/70 00:00      
         can be very much simpler            01/01/70 00:00      
            Insuficient Data for Proper Anlysis Captian            01/01/70 00:00      
            mistakes            01/01/70 00:00      
   can you say \"duty cycle\"?            01/01/70 00:00      
      Very unsafe!            01/01/70 00:00      
         duty cycle            01/01/70 00:00      
            Do some thinking...            01/01/70 00:00      
               _________            01/01/70 00:00      
                  Back to basics            01/01/70 00:00      
                     more basics            01/01/70 00:00      
                  you have to crawl before you walk            01/01/70 00:00      
                     code            01/01/70 00:00      
                        Checking code            01/01/70 00:00      
                           answers            01/01/70 00:00      
                              You didn't read the instructions!            01/01/70 00:00      
                                 if you can't read and follow instructions, I doubt            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                    please, pretty please ...            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                    who gives a friggin\' hoot            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                 i tried but a problem            01/01/70 00:00      
                                    Eh?            01/01/70 00:00      
                                       hardware problem            01/01/70 00:00      
                                          Logic?            01/01/70 00:00      
                                             done!            01/01/70 00:00      
                                                interrupt of 8051.. question            01/01/70 00:00      
                                                   no way            01/01/70 00:00      
                                                   Unrelated questions            01/01/70 00:00      
                                                   not studied microcontroller            01/01/70 00:00      
                                          Hardware questions            01/01/70 00:00      
                                          you just created an 'advanced blinky'            01/01/70 00:00      
                                          What the hell??            01/01/70 00:00      
                                             about the 10th time in this thread            01/01/70 00:00      
                                             This guy doesn't even have the basics ...            01/01/70 00:00      
         The general priciples, maybe, but specifics, NO!            01/01/70 00:00      
   u.....you            01/01/70 00:00      
      again            01/01/70 00:00      
         the dead esy way            01/01/70 00:00      
            Tut, tut, Erik            01/01/70 00:00      
               ok, guilty as charged, and a no            01/01/70 00:00      
               fonts!            01/01/70 00:00      
                  well, if the OP took the time to follow the link,            01/01/70 00:00      
                     Not so sure            01/01/70 00:00      
            Cunning            01/01/70 00:00      
               in addition            01/01/70 00:00      
         ???            01/01/70 00:00      
   writing in "c "or in assembly            01/01/70 00:00      
      no need to SHOUT, it is annoying            01/01/70 00:00      
      Compilers; writing code            01/01/70 00:00      
         all-cap's helps in other ways            01/01/70 00:00      

Back to Subject List