AT89S52 Mini Development Board – Switch Interfacing

AT89S52 Mini Development Board has 3 Switches (SW1,SW2 & SW3) connected to port pins P2.0, P2.1 & P2.2 via jumpers J7, J8 & J9respectively. On shorting these jumpers, the switches can be used as pull_up keys and if the jumpers are left open, then the port pins can be used independently. Sample code of switch interfacing via UART and LCD display is shown below separately.SchematicSample CodeSwitch Interfacing via UART – in the code, switch press is detected by polling and upon pressing a switch, its name gets transmit. In circuit pull-ups has been provided to all three switches.

Output

Flash the code into the controller and connect it to PC using suitable interface.. Various steps to check the output using RealTerm are given below.

  • Step 1: Launch RealTerm

  • Step 2: RealTerm opens as shown below

  • Step 3: Go to ‘Port’ option, set correct baudrate (which is set as 9600 in the sample code) and give correct port number.
  • Step 4: Click ‘Change’ (encircled in red) to apply the changes. Now check the status of Port. If it is closed, click ‘Open’ button (encircled in green) to open it.

  •  Step 5:Now go for pressing the pull_up keys, when press switch output in real term can be viewed as shown below .

Sample codeSwitch Interfacing via LCD display – in the code, switch press is detected by polling and upon pressing a switch, its name(SW1/ SW2 /SW3) gets displayed on the LCD. In circuit pull-ups has been provided to all three switches.

Topics related to AT89S52 Mini Development Board

  1. AT89S52 Mini Development Board – Overview
  2. AT89S52 Mini Development Board – LED Interfacing
  3. AT89S52 Mini Development Board – LCD Interfacing
  4. AT89S52 Mini Development Board – Serial communication
  5. AT89S52 Mini Development Board – EEPROM Interfacing
  6. AT89S52 Mini Development Board – Buzzer Interfacing
  7. AT89S52 Mini Development Board – Servo Motor Interfacing
  8. AT89S52 Mini Development Board – Switch Interfacing
  9. AT89S52 Mini Development Board – RFID Interfacing

Resources

How to buy?

SupportPlease share your ideas with us, visit our forum for discussion

 

Leave a Reply