668Hc11

Páginas: 17 (4011 palabras) Publicado: 7 de septiembre de 2011
68HC11 Calculator
By Employee
68HC11 Board:
• The Wytec 68HC11: FOX11TM Trainer
The primary function of the calculator is for the calculation of two integer numbers. The following features are:
• The multiplication of an 8 bit integer * 8 bit integer to give a 16 bit result.
• The division of an 8 bit integer / 8 bit integer to give an 8 bit integer result.
• Thesubtraction of up to a 3 digit integer – a 8 bit integer for example: (999-998 = 1)
• The addition of up to a 3 digit integer + a 8 bit integer for example: (999+999 = 1998)
• The control of a servomotor from a serial rs-232 communication input.
• The serial rs-232 output of an 8-bit integer dictated by an integer from an ADC input.
The input of calculation variables is done through a 4x4keypad and displayed on a 16x2 LCD display module. 

The keystroke numbers are integers between 1 and 16. The following table shows the integer with their mating LCD character and the mating keypad illustration: 

|Integer number |LCD Character |Keypad Illustration |
|1 |1 |1 |
|2 |2|2 |
|3 |3 |3 |
|4 |4 |4 |
|5 |5 |5 |
|6 |6 |6 |
|7 |7|7 |
|8 |8 |8 |
|9 |9 |9 |
|10 |= |a |
|11 |backspace |b |
|12 |+ |c|
|13 |- |d |
|14 |* |e |
|15 |divide |f |
|16 |0 |0 |

The adc is an 8 bit value from channel 7 connected to anboard pot that can be turned from 0 up to 255. This is done by using the supplied screwdriver to turn the pot through the hole in the upper left region of the calculator as shown in figure 1. 

All calculations are performed by the program extracting the variables from the string MSG1. This string is inputted by the user from the keypad and is displayed on the first line of the LCD display. Forexample (255*254=). The first variable would be “255”, the second variable being “254” and the calculation function would be “*”. 

The first variable is converted from an ASCII integer as string to a single 8-bit number that is stored in a variable. It is also converted into hundreds, tens and ones. 

The second variable is also converted from an ASCII integer as string to a single 8-bitnumber that is stored in a variable. It is also converted into hundreds, tens and ones. 

The calculation function is an integer between 1 and 4:
• 1 = addition
• 2 = subtraction
• 3 = multiplication
• 4 = division.

68HC11 Calculator Code
By Matt Hocking
68HC11 Board:
• The Wytec 68HC11: FOX11TM Trainer
• *Program Name: Multifunctional Calculator with rs232 servomotor control
• * Author: Matt Hocking
• * Date: 13/5/07
• * Version: 2.9
• * Description: Multifunctional Calculator that can also control a servo motor
• *through an rs232 serial com.
• *--------------------------------------------
• ORG $c4
• *** Vector jump table for BUFFALO monitor ***
• JSPI RMB 3
• JPAIE RMB 3
• JPAO RMB 3
• JTOF...
Leer documento completo

Regístrate para leer el documento completo.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS