This action might not be possible to undo. Are you sure you want to continue?
The advancement of technology and the evolution of the information home appliances, such as TVs, air conditioners, sound and stereo systems, wireless phones, and so forth, the remote controllers dazzling our eyes still have not reached a unified model or style. In view of this fact, we propose an environment controller combining the Bluetooth technology. Along with Bluetooth transmission via radio wave, we can break through those space barriers existing in our housing structure comprising multiple separating objects. The system design is as follows: microcontroller and Bluetooth module. Bluetooth is a wireless technology that is composed of hardware, software, and interoperability requirements. Bluetooth is “A specification for short-range radio links between mobile computers, mobile phones, digital cameras, and other portable devices.” It has been adopted not only by all major players in the telecom, computer and home entertainment industry, but also in such diverse areas as the automotive industry, health care, automation, and toy industries Bluetooth communication pattern comes with excellent feature of
robust(strong) digital communication. This can enable variable bit rate for desired purposes like voice or data. We are opting for data transmission in the order of 9600 bps which exchange ASCII values.
1. MICROCONTROLLER 89C51
1.1 Introduction of microcontroller:
Fig: 1.1 Basic block diagram of Microcontroller
1.2 Basic microcontroller Block Diagram:
There are three busses involved in accessing memory: Address bus Data bus Control bus
1.3 Read Cycle:
1. CPU places address on address bus. 2. Control signals memory - address on address bus is valid 3. Memory chip fetches data from location specified by the address and places on the data bus 4. Control signals CPU - data on data bus is valid 5. CPU takes data from data bus
1.4 Write Cycle:
1. CPU places address on address bus 2. Control signals memory - address on address bus is valid. 3. CPU places data on the data bus 4. Control signals memory - data on data bus is valid 5. Memory chip takes data from data bus and places it in the Location specified by the address
1.5 Basic difference between microprocessor and Microcontroller:
A microprocessor system consists of a microprocessor with memory, input ports and output ports connected to it externally. A microcontroller is a single chip containing a microprocessor, memory, input ports and output ports. Since all four blocks reside on the one chip, a microcontroller is much faster than a microprocessor system
We can split memory into two types; RAM and ROM. RAM stands for random access memory. The are two features of RAM which distinguish it from ROM RAM is read/write - data can be written to and read from RAM. RAM is volatile - data is lost once the power to a RAM chip is lost Random access refers to the fact that data from any location in the memory chip is accessible at any time (you simply put the desired address on the address bus). ROM stands for read only memory. As with RAM, it is random access but it differs from RAM in two ways: ROM, as the name suggests, is read only. You cannot write to a ROM chip. A ROM chip must be programmed, but once programmed, it cannot be (easily) changed ROM is non-volatile - when power is removed from the chip data is not lost. There are many types of ROM available; PROM, EPROM, EEPROM and Flash are the most common.
1.7 Micro controller 89C51:
The 8051 is just one of the MCS-51 family of microcontrollers developed by intel. The design of each of the MCS-51 microcontrollers are more or less the same. The differences between each member of the family is the amount of on-chip memory and the number of timers. Phillips 89C51 contains a non-volatile FLASH program memory that is parallel programmable. Phillips 89C51, 8-bit Micro controller from MHS-51 Intel family, with 4K bytes of flash and 128 bytes of internal RAM had been used. It has a 40-pin configuration and other components of interfaced to its ports. The Micro controller takes input from the external sources and routes them to the appropriate devices as programmed in it.
1.8 8051 Micro Controller Architecture:
Fig: 1.2 Architecture of Microcontroller 8051
multiplication and division. is used as a general register to accumulate the results of a large number of instructions. Another SFR allows a program to read or write to the 8051s serial port. The accumulator has several exclusive functions such as rotate. The Program Counter is special in that there is no way to directly modify its value. subtraction. parity computation. four SFRs permit access to the 8051s 32 input/output lines.1. The accumulator can be the source or destination register for logical operations.2 Program Counter: The program counter points to the address of the next instruction to be executed. 1. It can hold an 8-bit (1-byte) value and is the most versatile register. Accumulator holds a source of operand and stores the result of the arithmetic operations such as addition. Since some instructions require 2 or 3 bytes the PC will be incremented by 2 or 3 in these cases. When the 8051 is initialized PC always starts at 0000h and is incremented each time an instruction is executed. control and access timers. program may inspect and/or change the operating mode of the 8051 by manipulating the values of the 8051's Special Function Registers. the microcontroller has due to the shear number of instructions that make use of the accumulator. The SFR is part of Internal Memory. the program counter is implemented to point to the next instruction. and so on. sign acceptor etc. as its name suggests. The Microcontroller can access program addresses 0000 to FFFFH. testing for 0. PC is always incremented by one. As the CPU fetches the opcode from the program ROM.9 Special Function Register (SFR) Memory: Special Function Registers (SFRs) are areas of memory that control specific functionality of the 8051 processor. a total of 64K bytes of code.8. 1.8.1 Accumulator: The Accumulator. 6 . For example. Other SFRs allow the user to set the serial baud rate. and configure the 8051s interrupt system.
10 The Diagram of the SFR: Fig: 1.The program may inspect and/or change the operating mode of the 8051 by manipulating the values of the 8051's Special Function Registers. The 8051 has four I/O ports of 8 bits. The only difference is that Internal RAM is from address 00h through 7Fh whereas SFR registers exist in the address range of 80h through FFh Each SFR has an address (80h through FFh) and a name. the SFRs that have a blue background are SFRs related to the I/O ports. All other addresses in the SFR range (80h through FFh) are considered invalid. Whether a given I/O line is high or low and the value read from the line are controlled by the SFRs in green. 7 .11 SFR Types: As mentioned in the chart itself. 1. 1. for a total of 32 I/O lines.3 Memory Diagrams of Special Function Registers Although the address range of 80h through FFh offer 128 possible addresses. Writing to or reading from these registers may produce undefined values or behavior. SFRs are accessed as if they were normal Internal RAM. there are only 21 SFRs in a standard 8051.
the program may read or write to the serial port using the SBUF register. bit 7 is pin P1. Bit-Addressable): This is input/output port 0.7. For example. 1. If you push a value onto the stack. Address 81h): This is the stack pointer of the microcontroller. bit 7 is pin P0. Addresses 98h. For example. Bit-Addressable): 8 .12. SCON controls the serial port. SP (Stack Pointer.12. For example. For example. That is to say. once the serial port has been configured using SCON.12 SFR Descriptions: P0 (Port 0. LCALL. Bit-Addressable): This is input/output port 1. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to a low level.0. with green backgrounds. if SP holds the value 07h. Each bit of this SFR corresponds to one of the pins on the microcontroller. Address 80h. This SFR indicates where the next value to be taken from the stack will be read from in Internal RAM. TCON controls the timers. such as PUSH. This SFR is modified by all instructions which modify the stack." These SFRs can be thought of as auxiliary SFRs in the sense that they don't directly configure the 8051 but obviously the 8051 cannot operate without them. bit 0 of port 0 is pin P0. Address 90h. POP. are "other SFRs. 1. RET. the value will be written to the address of SP + 1.6 P1 (Port 1.7. and whenever interrupts are provoked by the microcontroller. Each bit of this SFR corresponds to one of the pins on the microcontroller.0. 1. The remaining SFRs. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to a low level.The SFRs with yellow background are SFRs which in some way control the operation or the configuration of some aspect of the 8051. RETI. bit 0 of port 1 is pin P1. a PUSH instruction will push the value onto the stack at address 08h.7 SCON (Serial Control.
1 stop bit. TB 8 not widely used. 1 start bit. This SFR controls the baud rate of the serial port. Set by hardware at the beginning of the stop bit in received interrupts flag. variable baud rate Table 1. 1 stop bit. Bit addressable.6 Format of Serial Port Control Register (SCON) REN set or cleared by software to enable or disable reception. Set by hardware halfway through the stop bit time in mode 1. It must be cleared by software. and also contains flags that are set when a byte is successfully sent or received. 1 stop bit. 1 start bit.2: Operating modes of SCON 1. RB 8 not widely used. Addresses A8h): 9 . fixed baud rate 9. whether the serial port is activated to receive data.bit data. 8H Fig: 1. It must be cleared by software.13 IE (Interrupt Enable.The Serial Control SFR is used to configure the behavior of the 8051's onboard serial port. mode 1.bit data. 1 start bit. TI RI transmits interrupt flag. variable baud rate 9. SM0 0 0 1 1 SM1 0 1 0 1 Serial mode 0 Synchronous mode 8-bit data.
If EA = 1. The Interrupt Enable SFR is used to enable and disable specific interrupts. where as the highest bit is used to enable or disable ALL interrupts.13. Fig: 1.1 Six interrupts in the 89C51: 1.A single microcontroller can serve several devices. Reset. Two interrupts are set aside for hardware external hardware interrupts.7 Format of Interrupt Enable (IE) Special Function Register EA disable all interrupts. now interrupt is acknowledged. Serial Communications has a single interrupt (receive and transfer). If EA = 0. the microcontroller interrupts whatever it is doing and serves the device. whenever any device needs its service. if the high bit of IE is 0 all interrupts are disabled regardless of whether an individual interrupt is enabled by setting a lower bit. ---ET2 ES Not implemented. Thus. Upon receiving an interrupt signal. In the interrupt method. 3. 1. 2. The advantageous of interrupts is that the microcontroller can serve many devices based on the priority assigned to it. The low 7 bits of the SFR are used to enable/disable the specific interrupts. The program associated with the interrupt is called the interrupt service routine (ISR). 10 . each interrupt source is individually enabled or disabled by setting or clearing its enable a lap bit. 4. enables or disables the serial port interrupt. Two interrupts are set aside for the timers. reserved for future use. enables or disables timer 2 overflow or capturer interrupt. the device notifies the microcontroller by sending it an interrupt signal.
Address B0h.15 Other SFRs: The chart above is a summary of all the SFRs that exist in a standard 8051.14 P3 (Port 3. All derivative microcontrollers of the 8051 must support these basic SFRs in order to maintain compatibility with the underlying MSCS51 standard. enables or disables external interrupt 1.ET1 EX1 ET0 EX0 enables or disables timer 1 overflow interrupt.0. enables or disables external interrupt 0. 1. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to a low level. bit 7 is pin P3. Bit-Addressable): This is input/output port 3. For example. bit 0 of port 3 is pin P3. Each bit of this SFR corresponds to one of the pins on the microcontroller. enables or disables timer 0 overflow interrupt.7. 1. 11 .
0 and P1. Bringing this pin back to logical state zero starts the program anew as if the power had just been turned on. positive voltage impulse on this pin resets the MCU. 12 . Also. Pin 9: Reset Signal High logical state on this input halts the MCU and clears all the registers.Fig: 1.8 Pin Diagram of Phillips 89C51 Microcontroller Pin 1–8: (Port 1): Each of these pins can be used as either input or output according to your needs. pins 1 and 2 (P1. In another words.1) have special functions associated with Timer.
they all share highly similar structure.signal for reading from external RAM memory. If using other port to a same end.serial output for asynchronous communication or clock output for synchronous communication Pin 12: INT0 . avoid using Port 0.Depending on the device's purpose and environs. reset-upon-start circuit or a brown out reset circuit (covered in the previous chapter). Beside its role as universal I/O port. Port 3 is similar to Port 0. bear in mind that built-in resistors have relatively high values. the appropriate bit of register P3 needs to be set.input for interrupt 1 Pin 14: T0 .signal for writing to external (add-on) RAM memory Pin 17: RD . the pin in question has to be designated as input. each of these pins can be used as universal input or output. this pin is usually connected to the push-button.e. In order to use one of these functions.serial input for asynchronous communication or serial output for synchronous communication. each pin of Port 3 has an alternative function. As can be seen from the individual descriptions of the ports.From a hardware standpoint.clock input of counter 1 Pin 16: WR . i. Pin 11: TXD . For example: if utilizing port as output with high level (5V). each pin of Port 3 has an alternate function. as its pins cannot produce high logical level without an additional resistor connected to +5V. Pin 10:RXD .clock input of counter 0 Pin 15: T1 . you need to consider which task should be assigned to which port. The image shows one simple circuit for safe reset upon starting the controller.input for interrupt 0 Pin 13: INT1 . However. However. It is utilized in situations when power fails to reach its optimal voltage. producing the currents limited to few hundreds of amperes as pin output. Pin 10-17: Port 3 as with Port 1. 13 .
When external memory is used. manufacturers recommend using somewhat higher capacitances (about 47 puffs). addresses A8 – A15. In this way. memory is smaller than 64kB). New Mucus works at frequencies from 0Hz to 50MHz+. data from port can be multiplexed and the port simultaneously used for transferring both addresses and data. Of the external memory. the rest of the unused bits are not available as input/output. i. Capacitances within the oscillator mechanism (see the image) are not critical and are normally about 30pF. memorizes the state of port P0 upon receiving a signal from ALE pin. 14 . Instead of a quartz crystal.e. Quartz crystal controlling the frequency commonly connects to these pins.Pin 18-19: X2 and X1: Input and output of internal oscillator. miniature ceramic resonators can be used for dictating the pace. Pin 29: PSEN: MCU activates this bit (brings to low state) upon each reading of byte (instruction) from program memory. Otherwise. this port contains the higher address byte (addresses A8–A15). this is the location of the higher address byte. pins of Port 2 act as universal input/output. by adding only one cheap integrated circuit. If external memory is present.28: Port 2 if external memory is not present. During the second part of the mechanical MCU cycle. Pin 20: GND: Ground Pin 21. and uses it as part of the address for memory chip. MCU sends the lower byte of the address register (addresses A0 – A7) to port P0 and activates the output ALE. It is important to note that in cases when not all the 8 bits are used for addressing the memory (i. signal on ALE is off. PSEN is directly connected to its control pins.e. similar to Port 0. In that case. and port P0 is used as Data Bus. External register (74HCT373 or 74HCT375 circuits are common). it can be used as universal I/O port. If external ROM is used for storing the program.
Conversely. This means that even if there is a program loaded in the MCU it will not be executed. Pin 32-39: Port 0 Similar to Port 2. pin of Port 0 acts as high impedance offering the infinite input resistance with no "inner" voltage.When designated as output. Unlike other ports. This seemingly insignificant change has the following consequences: When designated as input. external "pull up" resistor needs to be added for connecting the pin to the positive pole. 15 . Setting a port bit makes the pin act as high impedance.Pin 31: EA Bringing this pin to the logical state zero (mass) designates the ports P2 and P3 for transferring addresses regardless of the presence of the internal memory. bringing the pin to the high logical state causes the controller to use both memories. external "pull up" resistor needs to be added for connecting the pin to the positive pole. to get one (5V) on the output. Clearing a port bit grounds the appropriate pin on the case (0V). but the one from the external ROM will be used instead. Port 0 has two-fold role if external memory is used.Therefore. pin acts as "open drain". and then the external (if present). to get positive logic (5V) at output. Another feature of this port comes to play when it has been designated as output. first the internal. it contains the lower address byte (addresses A0-A7). Pin 40: VCC: Power +5V. otherwise all bits of the port are either input or output. Port 0 lacks the "pull up" resistor (resistor with +5V on one end). Therefore.
In order to use one of these functions. This provides the user with 32 I/O lines for connecting MCU to the environs.13 Input – Output (I/O) Ports: Every MCU from 8051 families has 4 I/O ports of 8 bits each. Port 3: Beside its role as universal I/O port. 16 . port1 is fully compatible with TTL circuits. Port 0: Port 0 has two-fold role. otherwise all bits of the port are either input or output. devoid of dual function characteristics for port 0. similar to port0. it contains the lower address byte (addresses A0-A7). Another feature of this port comes to play when it has been designated as output. Port 1: This is “true” I/O port. if external memory is used. the pin in question has to be designed as input. Otherwise it can be used as universal I/O port.1. each pin of port3 has an alternate function. Having the “pull up” resistor. Port 2: When external memory is used this port contains the higher addresses byte (addresses A8-A15).
For this reason. The8051 chips has built-in UART. when transmitter such as a keyboard may not always have data ready to send Asynchronous may also mean no explicit information about where data bits begin and end. For these reasons. The fact that in serial communication a single data line is used instead of the 8-bit data line of parallel communication makes it not only much cheaper but also makes it possible for two computers located in two different cities to communicate over the telephone. 17 . since long cables diminish and ever distort signals. which is 2. These chips are commonly referred to as UART (universal asynchronous discussed receiver-transmitter) and USART (universal synchronous -asynchronous receiver-transmitter). Serial data communication uses two methods. Transmitter can wait arbitrarily long between transmissions. It is mean possible to write software to use either of these methods. and 8-bit data path is expensive. such as printers. The synchronous method transfers a block of data at a time while the synchronous transfers a single byte at a time. This can work only if the cable is not too long. In some cases. it provides data in byte-sized chunks. Used. but the programs can be tedious and long. there are special IC chips made by many manufacturers for serial data communications. SERIAL COMMUNICATION When a microprocessor communicates with the outside world. serial communication is used for transferring data between two systems located at distances of hundreds of feet to millions of miles apart. Furthermore. the information is simply grabbed from the 8-bit data bus and presented to the 8-bit data bus of the printer. for example. a synchronous and asynchronous.1 Asynchronous Serial Communication and Data framing: Transmitter and receiver do not explicitly coordinate each data transmission.2.
it is difficult to make sense of the data unless the sender and receiver agree on a set of rules. In case of an odd parity bit the number of data bits of a book of including the parity bit. The parity bit is odd or even. 2. Baud rate is defined as the number of signal changes per second. such as ASCII characters. each character is placed in between start and stop bits. how many bits constitute the character. This is the called framing. 2. The start bit is always a 0 and the stop bit is 1. the data.3 Parity bit: In some systems in order to maintain data integrity. If the transmitter and receiver are using different speeds.4 Data transfer rate: The rate of data transfer in serial data communication is stated in bps (bits per second). The start bit is always one-bit but the stop bit can be one or two bits. This means that for each character we have a single parity bit in addition to start and stop bits. a protocol.2 Start and stop bits: A synchronous serial data communication is widely used for character orientation transmissions. 2. and when the data begins and ends. stop bit will not be received at the expected time problem is called framing error. on how the data is packed. 18 . are packed in between a start bit and a stop bits.The data coming in at the receiving end of the data line in a serial data transfer is all 0's and 1's. is even. If each signal change represents more than one bit. the baud rates as bps are the same. As far as the conductor wire is concerned. In the asynchronous method. In data framing for asynchronous communications. Another widely used terminology for bps is baud rate. bits per second may be greater than baud rate. the parity bit of the character byte is included in the data frame.
was set by the electronics industries association (EIA) in 1960. DCE (Data Communications Equipment) is a device.5 RS232 standards: Two allow compatibility among the data communication equipment made by various manufacturers. printer. RS 232 is the standard defined for the connection of "Data Terminal Equipment" (DTE) to "Data Communications Equipment" (DCE). and terminal. DTE (Data Terminal Equipment) is a generic term for an item which forms part of the "information processing" portions of a system. an interfacing standard called RS232.6 Interface for DTE/DCE Connection: Fig: 2. which provides an interface between a DTE and a communications link. Examples are: computer.1 Interfacing between Data Terminal Equipment (DTE) and Data Communication Equipment (DCE) 19 .2. 2.
Clear to send. In RS 232. The RS 232 is not compatible with micro controllers. indicates to the DTE that the modem is present and turned on CD-. RXD---.Request to Send. 2. 20 . Max 232 IC chips are commonly referred to as line drivers.3. Serial bits are encoded and transmitted one at a time. Asynchronous characters can be sent at any time and bits are not individually synchronized. This is standard for transfer of characters across copper wire. MAX 232. Asynchronous communication. while a 0 bit is + 3 to + 25V which is called Space. indicates that this modem is receiving a signal from the remote modem. from DCE together with RTS DTE---. a 1 is represented by -3 to -25V which is called Mark. indicates to the modem that a DTE is Connected and enabled. from DTE CTS---.8.Carrier Detect. DSR--.All Signals Are “Ground Referenced” to in Pin 7 TXD.Data Terminal Ready. voltage converters such as Max 232are used.7 RS 232 Wiring and Connectors: Fig: 2.Data Set Ready.2 Pins of RS232 Serial Port RS-232 Defines Serial.Transmit and Receive Signal RTS---. To connect any RS 232 to a µc system. so a line driver converts the RS 232's signals to TTL voltage levels.
The assembler will produce an object file and a list file.3. Recent Windowsbased assemblers combine steps 2 through 4 into one step. Assemblers require a third step calling linking. A widely used editor is the MS-DOS EDIT program (or notepad in Windows). Notice that the editor must be able to produce an ASCII file. which comes with all Microsoft operating systems. 2. For many assemblers. 8051 trainers that have a monitor program use this ABS file. The assembler converts the instructions into machine code. The link program takes one or more objects files and produces an absolute object file with the extension "ABS". The "ASM "source file containing the program code is created in step 1 is fed to an 8051 assembler. assembled and made ready to run? The steps to create an executable assembly language program are outlined as follows. depending on which assembler you are using. Many excellent editors or word processors are available that can be used to create and/or edit the program. The extension for the object file is "OBJ "by the extension for the list file is "1ST ". This program comes with all 8051 assemblers. extension for the source file is used by an assembler in the next step. Next the "ABS "file is fed into a program called "OH "(Object to Hex Converter) which creates a file with extension "HEX "that these ready to burn into ROM. the next question is: how it is created. Check your assembler for the convention. 1. BASIC FORM OF ASSEMBLY LANGUAGE PROGRAM Now that the basic form of an assembly language program has been given. but the source file has the extension "ASM "or "SRC ". 4. 21 . the file names follow the usual DOS conventions. The "asm ". 3. First we use an editor to type in a program similar to program.
prj 22 . #200 R2. Select Project. #0ffH route: mov P1. A acall delay1msec cpl a mov P2. Save… from the program menu The first time you save the program a dialog box will popup and allow you to name your file and file type. New… from the program menu Type your assembly file.asm) means assembly language 4. Select File. a acall delay1msec sjmp route delay1msec: mov up: mov same: djnz djnz ret R3. up end 3.1 Evaluation of keil Software: 1. Save program with filename: xxxxx. After the program has started: Select File. New Project… from the program menu Give some project name: xxxx.asm The File type is mentioned at last (. same R3. Start the µVision Program 2. The following is an example of a toggle program. org 0H mov A. #250 R2.3.
Select your assembly file. Click on the Add button then close the Add dialog box. To set a breakpoint. Select Project. 8. 7. e. 5. Click on Save in your Project dialog box. Select File. Select Run. dScope debugger… from the program menu Select File. 3.2 Using the Keil dScope Debugger 1.dll from the drop down list box. 23 . You can also single step through you program or set break points at locations that you want the debugger to stop at.5. Click on stop when you are finished. Change the file type to HEX Select your hex file. You should now see the source code of the file typed in earlier Select Peripherals. Port 1. you can also select this directly. 7. I/O Ports from the program menu. Click on go to see the real time update of the I/O ports.g. Port 2 and Port 3 6. Hex Click OK 4. Make: Build Project from the program menu This creates the HEX file you need for the 8051 3. 6. load object file from the program menu. Click on the Add button A dialog-box appears. double click on the line. so that you can see the how output varies on ports. allowing you to add files to the project Change the file type to Assembly. 2. Select Port 0. Toggle. load CPU driver from the program menu The debug program will start a new session Choose the 8051.
1 LCD pin descriptions: LCD has 14 pins. The function of each pin is given shows the positions for various LCD. must refresh the LED. to keep the data displaying. LIQUID CRYSTAL DISPLAY [LCD] As in recent years the LCD is finding widespread use replacing LED this is due to the following reasons: Fig: 4. the CPU. Ease of programming for characters and graphics. 4. Incorporation refreshing controller into the LCD. VSS and VEE: While VCC and VSS provide + 5 V and ground respectively. 4. In contrast. which are limited to numbers and a few characters.4.2 VCC.1 Showing LCD Four Line Display The declining prices of LCD The ability to display numbers. VEE is used for controlling LCD contrast. This is in contrast to LED. 24 . there by the easy relieving the CPU of the task of refreshing the LCD. characters and graphics.
Fig: 4. the LCD is busy taking care of internal operations and will not accept any new information.5 E (Enable): The LCD to latch information presented to its data pins uses the enable pin. 4. 4. We also use RS= 0to check the busy flag bit to see if the LCD ready to receive. When data is supplied to data pins. When D7 =1.2 Showing a 20x4 Liquid Crystal Display 25 . The RS pin is used for their selection as follows. R/W=1 when reading. etc. the LCD is ready to receive new information.4. as follows: if R/w=1 and RS = 0.4 R/W (Read/Write): R/W input allows the user to write information into the LCD or read information from it. Is RS= 0. are used to send information to the LCD or read the contest of the LCD internal registers. if RS=1 the data register is selected.To display letters and numbers. Cursor at home. The busy flag isD7 and can be read when R/W=1 and RS= 0.3 RS (Register Select): There are two very important registers inside LCD. 4. allowing the user to send data to be displayed on the LCD. the instruction command code register is selected. allowing the user to send a command such as clear display. WhenD7=0. R/W=0 when writing. and numbers 0-9 to these pins while making RS=1. a high to low pulse must be applied to this pin in order for the LCD to latch in the data present at the data pins.6 D0-D7: The 8-bit data pins. a-z. This pulse must be a minimum of 450 ns wide. we send ASCII codes for the letters A-Z. D0-D7.
CODE 1 2 4 6 5 7 8 A C E F 10 14 18 1C 80 C0 38 COMMAND TO LCD INSTRUCTION Clear display screen Return home Decrement cursor (shift cursor to left) Increment cursor (shift cursor to right) Shift Display right Shift display left Display off. cursor off Display on.1 Showing Code to execute particular Instruction 26 . cursor blinking Display on. cursor on Display on. cursor off Display off. cursor blinking Shift cursor position to left Shift cursor position to right Shift the entire display to the left Shift the entire display to the right Force cursor to beginning of 1st line Force cursor to beginning of 2nd line 2 lines and 5x7 matrix Table: 4.
global specification defining the complete system from the radio right up to the application level. This band is reserved for general purpose usage of Industrial. Because numerous corporations are designing and producing vast range of telecom gadgets. Version 1. The Bluetooth specification is an open. Scientific and Medical applications. polluters of this shared spectrum.0 of the Bluetooth came into existence in 1994 when Ericsson Mobile Communication began its study for alternatives to replace the cable and this technology hit the market in 1999. Then they formed Bluetooth Special Interest Group(SIG) to define and promote Bluetooth specification with five key promoters: Ericsson Mobile Communications Intel Corp. plug into. No longer do people need to connect.4 GHz globally available license free band. enable or configure anything to anything else. IBM Corp. headsets and portable computers. It is not possible to get universal acceptance for a new technology developed by a single company particularly for blue tooth. BLUETOOTH PROFILE Bluetooth is low cost. Nokia Mobile Phones Bluetooth devices operate at 2. Toshiba Corp. install. Thus Bluetooth has to be very robust because many users. This study concluded with radio link as a better option than the optical communication like infrared because of its line of sight limitation. 27 . low power short-range radio technology originally developed as a cable replacement to connect devices such as mobile phone handsets.5.
It is the Master which initiates the transaction. The number of time slots among multiple devices is called Time Division Multiplexing. After sending a packet both devices has to jump another radio channel effectively which is called Frequency Hopping Spread Spectrum (FHSS). Because all Slaves use the Master’s clock and address.The operating band is divided into 1MHz spaced channels signaling data at 1 mega signals per second for the sake of obtaining maximum available bandwidth. which can calculate frequency hop sequence from a Bluetooth device address and a Bluetooth clock. The Master controls how the total available bandwidth is divided among the Slaves by deciding when and how often to communicate with each Slave. When Slaves connect to a Master. One Master can have maximum seven slaves thus it has to decide seven different Frequency Hoping Spectrums. which Slave has to follow. Bluetooth is mainly designed for low power radio frequency link available in the range of 10m. 20m and 100m. Technical robustness is not possible if the Bluetooth devices operate on the constant frequency. Each Bluetooth timeslot lasts for 625 micro seconds. 28 . Its modulation scheme is Frequency Shift Keying (FSK). Bluetooth devices can operate in two modes for data transfer using Bluetooth devices one has to act as Master and other as Slave. The Master controlling the frequency hop sequence. They then use this to calculate the frequency hop sequence. Most importantly Master decides the Frequency Hoping Spectrum. they are told the Bluetooth device address and clock of the Master. when devices are allowed to transmit. Bluetooth specification allows three different powers they are referred as three classes of Bluetooth devices. Generally Bluetooth devices hop for every packet or every 2 packet or every 5 packets. all are synchronized to the Master’s frequency hop sequence. and a Bluetooth clock. The base band part of the Bluetooth specification describes an algorithm. establishes the link with slave. Every Bluetooth device has a unique Bluetooth device address. Bluetooth devices has to jump to another frequency continuously within the available bandwidth.
Bluetooth device can play a role as a master or slave. It uses microwave frequency of about 2. 29 . Master tries to connect itself to other devices and slave is waiting to be connected from other devices. Inquiry scan mode is waiting for a packet of Inquiry from other Bluetooth device and Page scan mode is waiting for the packet of connection from other Bluetooth device. 5. Inquiry scan or Page scan mode.2 Applications: The kind of range one can get using Bluetooth again depends on the number of physical objects available in the surrounding area which always absorb the microwave frequency there by reducing the distance of propagation. Bluetooth enables us to work with verity of telephone devices such as Mobile cellular phone to Public Switched Telephone Network (PSTN) through access point .4GHz. which is composed of twelve hexadecimal digits which is used frequently while establishing the link among the Bluetooth devices.1 Bluetooth Communication: Bluetooth is the international standard of wireless communication. Mobile cellular phone to notebook PC Mobile cellular phone to headset Communication between laptop to palm top. But in real time applications we need to adopt satellite communication to have link with Bluetooth which will be again in microwave band. called BD (Bluetooth Device) address. A Bluetooth connection can always be made from pair of master and slave devices. A slave can be in two modes.5. The Bluetooth implemented in this application is belonging to Class 1 giving 100 meters radius.Bluetooth technology uses FHSS as a way to deal with undesired interference. Every Bluetooth device has its unique address.
Users can easily configure Parani-ESD by using a terminal program such as HyperTerminal and can use Bluetooth wireless communication without modifying user’s existing serial communication program. which is a technique. 30 . The Parani-ESD delivers better quality of communication than a standard RS232 cables. User friendly ParaniWizard and ParaniWIN are also provided for easy setup on Microsoft Windows. Parani-ESD can be configured and controlled by typical AT commands. Parani-ESD has a compact design and can be placed conveniently into devices or equipment. native to Bluetooth that allows the Parani-ESD minimize radio interference while decreasing the likelihood of over-air hijacking.5. In addition to the basic AT commands. Parani-ESD can communicate withother Bluetooth devices that support the Serial Port Profile. Its detachable antenna optimizes the quality and distance for wireless communications.3 BLUETOOTH MODULE Parani-ESD is a module device for wireless serial communication using Bluetooth technology that is international a standard for short range wireless communications. Parani-ESD also supports authentication and Bluetooth data encryption. Parani-ESD supports FHSS (Frequency Hopping Spread Spectrum). Parani-ESD lineup has several models with different communication ranges from 30m (Parani-ESD200/210) up to 100m (Parani-ESD100/110) for use with various applications. Parani-ESD provides some expanded AT commands for various functions.
1 The Panel Layout of Jig Board. Connect a power source to Jig Board for the Parani-ESD Series. Connect Jig Board for the Parani-ESD Series to a serial device.3 Connecting Parani-ESD to Jig Board: Connect the Parani-ESD Series to the Jig Board as shown below.3.2 Connecting the Hardware: This section describes how to connect the Parani-ESD Series to the Jig Board and the Jig Board to the serial device for initial testing. 5. 31 .3. 5.1 Pannel Layout: Fig: 5. Connect the Parani-ESD Series to the Jig Board.5.3.
Fig: 5.4 Connecting a Device to Jig Board 32 . Fig: 5.5 Connecting a Device to Jig Board: Connect the serial data cable between the Jig Board and the serial device.2 Connecting Parani-ESD to Jig Board 188.8.131.52 Connecting Power to Jig Board 5. supply power to the serial device attached to the Jig Board.4 Connecting Power to Jig Board: Connect the power jack to the power connector of the Jig Board for the ParaniESD Series using the DC power adapter or USB power cable that is included in the package. Fig: 5. If necessary.
RTS will be reenabled again to begin receiving data from the host when the buffer has created more room for more data. If the host sends more data when the buffer is full. When using hardware flow control. This data is saved temporarily in the internal buffer of ParaniESD and sent repeatedly until the transmission is completed packet by packet. In order to prevent this buffer overflow. This can mean a loss of data may occur. Fig: 6. the Parani-ESD clears the buffer to secure room for the next data when the buffer becomes full. As the transmission data becomes large. Parani-ESD disables RTS so that it stops receiving any further data from the host when the buffer becomes full.6. Parani-ESD works as follows. When hardware flow control is not being used. the use of hardware flow control is highly recommended. For large data transmissions.1 Table Showing Settings required for use of Serial Ports 6.1 Hardware Flow Control: Parani-ESD plugged into its host system transmits data from host to the other side Bluetooth device. 33 . When the radio transmission condition is not good enough to send data promptly. buffer overflow will make Parani-ESD malfunction consequently. it can cause a transmission delay. the possibility of data loss becomes greater. SERIAL PORTS The applicable settings for serial ports are as follows.
2 Pin Assignment: Fig: 6.6.3 Table Showing Description of each Pin in Parani-ESD200/210 34 .2 Assignment of Parani-ESD100/110 Fig: 6.
FlowControl OK Purpose: Description: The current Bluetooth settings are displayed including BD address.7. BLUETOOTH COMMANDS AT↵ : SD Response: Purpose : Description: Check if the connection to host equipment is operating normally.Status. Data Encryption. Mode.Encryp. OK. If not. AT+BTINFO?. The serial parameters of Parani-ESD must be same as those of host equipment. Device name. Display Bluetooth settings Mode Status Auth Encrypt = = = = MODE0/MODE1/MODE2/MODE3 STANDBY/PENDING/CONNECT 0/1 (Authentication is not activated when 0) 0/1 (Encryption is not activated when 0) HWFC/NoFC FlowControl = 35 . Check the connection status with host equipment. Authentication. and Hardware Flow Control.Operation mode. DeviceName.↵: SD Response: 112233445566. Auth. Operation status. the ESD will not respond or ‘ERROR’message will appear or an abnormal sequence of strings will appear.
3. When connection is made and released. This has the same effect as AT+BTSCAN. OK Wait for inquiry and connection from other Bluetooth ATD <bt address>↵ : SD Response: Purpose : Description : Parani-ESD saves the BD address of the Bluetooth device most recently connected to.AT+BTSCAN ↵: SD Response: Purpose: devices Description: This allows the inquiry and connection from the other Bluetooth devices. SD response will be ‘CONNECT’ with its BD address. When connection is made with other Bluetooth device. OK / DISCONNECT. SD response will display an ‘ERROR’. Release the current connection 36 . If it fails to make a connection.0. It takes about 30 seconds to detect an abnormal disconnection such as power off and moving out of service range. To convert the operation status to ‘Standby’ AT+BTCANCEL must be used. Connect to the last connected Bluetooth device ATH ↵ : SD Response: Purpose: Description: The current Bluetooth connection will be disconnected. the operation status is back to ‘Pending’. The operation status will be in ‘Pending’ after this command. OK/ ERROR.
1 Cross compiler: This tool is required to build the if user adopts high level language for his application development.8. IDE GVI application Cross compiler Assembler Simulator Debugger Linker Loader Fig: 8. 37 . Because of one is dealing with both hardware and software and vast comprehensibility the development process is very complex. This is given in the line diagram. SOFTWARE REQUIREMENTS In any embedded systems application development life cycle one has to adopt one of the finest hierarchical approach. This approach directly influences the development productivity. The IDE is user friendly software in which one can write the program and see its out come. The developers job becomes easy when necessary soft wares to carry out many phases of development.1 Classification of Integrated Development Environment (IDE) Integrated Development Environment is the first necessity. In this application Keil micro vision 2 IDE has been used. 8. Cross compiler converts source code into the instructions of the target controller. The IDE will be equipped with many other tools.
8. Since it is the programmers choice to go to high level languages Keil offers C51 as the cross compiler it compiles only Embedded C code not other like Embedded C++ and Embedded Java. Once the code is free from bugs it will be passed to liker. All debugger.The output of the cross compiler given to an assembler. It creates an absolute sequential code which is to be executed.2 Assembler: This tool takes instructions and converts into operation code of the target controller. liker and loader are the part of assembler software. In Keil we have A51 assembler to build our assembly language code.4 Linker: Linking operations like attaching starting address of a subroutine to the main program will be done by liker.6 Simulator: Once the code is ready then it is always not a good idea to dump into micro controller. 38 . 8. 8.5 Loader: It simply takes liked file and converts into hex code which can be downloaded into the micro controller. 8. First it has to be tested in our IDE itself. Assembler is the combination of debugger. This process is quite lengthy and carried out phase by phase.3 Debugger: As its name itself indicates it is for fixing the bugs that is all syntax errors from the code. 8. The tool provided by an IDE which shows an exact replica of micro controllers perception is nothing but our simulator. linker and loader.
Fig: 9.C.1 Relay Providing Isolation between two circuits 9.) switch contact and the common switch contact.2 How Relays Work In figure 2a the relay is off. as shown in the circuit diagram of figure 1.) switch contact and the 'common' switch contact. Fig: 9.O. RELAYS 9.9.2 Showing Mechanical Operation of Relay 39 . as shown in figure 2b. The metal arm is at its rest position and so there is contact between the Normally Closed (N. If a current is passed through the coil. the resulting magnetic field attracts the metal arm and there is now contact between the Normally Open (N. A relay consists of a coil which may be energised by the low-voltage circuit and one or more sets of switch contacts which may be connected to the high-voltage circuit.1 Introduction: One simple method of providing electrical isolation between two circuits is to place a relay between them.
9.3 The Latching Relay Circuit If a relay is connected as shown in figure 3. The only way to turn the relay off will then be to cut the power supply by pressing the Reset button (which must be a push-to-break type). Fig: 9.3 Showing The Latching Relay Circuit 40 . it will become 'latched' on when the coil is energised by pressing the Trigger button.
#PDV ACALL DISPLAY_DATA 41 . TO DISPLAY WELCOME TO ACALL LCD_CMD MOV DPTR.#84H .5 LCD_RW EQU P1.TO DISPLAY COLLEGE NAME ACALL LCD_CMD MOV DPTR.#99H .2 SW3 EQU P1.3 SW4 EQU P1.#COLL ACALL DISPLAY_DATA MOV A.1 SW2 EQU P1.10.6 LCD_EN EQU P1.TO DISPLAY PROJ DEV BY ACALL LCD_CMD MOV DPTR.#01H ACALL LCD_CMD MOV A.#0C3H .#WEL ACALL DISPLAY_DATA MOV A.TO DISPLAY COLLEGE PLACE ACALL LCD_CMD MOV DPTR. CODE PROGRAM FOR BLUETOOTH TRANSMITTER LCD_RS EQU P1.#PLACE ACALL DISPLAY_DATA ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC MOV A.4 ORG 00H LJMP MAIN ORG 0023H LJMP S_INT MAIN: ORG 100H CALL LCD_INIT MOV A.7 LCD_DATA EQU P0 SW1 EQU P1.#80H .
@R0 CJNE A.#40H MOV TMOD.#20H MOV SCON.TO DISPLAY MUSHTAQ NAME ACALL LCD_CMD MOV DPTR.#NAME3 ACALL DISPLAY_DATA ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC MOV A.#50H MOV TH1.#85H ACALL LCD_CMD MOV DPTR.#'O'.#94H .BT_NOTINIT MOV A.#NAME1 ACALL DISPLAY_DATA MOV A.TO DISPLAY ANAD NAME ACALL LCD_CMD MOV DPTR.#0D4H .#BTOK CALL DISPLAY_DATA CALL DELAY_1SEC CALL DELAY_1SEC 42 .#ATCMD ACALL TRANSMIT_DATA ACALL DELAY_1SEC MOV R0.#0C4H CALL LCD_CMD MOV DPTR.BT_NOTINIT INC R0 MOV A.#01H ACALL LCD_CMD MOV R0.MOV A.#90H SETB TR1 BACK: MOV A.#-3 MOV IE.#42H MOV A.#'K'.@R0 CJNE A.TO DISPLAY JUNAID NAME ACALL LCD_CMD MOV DPTR.#0C0H .#NAME2 ACALL DISPLAY_DATA MOV A.
#40H MOV A.#D1OFF ACALL DISPLAY_DATA MOV A.@R0 CALL LCD_DATAOUT ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC MOV A.@R0 CALL LCD_DATAOUT INC R0 MOV A.@R0 ACALL LCD_DATAOUT INC R0 DJNZ R7.MOV A.#0C3H ACALL LCD_CMD MOV R0.#01H ACALL LCD_CMD MOV A.#ATBT CALL TRANSMIT_DATA ACALL DELAY_1SEC MOV R7.#80H ACALL LCD_CMD MOV DPTR.#42H MOV A.#01H ACALL LCD_CMD MOV A.#0C0H ACALL LCD_CMD 43 .#40H MOV A.#42H MOV A.#12 MOV R0.#83H ACALL LCD_CMD MOV DPTR.#0C3H ACALL LCD_CMD BTADDR_LOOP: MOV A.#01H CALL LCD_CMD MOV R0.BTADDR_LOOP ACALL DELAY_1SEC ACALL DELAY_1SEC MOV R0.#83H ACALL LCD_CMD MOV DPTR.#ATBTSCAN CALL TRANSMIT_DATA CALL DELAY_1SEC MOV A.
#'1' MOV SBUF.D2_ON JNB SW4.#'2' MOV SBUF.D1_ON JNB SW2.A ACALL DELAY_1SEC MOV A.#D1OFF ACALL DISPLAY_DATA SJMP MAIN_LOOP MOV A.#D2OFF ACALL DISPLAY_DATA MAIN_LOOP: ACALL SWITCHES SJMP MAIN_LOOP BT_NOTINIT:MOV A.A ACALL DELAY_1SEC MOV A.#0C0H ACALL LCD_CMD MOV DPTR.#80H ACALL LCD_CMD MOV DPTR.A ACALL DELAY_1SEC MOV A.MOV DPTR.#0C4H ACALL LCD_CMD MOV DPTR.#D2ON ACALL DISPLAY_DATA SJMP MAIN_LOOP 44 D1_OFF: D2_ON: .D2_OFF RET /*----------------------------------------*/ D1_ON: MOV A.#BTNOTOK ACALL DISPLAY_DATA LJMP BACK /*---------------------------------------*/ SWITCHES: JNB SW1.#'3' MOV SBUF.#80H ACALL LCD_CMD MOV DPTR.#D1ON ACALL DISPLAY_DATA SJMP MAIN_LOOP MOV A.D1_OFF JNB SW3.
#'4' MOV SBUF.#D2OFF ACALL DISPLAY_DATA SJMP MAIN_LOOP /*----------------------------------------*/ /*SERIAL INTERRUPT*/ S_INT: JBC RI.#0C0H ACALL LCD_CMD MOV DPTR.#38H CALL LCD_CMD MOV A.#0CH CALL LCD_CMD MOV A.#30H CALL LCD_CMD MOV A.#01H CALL LCD_CMD MOV A.#06H CALL LCD_CMD RET 45 .TX RX: MOV A.SBUF MOV @R0.A ACALL DELAY_1SEC MOV A.A INC R0 RETI TX: RETI /*-----------------------------------------*/ /*LCD DISPLAY*/ DISPLAY_LCD: BACK1: CLR A MOVC A.RX JBC TI.D2_OFF: MOV A.@A+DPTR JZ EXIT1 CALL LCD_DATAOUT INC DPTR JMP BACK1 EXIT1: RET /*------------------------------------------*/ LCD_INIT: MOV A.
#250 HERE1: MOV R3.B SUBB A.#100 AGAIN3: DJNZ R5.#50 AGAIN1: MOV R5.A JZ EXIT MOV SBUF.A ACALL DELAY MOV A.#0DH JZ EXIT 46 .HERE DJNZ R2.AGAIN1 RET /*--------------------------------*/ /*DELAY OF 1 SECOND*/ DELAY_1SEC: MOV R1.A SETB LCD_RS CLR LCD_RW SETB LCD_EN NOP CLR LCD_EN RET LCD_DATAOUT: DELAY: MOV R4.#250 HERE: DJNZ R3.HERE1 DJNZ R1.#4 HERE2: MOV R2.HERE2 RET /*---------------------------------------*/ /*TO TRANSMIT DATA*/ TRANSMIT_DATA: CLR A MOVC A.A CLR LCD_RS CLR LCD_RW SETB LCD_EN NOP CLR LCD_EN RET CALL DELAY MOV LCD_DATA.AGAIN3 DJNZ R4.LCD_CMD: CALL DELAY MOV LCD_DATA.@A+DPTR MOV B.
S.0 ATBT: DB "AT+BTINFO?".0H WEL: DB "WELCOME TO".I.0H D2ON: DB "DEVICE2 ON ".0H PDV: DB "PROJ DEV BY:".0 ATBTSCAN: DB "AT+BTSCAN".T.0DH.0H D1OFF: DB "DEVICE1 OFF".0H END 47 .0DH.EXIT: MOV A.0H NAME3: DB "ANAND".@A+DPTR JZ EXIT2 ACALL LCD_DATAOUT INC DPTR JMP DISPLAY_DATA RET EXIT2: /*-----------------------------------------*/ /*DATA*/ ATCMD: BTOK: DB "AT".0H NAME2:DB "JUNAID".0H D2OFF: DB "DEVICE2 OFF".0H PLACE:DB "NALGONDA".R.0 D1ON: DB "DEVICE1 ON ".T".0H COLL: DB "S.B CALL LCD_DATAOUT INC DPTR JMP TRANSMIT_DATA RET /*----------------------------------------*/ /*DISPLAY OF DATA*/ DISPLAY_DATA: CLR A MOVC A.0H NAME1:DB "MUSHTAQ".0 BTNOTOK: DB "BT NOT OK".0 DB "BT OK".0DH.
4 LED1 EQU P2.7 LCD_DATA EQU P0 SW1 EQU P1.TO DISPLAY COLLEGE NAME ACALL LCD_CMD MOV DPTR.6 LCD_EN EQU P1.PROGRAM FOR BLUETOOTH RECIEVER LCD_RS EQU P1.#COLL ACALL DISPLAY_DATA MOV A.5 LCD_RW EQU P1.#WEL ACALL DISPLAY_DATA MOV A.#00H CALL LCD_INIT MOV A.#84H .1 SW2 EQU P1.1 ORG 00H LJMP MAIN ORG 0023H LJMP S_INT MAIN: ORG 100H CLR LED1 CLR LED2 MOV P2.#80H .#99H .0 LED2 EQU P2.TO DISPLAY COLLEGE PLACE ACALL LCD_CMD MOV DPTR.#PLACE ACALL DISPLAY_DATA ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC MOV A.TO DISPLAY PROJ DEV BY ACALL LCD_CMD 48 .3 SW4 EQU P1.TO DISPLAY WELCOME TO ACALL LCD_CMD MOV DPTR.#0C3H .2 SW3 EQU P1.#01H ACALL LCD_CMD MOV A.
#20H MOV SCON.TO DISPLAY ANAD NAME ACALL LCD_CMD MOV DPTR.#PDV ACALL DISPLAY_DATA MOV A.TO DISPLAY JUNAID NAME ACALL LCD_CMD MOV DPTR.#40H MOV TMOD.#'O'.#NAME2 ACALL DISPLAY_DATA MOV A.#90H SETB TR1 BACK: MOV A.#0C0H .@R0 CJNE A.#ATCMD ACALL TRANSMIT_DATA ACALL DELAY_1SEC MOV R0.#BTOK CALL DISPLAY_DATA CALL DELAY_1SEC CALL DELAY_1SEC 49 .#42H MOV A.BT_NOTINIT INC R0 MOV A.#'K'.#0C4H CALL LCD_CMD MOV DPTR.#50H MOV TH1.#85H ACALL LCD_CMD MOV DPTR.MOV DPTR.TO DISPLAY MUSHTAQ NAME ACALL LCD_CMD MOV DPTR.#-3 MOV IE.#01H ACALL LCD_CMD MOV R0.#NAME1 ACALL DISPLAY_DATA MOV A.#0D4H .#94H .BT_NOTINIT MOV A.#NAME3 ACALL DISPLAY_DATA ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC MOV A.@R0 CJNE A.
BTADDR_LOOP ACALL DELAY_1SEC ACALL DELAY_1SEC MOV R0.#83H ACALL LCD_CMD MOV DPTR.#DAIL CALL TRANSMIT_DATA CALL DELAY_1SEC MOV A.@R0 ACALL LCD_DATAOUT INC R0 DJNZ R7.MOV A.#80H ACALL LCD_CMD MOV DPTR.#40H MOV A.#40H MOV A.#42H MOV A.#0C3H ACALL LCD_CMD BTADDR_LOOP: MOV A.@R0 CALL LCD_DATAOUT ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC ACALL DELAY_1SEC MOV A.#01H ACALL LCD_CMD MOV A.#12 MOV R0.#0C0H 50 .#0C3H ACALL LCD_CMD MOV R0.#01H CALL LCD_CMD MOV R0.#ATBT CALL TRANSMIT_DATA ACALL DELAY_1SEC MOV R7.@R0 CALL LCD_DATAOUT INC R0 MOV A.#42H MOV A.#D1OFF ACALL DISPLAY_DATA MOV A.#01H ACALL LCD_CMD MOV DPTR.
#0C4H ACALL LCD_CMD MOV DPTR.#80H ACALL LCD_CMD MOV DPTR.NEXT2 SETB LED2 CALL DEVICE2ON SJMP MAIN_LOOP CJNE A.NEXT3 CLR LED2 CALL DEVICE2OFF SJMP MAIN_LOOP RET NEXT: NEXT1: NEXT2: NEXT3: /*----------------------------------------*/ DEVICE1ON: ACALL DELAY_1SEC MOV A.#40H ACALL CHECK SJMP MAIN_LOOP BT_NOTINIT: MOV A.NEXT1 CLR LED1 CALL DEVICE1OFF SJMP MAIN_LOOP CJNE A.#'4'.#'2'.#BTNOTOK ACALL DISPLAY_DATA LJMP BACK /*---------------------------------------*/ CHECK: CJNE A.NEXT SETB LED1 CALL DEVICE1ON SJMP MAIN_LOOP CJNE A.#'3'.#D2OFF ACALL DISPLAY_DATA MAIN_LOOP: MOV R0.ACALL LCD_CMD MOV DPTR.#'1'.#D1ON ACALL DISPLAY_DATA RET 51 .
TX MOV A.#80H ACALL LCD_CMD MOV DPTR.#0C0H ACALL LCD_CMD MOV DPTR.#D2OFF ACALL DISPLAY_DATA RET DEVICE2ON: DEVICE2OFF: /*----------------------------------------*/ /*SERIAL INTERRUPT*/ S_INT: RX: JBC RI.#D2ON ACALL DISPLAY_DATA RET ACALL DELAY_1SEC MOV A.SBUF MOV @R0.RX JBC TI.#D1OFF ACALL DISPLAY_DATA RET ACALL DELAY_1SEC MOV A.A INC R0 RETI RETI TX: /*-----------------------------------------*/ /*LCD DISPLAY*/ DISPLAY_LCD: BACK1: CLR A MOVC A.#0C0H ACALL LCD_CMD MOV DPTR.@A+DPTR JZ EXIT1 CALL LCD_DATAOUT INC DPTR JMP BACK1 EXIT1: RET /*------------------------------------------*/ 52 .DEVICE1OFF: ACALL DELAY_1SEC MOV A.
#30H CALL LCD_CMD MOV A.#50 MOV R5.#250 HERE1: MOV R3.#0CH CALL LCD_CMD MOV A.#100 DJNZ R5.A SETB LCD_RS CLR LCD_RW SETB LCD_EN NOP CLR LCD_EN RET DELAY: AGAIN1: AGAIN3: MOV R4.LCD_INIT: MOV A.HERE1 DJNZ R1.#38H CALL LCD_CMD MOV A.A CLR LCD_RS CLR LCD_RW SETB LCD_EN NOP CLR LCD_EN RET LCD_DATAOUT: CALL DELAY MOV LCD_DATA.AGAIN3 DJNZ R4.#06H CALL LCD_CMD RET LCD_CMD: CALL DELAY MOV LCD_DATA.#250 HERE: DJNZ R3.HERE2 RET 53 .HERE DJNZ R2.#4 HERE2: MOV R2.#01H CALL LCD_CMD MOV A.AGAIN1 RET /*--------------------------------*/ /*DELAY OF 1 SECOND*/ DELAY_1SEC: MOV R1.
0 ATBT: DB "AT+BTINFO?".0H D2ON: DB "DEVICE2 ON ".B CALL LCD_DATAOUT INC DPTR JMP TRANSMIT_DATA RET EXIT: /*----------------------------------------*/ /*DISPLAY OF DATA*/ DISPLAY_DATA: CLR A MOVC A.0DH.0DH.B SUBB A.0 DB "BT OK".A JZ EXIT MOV SBUF.".0H D1OFF: DB "DEVICE1 OFF".@A+DPTR MOV B.0H D2OFF: DB "DEVICE2 OFF".A ACALL DELAY MOV A.@A+DPTR JZ EXIT2 ACALL LCD_DATAOUT INC DPTR JMP DISPLAY_DATA RET EXIT2: /*-----------------------------------------*/ /*DATA*/ ATCMD: BTOK: DB "AT".0 D1ON: DB "DEVICE1 ON ".#0DH JZ EXIT MOV A.0 DAIL: DB "ATD00019505FF5D.0DH./*---------------------------------------*/ /*TO TRANSMIT DATA*/ TRANSMIT_DATA: CLR A MOVC A.0 BTNOTOK: DB "BT NOT OK".0H 54 .
0H PDV: DB "PROJ DEV BY:".0H NAME3: DB "ANAND".0H END 55 .S.0H NAME1:DB "MUSHTAQ".WEL: DB "WELCOME TO".I.0H PLACE:DB "NALGONDA".T.T".0H NAME2:DB "JUNAID".0H COLL: DB "S.R.
Bluetooth will be able to compete well with the performance of new emerging technologies. CONCLUSION In conclusion. If the technology itself continues to go unchallenged in the market. All the while they are keeping it backward compatible with the current version. Also there is a group called Radio2 that is working on the problems Bluetooth has with bandwidth. If the Radio2 group can significantly increase the bandwidth. They are currently on version 1. and also correct most of the connection setup issues. 56 . If this can be done. based on the evidence from this research that the Bluetooth technology is definitely a technology with valuable uses in today’s world.11. it will grab a large share of the wireless device market. Future Scope Bluetooth is also itself getting better. With the backing of all the companies that have put money into researching and developing Bluetooth products. The Bluetooth SIG (Special Interest Group) is always working on a new version of specifications. and connection setup issues.1. interference. significantly decrease the interference with other technologies. even though it possesses its drawbacks. there will certainly be a future for Bluetooth. it will be a extremely difficult obstacle for any emerging technology to overcome.
com www. • 8051 Microcontroller and Embedded systems using assembly & C by Muhammad Ali Mazidi. BIBLIOGRAPHY References • The 8051 Microcontroller Architecture. Websites • • • www.com 57 .projects.12. Programming & Applications by Kenneth J.org www.wikipedia. • Bluetooth – Connect without cables by Jennifer Bray and Charles F Sturman.Ayala.philips.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.