Introduction

  • Use of dip switches as microcontroller input devices
  • Variable in CCS C Compiler
  • Activity 1. Read a binary word from PORTD
  • Activity 2. LEDs on PORTB turn ON and OFF in accordance with a program selected with the switches connected on PORTD
  • Activity 3. Read the value of a specific pin of an input parallel port
  • Activity 4. Counter of the 1s of input PORTD

(30 minutes)


Use of (dip) switches as microcontroller input devices

Use of a switch to form the binary input value 1.    RD0=1



Use of a switch to form the binary input value 0.    RD0=0




Read an 8 bit binary word from input PORTD.