Hi, roelof

Thank you very much for your prompt reply. Seriously thank you.
The code is actually copied from somebody else. I just did some copy/paste,
and then test.

I responded to my previous Email, probably into the wrong Email address
(the sdcc development,
instead of sdcc user)  . Sorry. I'm trying your solution now...

Thank you
*
*
*
*
*JIA Pei <jp4w...@gmail.com>*
*9:54 AM (8 hours ago)*
**
**
**
*to Development*
**
*Thank you for all who have answered my questions !! seriously thank you. *
*The solutions has been found:*
*
*
*
*
*
*
*#include <8052.h>*
*
*
*#define RELAY P1_4*
*#define K1 P2_7*
*
*
*main()*
*{*
*while(1)*
*{*
*  if (!K1) RELAY = 0;*
*  else  RELAY = 1;*
*}*
*}*
*
*
*
*
*Thank you everybody !!!*





On Sat, Jun 8, 2013 at 5:48 PM, roelof 't Hooft <roel...@itholland.nl>wrote:

> On Sat, 2013-06-08 at 17:15 +0800, JIA Pei wrote:
>
> > #include <reg51.h>
>
> Did you read the replies on your previous post ?
> You did not respond to them (yet).
> Hint : sdcc must be giving you a warning about
> NOT using reg51.h
>
>
> > void int0()  interrupt 1
> > {  TH0=0xd8;
> >    TL0=0xef;
> >    n--;
> > }
>
> The proper setup of the interrupt routine with a current
> sdcc version is like the following :
>
> void Timer0_ISR(void) __interrupt tf0_vector
> {
>         ....;
> }
>
> tf0_vector can be replaced with a number if you like as it
> already is a number set with #define in the processor type
> header file.
>
>
> > void delay (unsigned char m)
> > {
> >  unsigned i=3*m;
>
> This variable is unsigned type what ?
> I am assuming integer due to the three times multiplication
> of a char (max value 255 * 3).
>
>
> > void delayms(unsigned char a)
> > {
> >   while(--a);
> > }
>
> If you want strict timing, like a millisecond delay, use
> a hardware timer.
>
>
> > play:
> >    while(1)
> >     {
> >     a: p=music_tab[i];
> >        if(p==0x00)       { i=0, delayms(1000); goto play;}
>
> A "goto", seriously ?
>
> Still no mention of the sdcc version.......
> And no specific errors noted that sdcc gave.
>
> roelof
>
> ps: advise : please clean up your code writing skills. It
> looks like s**t.
>
>
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>



-- 

Pei JIA

Email: jp4w...@gmail.com
cell:    +1 604-362-5816

Welcome to Vision Open
http://www.visionopen.com
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to