From: EVANDRO L. H. <eva...@si...> - 2003-06-02 14:43:40
|
And don't forget the loop :-) =20 #include <8052.h> #include "generic.c" =20 void main (void) { while(1) { =20 P1_7=3D0; sec_wait(2); P1_7=3D1; sec_wait(2); } } =20 best regards, Evandro =20 -----Original Message----- From: Paul [mailto:pa...@pj...]=20 Sent: s=E1bado, 31 de maio de 2003 14:44 To: sdc...@li... Subject: Re: [Sdcc-user] SDCC help =20 Shahzad Khan wrote: Hi, I am a newbie with SDCC and facing a lot of problem in a project. I am trying to glow a LED in the main program and nothing else. But the LED doesn't behave as desired. I am pretty sure that the problem is in software. Why are you sure of that? A common error is to connect the LED from a port pin to ground, with the= intention that the LED will light when the pin is high. This does not= work, because the pin can not source much current. The LED must be connected between the pin and Vcc, with a current limiting= resistor in the range of 200 to 1000 ohms. Disconnect the wire from your= port pin and try shorting it to ground to verify that the LED really does= light when the pin is driven low. Also, connect a voltmeter to the pin and watch the actual voltage. If the= resistor is too high and its a low efficiency LED there may not be enough= current to light the LED. Either, the linkage is not proper or their is a memory problem (in RAM).=20 =20 Does SDCC give error in compilation if there is a memory problem? (small model) Usually you will get an error, but not always. You did not provide the exact command you're using to run sdcc, so we can= not see what options you are giving to the linker for memory mapping. = Please refer to the list of 4 recommended things to include in support= requests: http://sdcc.sourceforge.net/#Support Please help me as I am badly stuck. =20 Find the files attached. I am using AT89C52. The code looks like it should work, assuming you're compiling the main() in= the second attached file. Paul =20 =20 Thanks in advance, Shahzad =20 __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com =20 =20 The information contained in this e-mail and in the attached files are for= the exclusive use of the addressee herein nominated, and may contain trade= secrets, privileged and other confidential information,protected by the applicable= laws. In case you are not the right addressee, you are hereby notified that= any=20 reviewing, reading, copying and/or distributing of this e-mail's content= is=20 strictly prohibited and unauthorized. Please, delete the e-mail's content= and=20 notify the sender immediately.=20 Thank you for your cooperation. |