Professional Documents
Culture Documents
Abstract
Today the effective use of computers (e.g. those with internet browsers and graphical interfaces) involves the use of some sort of cursor control like what a mouse provides. However, a standard mouse is not always the best option for all users. There are currently many devices available to provide computer access to persons who do not have use of their arms or legs. There is no single solution as each device and application has to be tailored to each users unique preferences and abilities. To provide a better option for users with spinal cord injuries or severe disabilities an inexpensive wireless head tilt mouse using an accelerometer has been designed and built and its targeting performance compared to traditional mouse devices to show feasibility. The head tilt mouse uses Bluetooth to communicate with the host computer. Software running on the host translates accelerometer readings into cursor movements and, currently, button presses into mouse clicks.
Page 1
Page 2
Page 3
The experiments showed that users were able to acquire a target with the head tilt mouse in 10.9 seconds on average, with 48 target misses for 24 targets. Misses are defined as a mouse click event which occurred when the mouse cursor is positioned outside of the target. The minimum average time to acquire a target was 8.8 seconds and the maximum was 13.6 seconds. This compares to 1.6 seconds for the optical mouse and 1.9 for the touchpad, each with essentially zero misses. The average time to acquire targets for each user and device is shown in Figure 7. Figure 8 shows the average number of target misses for each user.
Page 4
provides code efficiency, elements of structured programming, and a rich set of operators. Its generality combined with its absence of restrictions, makes C a convenient and effective programming solution for a wide variety of software tasks. Many applications can be solved more easily and efficiently with C than with other more specialized languages. Cx51 is not a universal C compiler adapted of the 89C51 target .It is a ground-up implementation dedicated to generating extremely fast and compact for the 89C51 microcontroller. Cx51 provides you with the flexibility of programming in C and the code efficiency and speed of assembly language. The C language on its own is not capable of performing operations (such as input and output) that would normally require intervention from the operating system. Instead, these capabilities are provided as a part of the standard library .Because these functions are separate from the language itself, C is especially suited for producing code that is portable across a wide number of platforms. Since Cx51 is a cross compiler, some aspects of the C programming language and standard libraries are altered or enhanced to address the peculiarities of an embedded target processor. Dept of Biomedical Engineering KBN College of Engineering. Page 5
Page 6
PIEZOELECTRIC SENSOR Depending upon the kind of work, the accelerometers vary in the way they are prepared and how they work. Some accelerometers use piezoelectricity, these are man-made. In such accelerometers the acceleration is calculated based upon the charges derived from the microscopic crystalline structures when they are accelerated due to motion.
MEMS ACCELEROMETER Another kind works with the capacitance and the changes initiated within it as a result of some accelerative force. This technology is used from automotive industry to agriculture industry and from NASA to military researches and operations.
Page 7
ACCELEROMETER IS USED IN: AUTOMOTIVE INDUSTRY Due to high demand and wide spread use of accelerometers in the automotive industry and new hi-tech technology, these sensors are now light weight and are available at low cost and reduced prices. MICROPHONES Microphones also carry accelerometers. That is how they are able to detect the minute frequencies. ROBOTICS The forces that can cause vibrations which are detected by the accelerometer can be static, dynamic or gravitational. Certain accelerometers are rated G. G stands for Gravity. Such accelerometers are used mostly in robotics. They are more sensitive to motion and can be triggered at the slightest changes in gravitational pulls.
Page 8
Page 9
Page 10
Page 11
IC ULN 2004 1
16
15 14 13 12 11 10 9 Vcc Page 12
Since the digital outputs of the some circuits cannot sink much current, they are not capable of driving relays directly. So, high-voltage high-current Darlington arrays are designed for interfacing low-level logic circuitry and multiple peripheral power loads. The series ULN2000A/L ICs drive seven relays with continuous load current ratings to 600mA for each input. At an appropriate duty cycle depending on ambient temperature and number of drivers turned ON simultaneously, typical power loads totaling over 260W [400mA x 7, 95V] can be controlled. Typical loads include relays, solenoids, stepping motors, magnetic print hammers, multiplexed LED and incandescent displays, and heaters. These Darlington arrays are furnished in 16-pin dual in-line plastic packages (suffix A) and 16-lead surface-mountable SOICs (suffix L). All devices are pinned with outputs opposite inputs to facilitate ease of circuit board layout. The input of ULN 2004 is TTL-compatible open-collector outputs. As each of these outputs can sink a maximum collector current of 500 mA, miniature PCB relays can be easily driven. No additional free-wheeling clamp diode is required to be connected across the relay since each of the outputs has inbuilt free-wheeling diodes. The Series ULN20x4A/L features series input resistors for operation directly from 6 to 15V CMOS or PMOS logic outputs.
1N4148 signal diode: Signal diodes are used to process information (electrical signals) in circuits, so they are only required to pass small currents of up to 100mA. General purpose signal diodes such as the 1N4148 are made from silicon and have a forward voltage drop of 0.7V.
Page 13
Page 14
Page 15
32 P0.6 33 Action sensing speech using iMEMS P0.5 40 vcc 12 MHz 18 29 XTAL2 PSEN 30 pF 30 31 +VCC 10 MFD/63V 20K RESET SWITCH 17 9 P3.7 16 P3.6 15 P3.5 14 P3.4 rd wr t1 t0 int1 int0 txd rxd P3.2 11 P3.1 10 P3.0 20 vss P3.3 12 13 ALE EA RST P0.4 35 P0.3 36 P1.7 P0.2 8 37 P1.6 P0.1 7 38 P1.5 P0.0 6 39 P1.4 5 P1.3 4 P2.7 P1.2 28 ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 D3 D1 & D2
19
+Vcc
230 AC
X1
R1
C1 C2
port 0
8 x 2.2 K
89c51
port 1
a15 a14 a13 a12 a11 a10 a9 a8
port 3
port 2
Page 16
The mother board of 89C51 has following sections: Power Supply, 89C51 IC, Oscillator, Reset Switch & I/O ports. Let us see these sections in detail. POWER SUPPLY: This section provides the clean and harmonic free power to IC to function properly. The output of the full wave rectifier section, which is built using two rectifier diodes, is given to filter capacitor. The electrolytic capacitor C1 filters the pulsating dc into pure dc and given to Vin pin-1 of regulator IC 7805.This three terminal IC regulates the rectified pulsating dc to constant +5 volts. C2 & C3 provides ground path to harmonic signals present in the inputted voltage. The Vout pin-3 gives constant, regulated and spikes free +5 volts to the mother board. The allocation of the pins of the 89C51 follows a U-shape distribution. The top left hand corner is Pin 1 and down to bottom left hand corner is Pin 20. And the bottom right hand corner is Pin 21 and up to the top right hand corner is Pin 40. The Supply Voltage pin Vcc is 40 and ground pin Vss is 20. OSCILLATOR: If the CPU is the brain of the system then the oscillator, or clock, is the heartbeat. It provides the critical timing functions for the rest of the chip. The greatest timing accuracy is achieved with a crystal or ceramic resonator. For crystals of 2.0 to 12.0 MHz, the recommended capacitor values should be in the range of 15 to 33pf2. Across the oscillator input pins 18 & 19 a crystal x1 of 4.7 MHz to 20 MHz value can be connected. The two ceramic disc type capacitors of value 30pF are connected across crystal and ground stabilizes the oscillation frequency generated by crystal.
Page 17
I/O PORTS: There are a total of 32 i/o pins available on this chip. The amazing part about these ports is that they can be programmed to be either input or output ports, even "on the fly" during operation! Each pin can source 20 mA (max) so it can directly drive an LED. They can also sink a maximum of 25 Ma current. Some pins for these I/O ports are multiplexed with an alternate function for the peripheral features on the device. In general, when a peripheral is enabled, that pin may not be used as a general purpose I/O pin. The alternate function of each pin is not discussed here, as port accessing circuit takes care of that. This 89C51 IC has four I/O ports and is discussed in detail: P0.0 TO P0.7 PORT0 is an 8-bit [pins 32 to 39] open drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs and configured to be multiplexed low order address/data bus then has internal pull ups. External pull ups are required during program verification. P1.0 TO P1.7 PORT1 is an 8-bit wide [pins 1 to 8], bi-directional port with internal pull ups. P1.0 and P1.1 can be configured to be the timer/counter 2 external count input and the timer/counter 2 trigger input respectively. P2.0 TO P2.7 PORT2 is an 8-bit wide [pins 21 to 28], bi-directional port with internal pull ups. The PORT2 output buffers can sink/source four TTL inputs. It receives the high-order address bits and some control signals during Flash programming and verification.
Page 18
P3.0 TO P3.7 PORT3 is an 8-bit wide [pins 10 to 17], bi-directional port with internal pull ups. The Port3 output buffers can sink/source four TTL inputs. It also receives some control signals for Flash programming and verification.
PSEN Program Store Enable [Pin 29] is the read strobe to external program memory.
ALE Address Latch Enable [Pin 30] is an output pulse for latching the low byte of the address during accesses to external memory.
EA External Access Enable [Pin 31] must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H upto FFFFH.
RST Reset input [Pin 9] must be made high for two machine cycles to resets the devices oscillator. The potential difference is created using 10MFD/63V electrolytic capacitor and 20KOhm resistor with a reset switch.
Page 19
LCD MODULE
LCDs can add a lot to any application in terms of providing an useful interface for the user, debugging an application or just giving it a "professional" look. The most common type of LCD controller is the Hitachi 44780 which provides a relatively simple interface between a processor and an LCD. Using this interface is often not attempted by inexperienced designers and programmers because it is difficult to find good documentation on the interface, initializing the interface can be a problem and the displays themselves are expensive. The most common connector used for the 44780 based LCDs is 14 pins in a row, with pin centers 0.100" apart. The pins are wired as:
Page 20
Pins 1 2 3 4 5 6 7 14
Description Ground Vcc Contrast Voltage "R/S" _Instruction/Register Select "R/W" _Read/Write LCD Registers "E" Clock Data I/O Pins
The interface is a parallel bus, allowing simple and fast reading/writing of data to and from the LCD.
The LCD Data Write Waveform will write an ASCII Byte out to the LCD's screen. The ASCII code to be displayed is eight bits long and is sent to the LCD either four or eight bits at a time. If four bit mode is used, two "nibbles" of data (Sent high four bits and then low four bits with an "E" Clock pulse with each nibble) are sent to make up a full eight bit transfer. The "E" Clock is used to initiate the data transfer within the LCD.
Sending parallel data as either four or eight bits are the two primary modes of operation. While there are secondary considerations and modes, deciding how to send the data to the LCD is most critical decision to be made for an LCD interface application.
The different instructions available for use with the 44780 are shown in the table below: R/S R/W D7 D6 D5 D4 D3 D2 D1 D0 Instruction/Description Page 21
The bit descriptions for the different commands are: "*" - Not Used/Ignored. This bit can be either "1" or "0" Most LCD displays have a 44780 and support chip to control the operation of the LCD. The 44780 is responsible for the external interface and provides sufficient control lines for sixteen characters on the LCD. The support chip enhances the I/O of the 44780 to support up to 128 characters on an LCD. From the table above, it should be noted that the first two entries ("8x1", "16x1") only have the 44780 and not the support chip. This is why the ninth character in the 16x1 does not "appear" at address 8 and shows up at the address that is common for a two line LCD.
The Character Set available in the 44780 is basically ASCII. It is "basically" because some characters do not follow the ASCII convention fully (probably the most significant difference is 0x05B or "\" is not available). The ASCII Control Characters (0x008 to 0x01F) do not respond as control characters and may display funny (Japanese) characters. <<,,
Page 22
S/R
0 0
or
LCD
LCD
LCD Contrast Circuit
Experts typically use a potentiometer wired as a voltage divider. This will provide an easily variable voltage between Ground and Vcc, which will be used to specify the contrast (or "darkness") of the characters on the LCD screen. You may find that different LCDs work differently with lower voltages providing darker characters in some and higher voltages do the same thing in others.
Timer NE/SA/SE555/SE555C
DESCRIPTION The 555 monolithic timing circuits is a highly stable controller capable of producing accurate time delays, or oscillation. In the time delay mode of operation, the time is precisely Dept of Biomedical Engineering KBN College of Engineering. Page 23
APPLICATIONS Precision timing Pulse generation Sequential timing Time delay generation Pulse width modulation
Page 24
Page 25
Page 26
PHOTO MODULES FOR PCM REMOTE CONTROL SYSTEMS DESCRIPTION THE TSOP17... SERIES ARE MINIATURIZED RECEIVERS FOR INFRARED REMOTE CONTROL SYSTEMS. PIN DIODE
AND PREAMPLIFIER ARE ASSEMBLED ON LEAD FRAME, THE EPOXY PACKAGE IS DESIGNED AS IR FILTER. DEMODULATED OUTPUT SIGNAL CAN DIRECTLY BE DECODED BY A MICROPROCESSOR.
THE
THE
TSOP17... IS
STANDARD IR REMOTE CONTROL RECEIVER SERIES, SUPPORTING ALL MAJOR TRANSMISSION CODES.
FEATURES PHOTO DETECTOR AND PREAMPLIFIER IN ONE PACKAGE INTERNAL FILTER FOR PCM FREQUENCY IMPROVED SHIELDING AGAINST ELECTRICAL FIELD DISTURBANCE TTL AND CMOS COMPATIBILITY OUTPUT ACTIVE LOW LOW POWER CONSUMPTION HIGH IMMUNITY AGAINST AMBIENT LIGHT CONTINUOUS DATA TRANSMISSION POSSIBLE (1200 BIT/S) SUITABLE BURST LENGTH .10 CYCLES/BURST
Page 27
Page 28
Page 29
1 2
4. Voltage Regulation: The filtered d.c. output is not stable. It varies in accordance with the fluctuations in mains supply or varying load current. This variation of load current is observed due to voltage drop in transformer windings, rectifier and filter circuit. These variations in d.c. output voltage may cause inaccurate or erratic operation or even malfunctioning of many electronic circuits. For example, the circuit boards which are implanted by CMOS or TTL ICs. The stabilization of d.c. output is achieved by using the three terminal voltage regulator IC. This regulator IC comes in two flavors: 78xx for positive voltage output and 79xx for negative voltage output. For example 7805 gives +5V output and 7905 gives -5V stabilized output. These regulator ICs have in-built short-circuit protection and auto-thermal cutout provisions. If the load current is very high the IC needs heat sink to dissipate the internally generated power.
Page 30
Page 31
D1 1
IC1 7812
IC1 7805
+12V
9V +5V
230AC C1
C2
C3
C4
D2 1
X 1
SUPPLY Parts List: SEMICONDUCTORS IC1 IC2 D1& D2 CAPACITORS C1 C2 to C4 MISCELLANEOUS X1 7812 Regulator IC 7805 Regulator IC 1N4007 Rectifier Diodes 1 1 2
1 3
Page 32
MAX 232
Dept of Biomedical Engineering KBN College of Engineering. Page 33
RS 232 CONVERTER (MAX 232N) Serial Port: This is the device, which is used to convert TTL/RS232 vice versa. RS-232Protocol In telecommunications, RS-232 is a standard for serial binary data interconnection between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly used in computer serial ports. The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels. Valid signals are plus or minus 3 to 15 volts. The range near zero volts is not a valid RS-232 level; logic one is defined as a negative voltage, the signal condition is called marking, and has the functional significance of OFF. RS-232 was created for one purpose, to interface between Data Terminal Equipment (DTE) and Data Communications Equipment (DCE) employing serial binary data interchange. So as stated the DTE is the terminal or computer and the DCE is the modem or other communications device. RS-232 pin-outs for IBM compatible computers are shown below. There are two configurations that are typically used: one for a 9-pin connector and the other for a 25-pin connector.
Page 34
Fig. Operating Characteristics Dept of Biomedical Engineering KBN College of Engineering. Page 36
Fig1
Comparator circuits
Figure 1 shows a basic comparator circuit for converting low level analog signals to a high level digital output. The output pull-up resistor should be chosen high enough so as to avoid excessive power dissipation yet low enough to supply enough drive to switch whatever load circuitry is used on the comparator output. Resistors r1 and r2 are used to set the input threshold trip voltage (vref) at any value desired within the input common mode range of the comparator.
Page 39
Page 40
;--------------------------------------------------------------------------------------------------------; AUTHOR : e - logic co. ; COUNTRY : INDIA ; CODE: LCD INTERFACE IN 4BIT MODE ; CPU : AT89C51@11.0592MHZ ;---------------------------------------------------------------------------------------------------------
$MOD51 ;--------------------------------------------------------------------------------------------------------; CONSTANT DECLARATIONS ;--------------------------------------------------------------------------------------------------------COUNT L1 L2 L3 (94 - A7) L4 NUL MX D_OF ICR CD EQU EQU EQU EQU EQU 0CH 06H 01H 10011000B 10011001B 00H 0FFH P2 OUT.0 OUT.1 OUT.2 OUT.3 Page 41 ;WRITE ;READ EQU EQU EQU EQU EQU 00H 38H 3 80H 0C0H 94H 0D4H
; ;(D4 - E7)
WTCMD EQU DATA COMMAND NOTE 3 RDCMD EQU DATA COMMAND NOTE 3 DCLB DCUB OUT LOD1 LOD2 LOD3 LOD4 EQU EQU EQU BIT BIT BIT BIT
DATA P0 ;DEFINE LCD DATA PORT ON PORT 1 EQU BIT ;SDA=PIN5 BIT ;SCL=PIN6 P3 I_O.2 I_O.3
;--------------------------------------------------------------------------------------------------------DSEG AT 20H FLAG: MOTORCONDITION P_DATA: ASCI_RSULT: RAM_ADDR: VAR: VAR1: DS BIT DS DS DS DS DS 1 FLAG.0 1 3 3 1 1
;--------------------------------------------------------------------------------------------------------; BY PASS INTERRUPT VECTOR ;--------------------------------------------------------------------------------------------------------CSEG AT 00H LJMP LCD4_MAIN ;--------------------------------------------------------------------------------------------------------; MAIN LINE CODE ;--------------------------------------------------------------------------------------------------------CSEG AT 30H Dept of Biomedical Engineering KBN College of Engineering. Page 42
MOV A, #CD ACALL COMMAND MOV A, #L1 ACALL COMMAND MOV A, #'X' ACALL DATA_WR MOV A, #'-' ACALL DATA_WR MOV A, #'>' ACALL DATA_WR MOV A, #L2 ACALL COMMAND MOV A, #'Y' ACALL DATA_WR MOV A, #'-' ACALL DATA_WR Dept of Biomedical Engineering KBN College of Engineering.
Page 43
MOV A,#05H ;SLEEP COUNT CALL WRT ;SEND IT MOV A, #11111111B ;GET DATA CALL WRT ;SEND IT CALL STOP ;SEND STOP CONDITION CALL DELAY_16MS ;---------------------------------------------------------------------------------------------------------------------MOV A,#WTCMD ;LOAD WRITE COMMAND CALL WR_ST ;SEND IT MOV A,#06H ;INTERRUPT SETUP CALL WRT ;SEND IT MOV A, #00010000B ;GET DATA CALL WRT ;SEND IT CALL STOP ;SEND STOP CONDITION CALL DELAY_16MS ;---------------------------------------------------------------------------------------------------------------------MOV A,#WTCMD ;LOAD WRITE COMMAND CALL WR_ST ;SEND IT MOV A,#07H ;MODE OF OPERATION CALL WRT ;SEND IT MOV A, #00000001B ;GET DATA CALL WRT ;SEND IT CALL STOP ;SEND STOP CONDITION CALL DELAY_16MS ;---------------------------------------------------------------------------------------------------------------------MOV A,#WTCMD ;LOAD WRITE COMMAND CALL WR_ST ;SEND IT
Page 44
;---------------------------------------------------------------------------------------------------------------------;---------------------------------------------------------------------------------------------------------------------AGAIN: MOV A,#WTCMD ;LOAD WRITE COMMAND CALL WR_ST ;SEND IT MOV CALL A,#00H WRT ;SAMPLES PER SECONDS ;SEND IT ;GET DATA BYTE
Page 45
;################################################################### CTT: MOV A,#WTCMD CALL WR_ST MOV A,#01H ;LOAD WRITE COMMAND ;SEND IT ;SAMPLES PER SECONDS Page 46
CALL CREAD MOV A, R1 MOV VAR1, A CALL CONV MOV A, #L1+3 CALL COMMAND CALL TEMP
CALL STOP ;SEND STOP CONDITION ;------------------------------------------------------------------------------------------------------------------MOV A, VAR1 CLR C CJNE A, #8, NEXT12 SJMP ENDD1 NEXT12: JNC HY1 ;A > VALUE SJMP ENDD1 ;------------------------------------------------------------------------------------------------------------------HY1: CLR C CJNE A, #20, NEXT22 SJMP FORWARD_STEP1 NEXT22: JC FORWARD_STEP1 ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + CLR C CJNE A, #54, NEXT13 SJMP ENDD1 NEXT13: JNC ENDD1 ;A > VALUE SJMP REVERSE_STEP1 ;--------------------------------------------------------------------------------------------------------------------ENDD1: CLR MT1 CLR MT11 CLR MT2 CLR MT22 JMP AGAIN
Page 47
;--------------------------------------------------------------------------------------------------------; DATA WRITE ;--------------------------------------------------------------------------------------------------------Dept of Biomedical Engineering KBN College of Engineering. Page 49
RET ;--------------------------------------------------------------------------------------------------------; CONVERTING DEC DIGITS TO DISPLAYABLE ASCII DIGITS ;--------------------------------------------------------------------------------------------------------DEC_ASCI_CONV: MOV MOV MOV MOV ORL MOV INC INC DJNZ R0, #RAM_ADDR R1, #ASCI_RSULT R2, #COUNT A, @R0 A, #30H @R1, A R0 R1 R2, H2 Page 50
H2:
RET ;--------------------------------------------------------------------------------------------------------; BUSY FLAG CHECK ;--------------------------------------------------------------------------------------------------------READY: PUSH 00 PUSH 01 MOV R0, #30 D_LOOP1: MOV R1, #255 D_LOOP2: DJNZ R1, D_LOOP2 DJNZ R0, D_LOOP1 POP 01 POP 00 RET ;--------------------------------------------------------------------------------------------------------; DATA DISPLY ;--------------------------------------------------------------------------------------------------------DSP_MSG: CLR A ;A=0 MOVC A, @A+DPTR JZ OVR ACALL DATA_WR INC DPTR SJMP DSP_MSG OVR: RET
;--------------------------------------------------------------------------------------------------------; DELAY SUBRUTIEN ;--------------------------------------------------------------------------------------------------------DELAY_8US: NOP NOP Dept of Biomedical Engineering KBN College of Engineering. Page 51
; ;
Page 53
;CLOCK LOW ;DECREMENT COUNTER ;TURN PIN INTO INPUT ;NOTE 1 ;CLOCK ACK ;NOTE 1 ;NOTE 1 Page 54
SCL RET ; ************************************************************************** ************** STOP: CLR NOP NOP NOP NOP NOP NOP SETB NOP NOP NOP NOP NOP NOP SETB SCL SDA ;STOP CONDITION SET DATA LOW ;NOTE 1 ;NOTE 1 ;SET CLOCK HI ;NOTE 1 ;NOTE 1
SDA ;SET DATA HIGH RET ; ************************************************************************** ************** ; THIS ROUTINE READS A BYTE OF DATA FROM EEPROM ; FROM EEPROM CURRENT ADDRESS POINTER. ; RETURNS THE DATA BYTE IN R1 ; ************************************************************************** ************** CREAD: MOV A,#RDCMD ;LOAD READ COMMAND CALL WR_ST ;SEND IT CALL IN ;READ DATA MOV R1,A ;STORE DATA CALL STOP ;SEND STOP CONDITION RET ; ************************************************************************** ************* ; THIS ROUTINE READS IN A BYTE FROM THE EEPROM ; AND STORES IT IN THE ACCUMULATOR Dept of Biomedical Engineering KBN College of Engineering. Page 55
SCL C SDA,INL1 C A
;CLOCK HIGH ;CLEAR CARRY ;JUMP IF DATA = 0 ;SET CARRY IF DATA = 1 ;ROTATE DATA INTO
INL1: RLC ACCUMULATOR DJNZ R2,INLP ;DECREMENT COUNTER CLR SCL ;CLOCK LOW RET ; ************************************************************************** ************** ; THIS ROUTINE TEST FOR WRITE DONE CONDITION ; BY TESTING FOR AN ACK. ; THIS ROUTINE CAN BE RUN AS SOON AS A STOP CONDITION ; HAS BEEN GENERATED AFTER THE LAST DATA BYTE HAS BEEN SENT ; TO THE EEPROM. THE ROUTINE LOOPS UNTIL AN ACK IS RECEIVED FROM ; THE EEPROM. NO ACK WILL BE RECEIVED UNTIL THE EEPROM IS DONE WITH ; THE WRITE OPERATION. ; ************************************************************************** ************** ACKTST: MOV A,#WTCMD ;LOAD WRITE COMMAND TO SEND ADDRESS MOV R2,#8 ;LOOP COUNT -- EQUAL TO BIT COUNT CLR SDA ;START CONDITION -- DATA = 0 NOP ;NOTE 1 NOP NOP NOP ;NOTE 1 Dept of Biomedical Engineering KBN College of Engineering. Page 56
;CLOCK LOW ;DECREMENT COUNTER ;TURN PIN INTO INPUT ;NOTE 1 ;CLOCK ACK ;NOTE 1 ;NOTE 1 ;EXIT IF ACK (WRITE DONE) ;START OVER ;CLOCK LOW ;DATA LOW ;NOTE 1 ;NOTE 1 ;CLOCK HIGH ;NOTE 1
SDA
RET ;--------------------------------------------------------------------------------------------------------------DELAY1:MOV R0,#0FFH INLOP1: MOV R1,#0FFH DJNZ R1,$ DJNZ R0,INLOP1 RET ;--------------------------------------------------------------------------------------------------------------DELAY4: INLO2: INLO1: MOV MOV MOV DJNZ DJNZ DJNZ R5,#12H R0,#0FFH R1,#0FFH R1,$ R0,INLO1 R5,INLO2
RET ;--------------------------------------------------------------------------------------------------------; ASCII LOOK-UP TABLE ;--------------------------------------------------------------------------------------------------------Dept of Biomedical Engineering KBN College of Engineering. Page 58
TABLE:
DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB
00001000B, '8' 00000111B, '7' 00000110B, '6' 00000101B, '5' 00000100B, '4' 00000011B, '3' 00000010B, '2' 00000001B, '1' 00000000B, '0' 00111111B, 'H' 00111110B, 'G' 00111101B, 'F' 00111100B, 'E' 00111011B, 'D' 00111010B, 'C' 00111001B, 'B' 00111000B, 'A'
END
Page 59
REFERENCES [1] Ferrol R. Blackmon,Computer Science Department,Georgia State University,Atlanta, Georgia, USA 30303 Target Acquisition by a Hands-free Wireless Tilt Mouse 2010 [2] Ferrol R. Blackmon, Michael Weeks, Wireless Tilt Mouse: Providing Mouse-type Access for Computer Users with Spinal Cord Injuries or Disabilities, 1st International Conference on Pervasive Technologies Related to Assistive Environments (PETRA08), International Workshop on Ambient Assistive Technologies for Intelligent Healthcare Services (AASTIH08), Athens, Greece, ACM International Conference Proceed- ings Series, July, 2008. [3] Adriane B. Randolph,Individual-Technology Fit: Matching Individual Characteristics and Features of Biometric Interface Technologies with Performance, Georgia State University, 2007, Doctoral Dissertation. [4] Julien Kronegg, Svyatoslav Voloshynovskiy, Thierry Pun, Brain- Computer Interface Model: Upper-capacity bound, Signal-tonoise Ratio Estimation, and Optimal Number of Symbols, Tech. Rep. 04.03, Computer Vision and Multimedia Laboratory, Computing Dept of Biomedical Engineering KBN College of Engineering. Page 60
Page 61
Websites
1. Www.epanaroma.com 2. Www.national semiconductor.com
[1] ucis specification of the scada/ems and its communications system, utility consulting international, cupertino, california, usa [2] arevas functional specification design documents and users manuals, areva, france
Page 62