hello i wana ask i have intefaced two switches with 8051 when one switch is on relay on and when other switch is on relay will be off..every thing works fine in protious and hardwre but it is ok for a short interval of time almost 5 minute but i have to off the relay after 12 hours ...after a long time 8051 doesnot read the pin i dnt know what is the problem.....this is the simple code here. 8051 read switch for a small interval of time but after a long time interval 8051 doesnot read the pin.........
___________________________________________________________________
I suggest you to
1. share the circuit diagram, so we can look into h/w problem as well, if any.
2. If possible use EXT INTR (INT0 and INT1) instead of P2.0, P2.1.
i dont know how to use external intrupt please suggest me the article where i can learn how to use external intrupts ans sample code too....thnkyou very much for this help....!
To define an interrupt function using the Keil C51 Compiler, an interrupt number and register bank is specified where the interrupt number corresponds to a specific interrupt vector address.
While each C compiler has its own Interrupt Service Routine (ISR) syntax, it appears you are using Keil, if not reference the appropriate compiler docs for the proper ISR syntax.
welove8051 i try ur code but still it is good for short time i can on the system but cant make it off.....becuse system have to remain on for almost 12 hours...