Showing posts with label Proteus. Show all posts
Showing posts with label Proteus. Show all posts

Wednesday, March 13, 2013

Volt/Ohm Meter for 8051 using Assembly

The post provides simple Digital Meter project code using assembly for 8051 micro-controller. This project mainly focusing on designing condition circuits and demonstrating a use of Analog to Digital Converter (ADC).

Code, flowchart and Proteus simulation is given in the 'Downloads' section at the bottom of this page. It is assumed that you know how to interface LCD and ADC with 8051 micro-controller.


The result of the Proteus simulation is shown below.



In the above figure, we can see that a read of voltmeter and ohmmeter is shown on the screen. The processor keep scanning for change of analog signals of voltmeter and ohmmeter circuits sequentially and frequently. If some change happens equal to one step size (5/255=19.61mV) or more, the processor calculate the new reads and print it.

Flowchart


The flowchart describes the main routine and each one of the three subroutines included at the assembly code.

The program acts as follows:


  1. Initialize the memory and LCD for display after powering up.


  2. Convert analog voltage signal on IN0 of ADC to 8-bit digital signal.


  3. Calculate and print voltage value (Vin = Digital signal * Step size)


  4. Convert analog voltage signal on IN1 of ADC to 8-bit digital signal.


  5. Calculate and print resistance value by voltage divider method.


  6. Forever repeat steps from 2 to 5



Features



  • Good sensitivity for voltmeter.

  • Ohmmeter resistivity ranges up to 9.7 KΩ.

  • No need of external clocking source for ADC.


  • No need of switches for voltmeter and ohmmeter mode multiplexing.


Downloads


The code was compiled in Kiel uVision 4 and simulation was made in Proteus v7.8 SP2.
To download code, flowchart and simulation click here

Sunday, February 24, 2013

Basic Calculator for 8051

Hello Everyone, Finally I come back after along absence. Today's blog will be about something I like most.  It took from me the last two nights. Fortunately it's required for my next class homework. I hope it could help my colleagues :)

The post provides a simple calculator project code using assembly for 8051 micro-controller. This is a simple one decimal digit calculator which implements only 4 functions: addition(+), subtraction(-), multiplication(x) and division(/).

Code, flowchart and Proteus simulation is given in the 'Downloads' section at the bottom of this page. It is assumed that you know how to interface LCD and keypad with 8051 micro-controller.

The result of the Proteus simulation is shown below.

Calculator Proteus Sim

In the above figure, we can see that a result of "9x9=81" is shown on the screen. To achieve this result, first press '9' from the keypad. Then press 'x' and then press '9' again. After that, on pressing '=' from the keypad the result '81' is automatically displayed on the screen. Then after seconds the screen cleared automatically for next try.

Flowchart


The flowchart describes the main routine and each one of the four subroutines included at the assembly code.

the program acts as follows:

  1. Initialize the memory and LCD for display after powering up.

  2. Get input form user as " 10/2="

  3. Calculate the result depending on the operation once the user press (=)

  4. Print the output on LCD


Calculator flowchart

Features of this calculator



  • You can give any single digit input from 0 to 9.

  • 4 functions are implemented i-e addition, subtraction, multiplication and division.

  • Error messages are displayed if wrong input is detected. For example, if calculator is expecting a number, but a function key is pressed then 'Error!!' message is displayed. Similarly, 'Error!!' message is displayed if wrong key is pressed instead of a function key.


Downloads


The code was compiled in Kiel uvision 4 and simulation was made in Proteus v7.8 SP2.
To download code , flowchart and proteus simulation click here