TCS Pune

8051: Ports and Delay

Practical lesson

8051: Ports and Delay

Understand the classic 8051 port model using embedded C.

◷ 40 min

Parts and tools

  • 8051 trainer board
  • LED array
  • Programmer

Lesson

Learning objective

Understand the classic 8051 port model using embedded C.

Procedure

  1. Review the circuit and confirm the board voltage.
  2. Build and inspect the wiring before applying power.
  3. Upload the example, observe the result and record your readings.
  4. Change one parameter, predict the result and test again.

Troubleshooting

Check power, ground, pin selection, polarity, compiler target and serial output. Use a multimeter or logic analyser where appropriate.

Example code

#include <reg51.h>
sbit LED=P1^0;
void main(){ LED=0; while(1){} }

Knowledge check

P1 refers to what?

Ready when you are

Need help with your laptop or computer?

Send us the model and fault details. Start your repair request online or contact TCS Pune directly.

WA