1. You can now buy finished microcontroller project from us, Check out the Store for the complete list of projects.
  2. Need a custom project, Send us some details about your project. So that we can quote the price for it.

8051 I/O programming error using 8051

Discussion in 'Microcontrollers' started by Niteen Autade, May 17, 2015.

  1. Niteen Autade

    Niteen Autade New Member

    Likes Received:
    0
    Trophy Points:
    1
    I recently started practicing 8051 on Proteus and using KEIL

    I am trying to use a switch at a one port to turn on a LED at another port.(Switch ON=LED ON,SWITCH OFF=LED OFF.)



    But when my switch is OFF(ON) the LED is staying ON(OFF).I am unable to understand why this is happening.



    My code:

    SETB P1.7

    HERE: JB P1.7,LEDON
    CLR P1.0
    SJMP HERE
    LEDON: SETB P1.0
    SJMP HERE

    Attached Files:

    Tags:
Loading...

Share This Page

Loading...