8051 Calculator using PC Serial Port

Description

It’s an example of 8051 Calculator using PC Serial Port.

Circuit Diagram

Detail

This example shows that how can we use PC screen for display and PC keyboard for user input to our 8051 microcontroller. At PC side we use a terminal software like hyperterminal that displays data coming from microcontroller and sends key strokes read to microcontroller. So this makes easy for a new programmer to display and read input from user without interfacing any LCD, seven segment or keypad. This example also shows that how can we configure and use serial channel of 8051 microcontroller for sending and receiving data to PC. In so many projects we need to share data or information to other devices.

In this example 8051 microcontroller first displays title information then asks user to select a choice from given choices like

8051 Calculator using PC Serial Port

By    : Micro Digital
Web   : https://www.micro-digital.net
Email : udigital.solutions@gmail.com
Cell  : +92-332-555-8051

Enter your choice
1) Add
2) Subtract
3) Multiply
4) Divide

User selects a choice by pressing appropriate key from 1 to 4. Then microcontroller asks user to enter 1st number or operand like

Enter 1st number (Max Length 4)
Num1 : 

Then user enters 1st integer value with maximum length 4. For example user enter 124 and presses enter. Then microcontroller asks user for 2nd number

Enter 1st number (Max Length 4)
Num1 : 124
Enter 2nd number (Max Length 4)
Num2 : 

Now user enters 2nd number for example 234 and presses enter.

Enter 1st number (Max Length 4)
Num1 : 124
Enter 2nd number (Max Length 4)
Num2 : 234
Ans  : 358
Press any key to continue...

Finally microcontroller shows answer and asks user to press any key for next calculation. This is an interesting example in which we learn how can we configure 8051 serial channel, use PC monitor for microcontroller display and PC keyboard as keyboard attached to microcontroller.

For basic operation & components used in an 8051 based microcontroller based systems see
8051 Basic LED Flasher.

Free Downloads

8051-Calculator-using-PC-Serial-Port.zip

Related Projects

8051 Basic LED Flasher

PC Serial RS232 Port Interface To 8051

PC Serial RS232 Port Interface To 7 Segment

PC Serial RS232 Port Interface To 16×2 LCD

More Projects