Thursday, June 13, 2013

Basic Calculator V2.0 for 8051

Hello again, after I posted my basic calculator V1.0, I found that many friends and visitors liked it. They also asked if it could be developed to handle 2 digits calculations.

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

Assembly code, Proteus simulation and Eagle Schematics 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 AT89C52.

The result of the Proteus simulation is shown below.

Simulation

In the above figure, we can see that a result of “12×12=144” is shown on the screen. To achieve this result, first press ’1' followed by '2' from the keypad. Then press ‘x’ and then press ’12′ again. After that, on pressing ‘=’ from the keypad the result ’144′ is automatically displayed on the screen. Then after seconds the screen cleared automatically for next try.

The schematic with minimum right connections is shown below.

CalculatorV2_Sch

 

Features 

  • You can give any single digit or two digits from 00 to 99.
  • 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 , schematics and simulation CLICK HERE

Sunday, April 14, 2013

How to Convert 16-bit Binary digits to BCD for 8051

This post is simply showing how to convert Binary 16-bit to five BCD digits.  The routine's importance come from that 8051 is a 8-bit microprocessor so it can't handle data in 16-bits directly. The routine has many uses such as with arithmetic calculator or frequency meter.

As usual I put a bit detailed flowchart aside with the assembly code which is also come with full describing comments. Download links are given at the bottom of the post.


BIN2BCDFLOWCHART
010203


Downloads


To download code and flowchart click here

Friday, April 12, 2013

Digital Frequency Meter for 8051

A good use of the frequency counter is to calibrate other equipment. For example a signal generator that doesn't have its own digital display. The meter will show the exact frequency being produced by the signal generator.  Based on the 8051 microcontroller. It is assumed that you know how to interface LCD with the microcontroller.

Code, flowchart, schematic diagram and Proteus simulation is given in the ‘Downloads’ section at the bottom of this page. 

Firmware



  • This Program is to count frequency from T1 (P3.5), by using mode 1 Counter 16 bit.

  • Counter resets every 1 second that generated by timer 0, mode 1, timer 16 bit.

  • Every 1 second data will show on LCD Character.

  • The  assembly code is followed by detailed comments describe each routine

  • The flowchart below describing the concept and procedure.


Freq Meter

Hardware Schematic


All parts and components with full connection is shown below.

Capture2

Features



  • Minimum hardware with high accuracy

  • Sensitivity is perfect from 1 Hz to 500 KHz

  • Work and tested on most of periodic signals (Square, Sin, Saw tooth, .. )


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

Thursday, March 21, 2013

Digital Calendar for 8051

A digital calendar is one that displays time and date digitally. The project explained here, displays time on a 16x2 LCD module. A keypad  4x3 matrix is used to set it. This circuit can be used in cars, houses, offices etc.

This clock works in 12 hour mode and is configured by programming the microcontroller. The program uses a delay function for producing a delay of 1 second.

Code and Proteus simulation is given in the ‘Downloads’ section at the bottom of this page. The program took from me the whole night though good to know that the project is still at testing phase. For this I'm expecting your feedback if any bug found or development needed :)

The Proteus simulation is shown below.

Digital Calendar

On reset, the LCD prompts the user to set time first. The hour and minute components can be set by entering the corresponding valid values using the keypad. The AM/PM mode is set by entering 1 or 2. Give 1 for am while 2 for pm. After that the LCD prompts the user to set date components which is day, month and year.

The set time and date is displayed on LCD screen and changes as the time passes on. Seconds are increased after every one second by making use of delay function uses timer 0 with mode 1. As second reaches 59, minute is incremented by one and second is reset to 0. Similarly, as minute reaches 59, hour is increased by one and minute is set to 0. After hour reaches 11, minute reaches 59 and second reaches 59,  the AM/PM mode is changed accordingly. The date is changing by the same concept taking into account the difference values for its components.

Features




  • The possibility of setting  time and date

  • Simple circuit and min components

  • Acting as real time clock


Downloads


The code was compiled in Kiel uVision 4 and simulation was made in Proteus v7.8 SP2.

To download code and simulation click here

Wednesday, March 13, 2013

My Best Quote!

My best word :)

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

Monday, March 4, 2013

VLSI CAD: Logic to Layout

VLSI CAD: Logic to Layout

The course I was waiting for is just starting, I'll be pleased if you join also :)

The course is about VLSI, seems to be another point of view than which we study at our class this year, but I think it's still interesting ^^

Course Instructor: Rob A. Rutenbar
He is the Abel Bliss Professor and Head of the Department of Computer Science (CS) at the University of Illinois at Urbana-Champaign :O

PS. Coursera gives the course online at zero fees! ;)
 

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

Saturday, February 9, 2013

How Famous Tech Companies Got Their Names?!

Apple Computers:


Image


It was the favorite fruit of founder Steve Jobs. He was three months late for filing a name for the business, and he threatened to call his company Apple Computers if the other colleagues didn't suggest a better name by 5 o’clock. 



 Google:


Image

The name started as a joke boasting about the amount of information the search-engine would be able to search. It was originally named ‘Googol’, a word for the number represented by 1 followed by 100 zeros. After founders – Stanford graduate students Sergey Brin and Larry Page presented their project to an angel investor; they received a cheque made out to ‘Google’. So, instead of returning the cheque for correction, they decided to change the name to Google. 



Hewlett Packard:


Image

 

Bill Hewlett and Dave Packard tossed a coin to decide whether the company they founded would be called Hewlett-Packard or Packard-Hewlett :D



INTEL:


Image

  Bob Noyce and Gordon Moore wanted to name their new company ‘Moore Noyce’ but that was already trademarked by a hotel chain so they had to settle for an acronym of INTegrated ELectronics.



Microsoft:


Image

Coined by Bill Gates to represent the company that was devoted to MICROcomputer SOFTware. Originally christened Micro-Soft, the ‘-’ was removed later on.

Motorola :


Image

Founder Paul Galvin came up with this name when his company started manufacturing radios for cars. The popular radio company at the time was called Victrola.



SONY:


Image

It originated from the Latin word ‘sonus’ meaning sound and ‘sonny’ as lang used by Americans to refer to a bright youngster.