Вы находитесь на странице: 1из 27
WIRELESS COMPUTER PRESENTER WAN FAZLINI IDAYU BINTI WAN FAKARI This Report is submitted in Partial Fulfillment of Requirements for the Degree of Bachelor in Electronic Engineering (Computer Engineering) Fakulti ‘ejuruteraan Elektronik dan Kejuruteraan Komputer Universiti Teknikal Malaysia Melaka (UTeM) APRIL 2007 vii ABSTRACT Technology advancement has brought our life into the digital world. Digital control is incorporate in almost device. The wireless computer presenter is a part of control devices which is used to control Power Point Presentation. The project undertaken was to design and implement a Wireless Computer Presenter. This project is divided into two main subsystems, hardware and software. For hardware parts, consists of Peripheral interface Controller (PIC) and Bluetooth Module transceiver. While, for software parts consist C programming language. This thesis describes the process that was used to take a conceptual design and tum it into working reality. This device will have operation such as Slide Forward and Slide Back, Maximize and Minimize, Start and End the slide show with few additional operations. It basically assimilates from the remote control and Bluetooth technology. PIC is used in the main circuit where it is will programmed to control the operation of the presenter. The Bluetooth module is used for communication between the computer and the presenter. Apart from its advantage of transmitting data in distance, it is widely available in nowadays Personal Computer (PC) and laptop. The person who gives talk could walk around without any hindrance and change the slide whenever he or she wants. viii ABSTRAK Kemajuan teknologi membawa hidup kita ke arah dunia digital. Kawalan digital digabungkan pada semua peralatan. Penyampai Komputer Tanpa Wayar adalah sebahagian daripada peralatan kawalan yang digunakan untuk mengawal Persembahan adalah untuk mereka dan melaksanakan sebuah Power Point. Projek yang diambil Penyampai Komputer Tanpa Wayar Projek ini dibahagikan kepada dua subsistem, perkakasan dan aturcara. Bagi bahagian perkakas terdiri daripada Kawalan Antara Muka Periferal (PIC) dan penghantar-terima Modul Bluetooth. Manakala, bahagian aturcara terdiri daripada bahasa aturcara C. Setiap subsistem mengandungi metodologi yang melibatkan penyelidikan, pelaksanaan dan pengujian, Tesis ini menghuraikan tentang proses yang digunakan untuk menyampaikan konsep rekacipta dan menukarkan kepada dunia nyata. Perkakasan ini mempunyai operasi seperti slaid hadapan dan slaid belakang, memaksimum dan meminimum, mula dan menamatkan persembahan slaid dengan beberapa operasi tambahan. Secara asasnya, ia diasimilasikan daripada teknologi kawalan jauh dan modul Bluetooth. PIC digunakan sebagai litar utama dimana ia diprogram untuk mengawal operasi Penyampai. Modul Bluetooth digunakan untuk komunikasi antara komputer dan penyampai. Sebahagian daripada kelebihannya ia dapat ‘menghantar data yang jauh, ianya juga sudah tersedia pada komputer peribadi dan laptop. Seseorang yang memberi ucapan bolch berjalan di sekeliling tanpa gangguan dan menukarkan slaid di mana saja dia mahukan. CHAPTER I INTRODUCTION Today in the high technology world remote control technologies are widely utilized to facilitate the human. These not only happen in industrial sector but also happen in our day life. Electronic devices that can be controlled from some distance are one of the applications of this technology. Ten years ago, many electric and electronic devices such as television, CD player and radio have been remotely controlled. However, in today life, remote control also used for the presentation. For example, people who give a talk in presentation session need to walk around without any hindrance and change the slide away from PC or laptop. 1.1 PROJECT OVERVIEW The proposed project is to design a Wireless Computer Presenter for Power Point Presentation. This Wireless Presenter will have operation such as Slide Forward and Slide Back, Maximize and Minimize, Start and End the stide show with few additional operations. ‘The presenter circuits are designed based on Microchip’s Peripheral Interface Controller (PIC) microcontroller. Bluetooth communication is used in this project. Apart from its advantage of transmitting data in distance, it is widely available in nowadays PC or laptop. The presenter will also be equipped with infrared laser ide. pointer to point the 1.2 OBJECTIVES The objective of the project is to design a Wireless Computer Presenter for Microsoft Power Point Presentation. This device used Microchip’s Peripheral Interface Controller (PIC) microcontroller as the “brain” of the circuit and Bluetooth module as transceiver. The Bluetooth transmitting capability is also studied. 1.3 SCOPE OF THE PROJECT This final year project is basically the application on computer engineering. This project is divided into two part; C programming for PIC development and fabrication of piece of an electronics circuit. The entire operation of the presenter is controlled by Microchip PIC microcontroller. For software part, PIC compatible language is written and compiled using SourceBoost IDE version 6.40. Simulation of the entire circuit done using Proteus Version 6 Professional. For hardware section, transceiver circuit is fabricated which comprises of PIC microcontroller, Bluetooth module and other lump components. The circuit is fabricated on Printed Circuit Board (PCB). Proteus ARES Professional is used to draw circuit on PCB. Etching and soldering processes will also be exercised. Testing on complete design will be carried out to ensure the functionality of the presenter. 1.4 PROBLEM STATEMENT It is a problem when delivering a Power Point presentation when the presenter needs to stand next to the computer. Alternatively, there is might be another person controlling the computer while presenter is talking. This project is to alleviate the problem by designing a wireless remote that allows user to wirelessly control their 's Peripheral Interface Controller (PIC) presentation from a distance. A Microchi microcontroller will be used to control the operation of this remote. PIC is chosen as Microcontroller as it. It cheep and widely available in market. Meanwhile, Bluetooth is the latest technology in communication. It is capable to ‘transmit data further compare to infrared. Nowadays, many personal laptops already equipped with this module thus make this project possible to be utilized. At the end, this project is aimed to ease presentation session. The person who gives talk could walk around without any hindrance and change the slide whenever he or she wants. CHAPTER IL LITERATURE REVIEW 24. INTRODUCTION This chapter presents the theory and the concept that related with this project to yield the project using right method. The reason of this discussion is to clarify the perspective and method that have been used, so that this project can be studied and build according to the theory. This chapter is also as the reference to the available theory in resolving resolve the problem of the project. 2.2 INTRODUCTION OF MICROCONTROLLER Microcontrollers can be found in any products these days. For example modern washing machine in our house that consists of timer, button and LED contains a microcontroller. All moder cars also contain microcontroller. To understand how microcontroller works, we need to understand digital electronics. However, with the ing of microcontroller like PICI6F877A from Microchip, we can make electronic exis circuits work by writing programming code and download into microcontroller. C programming is one method to program the microcontroller to respond to what we wish, everything become so simple. A microcontroller is a small computer and it can only perform simple task [1]. Microcontroller consists of: Processor that executes programs. Processor execute program digitally. All instruction given to the processor should be in digital form, + Program Memory to store the program that has been compiled successfully by the compiler. ++ RAM (random-access memory) to store "variables." + Input Output (1/0) Port to connect to sensor, keypad, LED, Relay and so on. % Timer to count the time to execute some processes, 2.2.1 Microcontroller Specification The microcontroller is very brilliant and useful. This microcontroller is very easy to program and the price is also very cheap. Its cost is less than RM40, The good thing is that single unit can be purchased at that RM40 price. Unlike some other Integrated Circuit that must be bought at a minimum order quantity such 2s 1000 units or 2000 units or else you won't be able to purchase it. PICI6F877A microcontroller can be programmed and erased about 10 000 times [11]. If we are doing programming and downloading our code into the microcontroller 20 times a day, which means we can do that for 500 days which is more than a year. The erasing time is almost unnoticeable because once new program are loaded into the PIC, the old program will automatically be erased immediately. PICI6F877A already made with 368 bytes of Random Access Memory (RAM) inside it. The temporary variable storage that written in the program will be stored inside the RAM. It is not necessary to buy any external RAM because 256 bytes of EEPROM are available also inside this microcontroller. This is very useful to store information such as PIN Number, Serial Number and so on. Using EEPROM is very important because data stored inside EEPROM will be retained when power supply is turn off. RAM does not store data permanently. Data inside RAM is not retained when power supply is turned off, The size of program code that can be stored is about 8k words inside PICI6F877A Read Only Memory (ROM) is one word size is 14 bits. By using the free version of the CCS C compiler only 2k words of program can be written and compiled. Nevertheless, more than 2k to write of C program we have to purchase the original CCS C compiler and it cost less than 700 dollar [11]. ‘The crystal oscillator speed that can be connected to the PIC microcontroller is in the range of DC to 20Mhz. Normally 20Mhz oscillator will be used when using the CCS C Compiler. The 20 MHz crystal oscillator should be connected with about 22pF capacitor. There are 5 inpu/output ports on PIC microcontroller namely port A, port B, port C, port D and port E. Each port has different function. Most of them can be used as VO port. 2.3 SLEEP Figure 2 MICROCONTROLLER PIC16F877A, PIC16F87X The Oscillator Circuit Table 2.1 : PICI6F877A Microcontroller Specification RAM 368 EEPROM 256 bytes Flash Program Memory 8k words Operating Frequency DC to 20MHz | 1/0 port Port A,B.CD,E | PICI6F877A is a small piece of semiconductor integrated circuits (IC). The package type of these integrated circuits is DIP package. DIP stand for Dual Inline Package for semiconductor IC. This package is very easy to be soldered onto the stripboard. However using a DIP socket is much easier due to that this chip can be plugged and removed from the development board. Additional components that is needed to make this IC work are just a SV power supply adapter, a 20MHz crystal oscillator and 2 uni of 22pF capacitors. 8 rovrare roweera -—=H rower = Figure 2.2 : PICI6F877A [7] The Microcontroller PIC16F877 have 40 pins of input and output (IO) where it can be separated into 4 ports which are Port A, Port B, Port C and Port D. Port A have 6 pins; RAO, RAI, RA3, RA4, RAS and RAG, Port B have 8 pins; RBO, RBI, RB2, RB3, RB4, RBS, RB6 and RB7. Port C have 8 pins; RCO, RCI, RC2, RC3, RC4, RCS, RC6 and RC7. Port D have & pins; RDO, RDI, RD2, RD3, RD4, RDS, RD6 and RD7. 2.3.1 Pins Deseription Table 2.2 : Table of Pins Description [7] Pin name | Description OSCI/CLKIN Oscillator crystal input/external clock source input. OSC2/CLKOUT | Oscillator crystal output. Connects to crystal or resonator in crystal oscillator mode. In RC mode, the OSC2 pin outputs CLKOUT which has 1/4 the frequency of OSCI, and denotes the instruction eyele rate. MCLR/VPP ‘Master Clear (Reset) input or programming voltage input. This pin is an active low RESET to the device. PORTA isa bi-directional I/O port. | RAWANO | RAO can also be analog input0. RAVANI RAI can also be analog input! RAZAN2/VREF- | RA2 can also be analog input2 or negative analog reference voltage. RAXVAN3/VREF+ | RA3 can also be analog input3 or positive analog reference voltage. | RAG can also be the clock input to the Timer0 module. Output is | RA4/TOCKI . open drain type. = RAS can also be analog input or the slave select for the RAS/SS/AN4 : synchronous serial port. "| PORTB is a bi-directional 1/0 port. PORTB can be software Programmed for internal weak pull-up on all inputs. | RBO/ANT RBO can also be the external interrupt pin. RBI a ~ ‘RB2 - == ~ RB3/PGM RB3 can also be the low voltage programming input. RBA Interrupt-on-change pin. = RBS Interrupt-on-change pin. 7 Interrupt-on-change pin or In-Circuit Debugger pin. Serial ee pt ge p igger Pi programming clock. ~_| Interrupt-on-change pin or In-Circuit Debugger pin. Serial | RB7/PGD ipt " ge pl igger pI | programming data. ~ PORTC is a bi-directional /O port. ~ RCO can also be the Timer! oscillator output or Timerl clock | RCO/TIOSO/TICKI | | input. RCI can also be the Timerl oscillator input or Capture? RCU/TIOSVCCP2 | inpu/Compare2 output/PWM2 output. 10 RC2 can also be the Capture! input/Comparel output/ RCYCCPI | PWM1 output. RC3 can also be the synchronous serial clock input/output | RC3/SCK/SCL | for both SPI and I2C modes. ~ RC4 can also be the SPI Data In (SPI mode) or RC4Y/SDUSDA data I/O (12C mode). “RCS/SDO RCS can also be the SPI Data Out (SPI mode), RC6 can also be the USART Asynchronous Transmit or RCO/TXICK Synchronous Clock. . | RCT can also be the USART Asynchronous Receive or RCT/RX/DT Synchronous Data | RDO/PSPO — - | RDvpsPr RDY/PSP2 | RD3/PSP3 PORTD is a bi-directional 1/0 port or parallel slave port RD4/PSP4 when interfacing to a microprocessor bus. RDS/PSPS RD6/PSP6 RD7/PSP7 VSS Ground reference for logic and /O pins. VDD Positive supply for logic and I/O pins. nN 24 BLUETOOTH 2.4.1 Descriptive Overview Bluetooth radios operate in the unlicensed ISM band at 2.4 GHz. A frequency hop transceiver is applied to combat interference and fading. A shaped, binary FM modulation is applied to minimize transceiver complexity. A Time-Division Duplex scheme is used for full-duplex transmission. The RF specifications are fairly relaxed, allowing for low cost, low power implementations at the expense of range (< 10m ) and throughput (max IMb/s)[10]. The Bluetooth baseband protocol is a combination of circuit and packet switching. Slots can be reserved for synchronous packets. Each packet is transmitted ina different hop frequency. A packet nominally covers a single slot, but can be extended to cover up to five slots [10}. Bluetooth can support an asynchronous data channel, up to three simultaneous synchronous voice channels, or a channel that simultaneously supports asynchronous data and synchronous voice. Each voice channel supports 64 kb/s synchronous (voice) link, The asynchronous channel can support an asymmetric link of maximally 721 kb/s in either direction while permitting 57.6 kb/s in the retum direction, or a 432.6 kb/s symmetric link [8] In the Bluetooth network all units are peer units with identical hardware and software interfaces except a unique 48-bit address. At the start of a connection, the initializing unit is temporarily assigned as a master. This assignment is valid only during this connection. It is the master that initiates the connection and controls the traffic up to a maximum of seven units, defined as slaves in each piconet [8]. 12 2.4.2 The reason Bluetooth is Used in This Project There are several reasons of using Bluetooth such as:~ + Farther transmitting range = Ordinary RF or infrared radiation products are capable of transmitting wirelessly for about one meter distance while Bluetooth enabled products can provide at least ten meters of transmission distance (standard Class2). It has ‘more practical usage and fits better for circumstanced requirement in reality. + No line-of-sight restriction = While ordinary infrared light products need line-of sight, Bluetooth enabled products eliminate the restriction. Low-frequency signals that can penetrate objects are transmitted ubiquitously from Bluetooth products so that even there are blocks in environment (such as desks, chairs, books, folders, briefcases, glasses, dishes) they can still function normally without abruption. + Anti-interference capability - Utilizing frequency hopping technology that can probing data up to 1600 hops per second, Bluetooth devices can adjust transmission power according to external interference. In addition, the short preamble packet type ensures better data transmission result in confront with interference in a noisy environment proliferates with signal-sending sources (such as cellular phones, PHS, wireless LAN, RF, etc.) and maintain stable and rapid connection keeping ‘communication clear. + Low transmission power - The goal of Bluetooth technology is to provide individualized wireless peripherals; therefore, it has low transmission power. The average Bluetooth enabled cellular phones have transmitting power below ImW that means four 24.3 3 thousandth of average GMS cellular phones (about 0.25mW), one tenth of PHS. phones. Bluetooth Technology In [8], the Bluetooth technology was developed with the ultimate goal of replacing the conventional cable between devices. These are as follows: + 2.44 Size: The chip should be small in size, where it can be incorporated in compact mobile devices easily. Battery operated: It should be able to operate on batteries without any changes. Low power consumption: As the devices are battery operated, it should consume minimum power. Robust and simple: It should be as robust as cable connection or more simple enough for the users wherein no device configurations are necessary. Low cost: Bluetooth should cost no higher than a standard network cable, @ Bluetooth’ Figure 2.3 : The Trade Mark of Bluetooth™ Disadvantage of Using Infrared Compare to Bluetooth ‘The connection only works over very short distance of three feet (1 meter) or les Whereas infrared is intended for point-to-point links between two devices for simple data transfers and file synchronization, Bluetooth wireless technology was designed from the start to support both data and multiple voice channel over the range of 30 feet (10 meters). 14 + Infrared devices falling short are the one where Bluetooth devices excels and vice versa, + Limited range and angle (30 degrees or less) of infrared allow other users to perform a similar activity with ample security and no interference. + Speed of infrared does not offer a big speed advantages over the Bluetooth specification, 2.4.5 Bluetooth Operation and Connectivity Bluetooth operates on the unlicensed 2.4GHz ISM radio frequency (RF) band. The radio modem employs medium-rate frequency hopping (160 hops/see) to reduce the impact of jamming other systems (wireless LANs, microwave ovens etc.) and to comply with emission rules. The band is divided into 79-IMHz wide channels. Its radio channel is assumed to be a burst-error channel without time dispersion. Such a burst-error channel is good in between error burst and very bad during bursts. Thus, a combination of fast automatic retransmission query (ARQ) scheme and simple coding is employed, to increase the link robustness. Further, the frequency hopping used at the air interface also improves the jamming resistance. ‘The Bluetooth communication protocol assumes that one unit is acting as master, the calling unit, and all other participating units are slaves. A master together with its slaves (up to seven slaves are supported) form an ad hoc Piconet. A set of Bluetooth piconet is called a scatternet; the piconets in a scatternet do not need to be integrated in anyway. In 4 point-to-point communication, the master and the slave send and receive alternately to provide a full duplex transmission. In a point-to-multipoint situation, the master sends every other slot and the slaves all share the alternate time slots, The Master is responsible for distributing the channel capacity among the slaves and connections are formed by a direct call from the master to a slave. Table 2.3 : Bluetooth Specification Table [8] Padio frequency range [24 GHe band iISM band; Frequency spacing TMH Number of radio channels Output power 73 channels Tass 1 2odm (eam Duplex method TDD: Tine Divisron Duplex ‘Spread spectrum FHSS. Frequency Hopping Spread Spectrum Frequenos hopping bit rate] 1600 hops per second aaa tm Modulation method GrSKm=055 ‘Modulation bitrate T Mbps Voioe channel ak PCM Aa, u-Tave SD 1Continuous Yariatle Slope Datta Modu'atian Maximum data ‘Symmetric communication; 482 Gkbps, channel rate Asymmetric communication. 721kbps:56kbps| 2k ea 26921 Mester t t sive = = ehusee — ‘Aovess Code [ket He] Paytoad (72bit) ait (010 27450i) Figure 2.4 : Bluetooth Packet Format [8] 15 16 2.5 BLUETOOTH MODULE (KC-21) 2.5.1 Introduction of Bluetooth Module (KC-21) One of the most capable Bluetooth modules available, the KC-21 Bluetooth OEM Module is designed for maximum flexibility. The KC-21 module includes 14 general purpose input/output lines, and offers high speed serial communications up to 921K baud. ‘The KC-21 is a surface mount PCB module that provides fully embedded, ready to use Bluetooth wireless technology. The reprogrammable flash memory contains embedded firmware for serial cable replacement using the Bluetooth SPP profile. Other popular Bluetooth profiles are available. We are able to quickly customize the firmware for external device interaction, or for optimizations such as minimal power consumption, high speed response, and other proprictary features. Custom firmware is easily pre-loaded into these highly tuned and tested modules so that they are ready to install without additional procedures [4]. 7 ewe) 77 emos 2 emis 2 emia» ema a mi 7 erm) 16 emus ema ono) 26.92 eth 3.10 Figure 2.5 : Bluetooth Module (KC-21) [4] 2.8.2 Hardware Design KC Wirefree modules support UART, USB, and GPIO hardware interfaces. This section details typical usage models for these features. Please note that the usage of these interfaces is dependant upon the firmware that is loaded into the module, and is beyond the scope of this document [4]. Notes + RESET pin must be held high, 3.0V recommended. + Alll unused pins should be left floating; do not ground. + AIIGND pins must be well grounded. + The area around the module should be free of any ground planes, power planes, trace routings, or metal for at least 8 mm from the antenna in all directions. 18 + Traces should not be routed underneath the module. The RXD pin is floating in this UART implementation. If the RXD pin is not connected, it must be pulled using a SOK ohm resistor. 2.5.3 Bluetooth Technology and Transceiver Bluetooth Technology is standard for short-range radio communication. It is a low cost bi-directional (2 ways) wireless interface between mobile devices that provides low power consumption. Bluetooth Transceiver referring to Bluetooth. Transmitter and Receiver and every Bluetooth node have Bluetooth Transceiver. The aim is to eliminate the usage of cables. Bluetooth system operates in worldwide ific-Medical (ISM) frequency band, Bluetooth unlicensed 2.4GHz. Industrial-Sci devices can form a network. The basic network is Piconet where there are a master node and other act as slave node/s. At least 2 nodes are required to form Bluetooth network, cither one of the nodes can be master. The role of master is just to search and initiate the connection, once the link is established; the role of each node is equal. 19 Host Host? Blac Hon one Bliss Hos nk Higher — tte Higher Lage Der Lager Deer Wirtes Blaeooik Bievtoo Transceiver Tramelver % Bean Baand t ‘SPP. x x ‘SPP. oP se_ }P ¥ — + = BesiohBs Dive || Gemaraucim x] [ acon oon pe la] Bes Be Dace (Bus. PC Card. Ocher Card. Other) Fixaware Card, Other) Fictaware | Bus. PC Card, Ore Dave) : : Dave) | Payicl Bus Haare Priel Bus Harare Figure 2.6 :Host to Host Communication through Bluetooth Transceivers [3] Bluetooth transceiver is a wireless transceiver that transmits and receives signal wirelessly through Bluetooth protocol, thus a host, or in other words a controller is necessary if data processing is required in the application. As shown from the above figure, there are two hosts (Host 1 and 2, it can be microcontroller, computer, PDA, etc) and two Bluetooth transceivers. Both host need to communicate (exchange data), while Bluetooth transceiver is the tools to transfer the data between host. Thus, to process data and operate Bluetooth transceiver, a controller is necessary. ‘There are few methods to connect Bluetooth transceiver to host, where most common used are UART and USB. KC Bluetooth transceiver use UART to communicate. SPP (Serial Port Profile) is a Bluetooth standard profile which provides the platform for a host to communicate with Bluetooth transceiver serially. 20 Figure 2.7 : Circuit of Microcontroller with Bluetooth Module [3] From reference [3], no MAX232 is required in this case since RS232 is not involved. As shown, there are some differences between interfacing to computer ot interface to microcontroller. The components needed for microcontroller as host are: a. 1 unit x PCB board b. Lunit x KC21 Bluetooth OEM module c. Lunit x KC21 socket (from Cytron) dL unit x LMI117 3.3 voltage regulator ©. 1 unit x LM7805 voltage regulator f. 3 unit x 10uF electrolic capacitor g. 1 meter of Jumping wire h. Tunitx LED 1 unit x 2.5K Ohm resistor (voltage divider) 1 unit x 4.7K Ohm resistor (voltage divider) k. 1 unit x 10 K Ohm resistor (pullup Bluetooth reset) 1. 1 set x PICI6F877A basic circuit Combination of microcontroller and Bluetooth module can be configured as master or slave node. For either configuration, is not easy for user to see the response from Bluetooth as shown in previous section (computer as host). Basic microcontroller circuit does not have component such as LCD to display the response Furthermore, user is require to write program for microcontroller to display the response from Bluetooth 2 module. This document will not show sample program as there are many possible way to write program and too many microcontroller and language to cover. As stated, no restri ion on microcontroller types and brands, even the programming language too. User may choose the comfortable or familiar programming language to develop the algorithm, The basic requirement is able to send ASCII code serially (through UART), and also process the data received from Bluetooth module. The ASCII code will actually form the AT Command for microcontroller to communicate with Bluetooth module. There must be some configurations for microcontroller too. The most important configuration is UART. UART depend on timing or the baud rate, therefore the most important task is to configure the baud rate of microcontroller. Further configure the whole UART peripherals ready to communicate with Bluetooth module. The settings are: i, Baud rate = 115200 bps or 115.2 Kbps ii, Data bits = 8 iii, Parity = none iv. Stop bit=1 These settings have to be done using programming language of each microcontroller. As example, for PIC microcontroller, developer has to use assembly language or C language to configure these settings. 22 Figure 2.8 : Flow chart for Microcontroller to Communicate with Bluetooth Transceiver [3] Figure 2.8 shows a flow chart of general concept for microcontroller to communicate and process data from KC Wirefree Bluetooth transceiver. After configuring UART engine of microcontroller, program should wait for data from UART’s receiver buffer. Store the received data array and checked whether the “Enter” is received. If “Enter” is not yet, continue to wait and keep receive data. If “Enter” is received, process the data array stored and decides which mode to enter or which AT ‘command to be sent. For example, when the received array of data is “ATZV BD Adress 00043E008137", microcontroller should send “AT+ZV SPPConnect 000000E41213” to Bluetooth transceiver. This data array should be sent to transmitter buffer. If “AT-ZV — 23 BypassMode-” is received, the microcontroller has entered bypass mode and AT command should NOT be sent to Bluetooth transceiver, except RMC is used. This i an example of programming concept, developer may have better algorithm to write program for microcontroller. AT command (reference from KC Wirefree Bluetooth Beginner) From reference [3], AT command is a language originally used by modem. Now it has been applied in Bluetooth SPP. Every AT command start with AT and end with “enter” or (ie. “\n” in C, or in Hex value is OxOD Ox0A). Some common description of AT command in KCserial: “AT+parameter” is command send from host to module or serial adaptor. “AT-parameter” is command send from module to host. Every AT command must start with “AT™ or 0x41 0x54 in Hex value. eH eH Every AT command must be ended with “Enter” or 0xOD 0x0A in Hex value. There are two modes in Bluetooth configuration, First mode is Command mode, this mode indicate that all data send from host is a command for Bluetooth transceiver, and data send from Bluetooth transceiver to host is event reporting status of Bluetooth transceiver. Second mode is Bypass mode, this mode can only appear when connection between 2 Bluetooth transceivers is established. In Bypass mode, every single byte of data from host will be sent over Bluetooth wireless link to the other Bluetooth node, 24 2.5.4 Module Reflow Installation The KC-21 is a surface mount Bluetooth module supplied on a 24 pin, 6-layer PCB. For non PB-free applications, Sn63Pb37 solder is recommended. The final assembly recommended reflow profile is: + Maximum peak temperature of 208° - 210°C (below 220°C). + Maximum rise and fall slope afier liquidous of < 2°C/second. + Maximum rise and fall slope after liquidous of < 2°C/second. + Maximum time at liquidous of 50 — 90 seconds. GPIO Interface All GPIOs are capable of sinking and sourcing 2mA of /O current. These terminals are 5V tolerant. GPIO [0] to GPIO [7] are internally pulled down with S0KQ (nominal) resistors GPIO [8] to GPIO [15] are internally pulled up with SOKQ (nominal) resistors. 2.5.6 UART Interface The UART is compatible with the 16450 industry standard. Four signals are provided with the UART interface. The TXD and RXD pins are used for data while the CTS and RTS pins are used for flow control. [4] Figure 2.9 : UART Interface [4]

Вам также может понравиться