Presentation is loading. Please wait.

Presentation is loading. Please wait.

Home Wireless Control Students Ehud Ravitz Lee Blum Instructor Konstantin Sinyuk Part A Final Presentation Project A - 044167.

Similar presentations


Presentation on theme: "Home Wireless Control Students Ehud Ravitz Lee Blum Instructor Konstantin Sinyuk Part A Final Presentation Project A - 044167."— Presentation transcript:

1 Home Wireless Control Students Ehud Ravitz Lee Blum Instructor Konstantin Sinyuk Part A Final Presentation Project A - 044167

2 Project Goals Create a data and control network over household appliances. Check future interfacing of the System with external Controllers (iPaq, CAN2USB…) Should be implemented on cheap software. Should be friendly to both users and application developers.

3 Web iPaq General Block Design Access Point End Point Legend:CAN BT

4 Network Structure Each household appliance will have an End Point embedded within it. In Each room in the house, an Access Point will control over all the End Points in the room using a Bluetooth wireless connection. All the Access Points will communicate with one another through a wired CAN network.

5 Design Tools Microchip PIC18F452/8 on PICDEM2 boards. MCC18 compiler using MPLab IDE. Philips Bluetooth units.

6 Household Appliance End Point Design A Microchip PIC18F452 controls a Philips Bluetooth unit using UART. The application on the PIC controls the appliance, according to Bluetooth data transfers with the Access Point. UART PIC18F452 Philips Bluetooth Unit BT

7 End Points could also be… CAN2USB control over a PC connected to the web (Control Protocols over the Internet) An iPaq unit, setting as a remote control (using BT) And many more…

8 Access Point Design A Microchip PIC18F458 (with CAN support) controls a Philips Bluetooth Unit using UART. Each Access Point, located in a different room of the house, can communicate with up to seven local End Points using Bluetooth. Extra E 2 PROM memory stores the Access Point’s database of local and total End Points (controlled with I 2 C). The PIC uses CAN 2.0B to communicates between different Access Points, enabling control of an Access Point on End Points in different rooms.

9 Access Point Design Access Point CAN Connection To other Access Points CAN Connection To other Access Points CAN controller End Point End Point UARTI²C BT Philips BT UnitDB of End Points on E 2 PROM PIC18F458

10 Specifications Microchip PIC18F452/8 DC – 40 MHz Operating Frequency 32KBytes Internal Program Mem. 1536 BytesData Memory 256 BytesData EEPROM Memory 2: 18 ; 8: 21Interrupt Sources A, B, C, D, EI/O Ports 4Timers Addressable USART, MSSP (+ CAN on 8) MSSP, CAN, Serial Communications YesParallel Communications (PSP) 8 input channels 10-bit Analog- to-Digital Converter 2: 0 ; 8: 2 Analog Comparators 2: No ; 8: YesAnalog Comparators VREF Output Yes Programmable Low Voltage Detect YesProgrammable Brown-out Reset 2: No ; 8: YesCAN Module 75 InstructionsInstruction Set Yes40-pin PDIP

11 Specifications Phillips Bluetooth Philips Components V1.1 2.4GHz to 2.4835GHz Operating Frequency Class 2 (0 dBm nominal) Transmit Output Power Up to 15m (with integral antenna)Operating range Less than –80dBm @ 1E-3 BERReceiver Sensitivity Embedded software stack supporting an HCI interface Embedded Software Point to Multipoint (up to 7 slaves) Master/Slave switching supported Network Topology USB v1.1, UART at up to 921 kbps (low voltage serial interface) Interface 3 to 3.4V (or direct power from USB connection) Power Supply Idle < 2mA File transfer 70mA Peak < 100mA Current consumption -10 to + 55°COperating Temperature -40 to + 85°C Storage Temperature 45 x 48 x 7mmDimensions

12 CAN max. freq. is 1Mbps. Bluetooth effective freq. is 750KB/sec. PIC to BT UART connection is in 115,200 bps. PIC’s effective throughput is 10MIPS. Therefore, the CAN connection can support a system with four Access Points, each one transferring one End Point’s data, as expected. Work Frequencies

13 System’s Advantages The Bluetooth Protocol is a standard. Making generic as possible to produce. Should be embedded in all household appliances, of all manufacturers. Strong enough to handle intended rate of communications (previous slide), mainly short data transfers for control functions. Cheap Hardware.

14 Communication Algorithm Access Point (AP) is always Master. End Points (EP) are always Slaves. AP Scans for updated EPs in area every X sec. AP Calls EP when found. EP stores AP’s BD Address to know who is his Master. EP refuses other APs trying to connect him when is with a Master. Packets sent from APs to EPs: –Command –Inquiry for Data Packets sent from EPs to APs: –Data in response to inquiry / command

15 Debugging Methods The MPLab Debugger, supplied with the PIC Development Kit. The BT C++ project on PC. The LCD, supplied on the PICDem 2 board, for faster, easier and specific tests. LEDs…

16 Final System Block Design UART BT Low BT High CAN-Low CANopen / DeviceNet I²C E²PROMButtons LCD SCHEDULER – HWC LAYER Considering using RTOS AP App. EP App. AP App. Lower Level EP App. Lower Level Opaque Background == implemented modules

17 Part A status Modules to control the PIC : UART, LCD. A Bluetooth module (BT stack on PIC implementation). A Server (Access Point) Application. A Client (End Point) Application.

18 1. UART module An initialization function. Read / Write functions. Close UART function (closes UART after waiting for all data to be sent / received). An interrupt service routine to control the UART module. This module was compiled to be a standard EUART library.

19 2. LCD module An initialization function.An initialization function. Functions to write Strings and Constants to the LCD screen.Functions to write Strings and Constants to the LCD screen. This module was compiled to be a standard LCD library.

20 3.1. Bluetooth module – HCI Layer An Initialization function. Bluetooth stack commands functions: –Reset –Write Scan Enable –Accept Connection Request –Disconnect –Inquiry –Create Connection.

21 3.1. Bluetooth module – HCI Layer – Cont. A Get Event Routine to handle incoming events: –Reset complete –Read buffer size complete –Write scan enable complete –Accept connection request status –Disconnect status –Disconnect complete –Create connection status –Connection complete –Connection request –Inquiry status –Inquiry result –Inquiry complete –Number of complete packets

22 3.1. Bluetooth module – HCI Layer – Cont. Error Handling Recognizing errors and sending appropriate return values: –TRANSMIT FREE SPACE ERROR –RECEIVE FREE SPACE ERROR –CMD BUFFER ERROR –DATA PACKET BUFFER ERROR –VOICE PACKET BUFFER ERROR –DATA PACKET SIZE ERROR –VOICE PACKET SIZE ERROR –UNKNOWN COMMAND STATUS EVENT ERROR –SUCCESS…

23 3.2. Bluetooth module – Functional API Sublayer Init Search (Inquiry) Connect / Accept Connection Send / Receive Data Disconnect This module will be implemented in Part B

24 4. The Applications EP and AP demo apps to show BT stack layer functionalities: AP functionality:AP functionality: –Inquiry –Create connection –Select Desired Data using LCD and Buttons –Send data –Terminate Connection EP functionality:EP functionality: –Write Scan Enable –Accepts Connection –Receives Data –Shows Data on LCD

25 * End Points also handle input from the appliance. In part B, the main module in Access Points will handle input/output from CAN module routines as well. UART Module Control the Phillips unit LCDModule BluetoothModule Manage the Bluetooth protocol Output Debug Debug Interrupt-Driven Application* (Client / Server) Module dependency diagram (Current State)

26 DEMONSTRATION

27 Difficulties we have encountered The PIC has many limitations:The PIC has many limitations: –One process only. –Very small RAM (1.5K). –Using ROM as RAM not possible (mcc18). –10Mhz effective CPU freq. –Only 32K ROM to store program. Still, need to handle high frequency data transfers.Still, need to handle high frequency data transfers. For all of the above reasons, conversion from PC and iPaq projects was not in question. All had to be written from scratch.For all of the above reasons, conversion from PC and iPaq projects was not in question. All had to be written from scratch. Moreover, no PIC modules were available for UART and LCD, and had to be developed.Moreover, no PIC modules were available for UART and LCD, and had to be developed.

28 Solutions we came up with The emphasis when writing the code was on smart and efficient code (space and time).The emphasis when writing the code was on smart and efficient code (space and time). Thus, the current apps take only 12.5K of the 32K program memory.Thus, the current apps take only 12.5K of the 32K program memory. Thus enough space left for the CAN module (~15K).Thus enough space left for the CAN module (~15K). All the UART code, and thus the BT events, is interrupt driven.All the UART code, and thus the BT events, is interrupt driven. Façade of C routines for LCD Assembly code.Façade of C routines for LCD Assembly code.

29 Final System Block Design UART BT Low BT High CAN-Low CANopen / DeviceNet I²C E²PROMButtons LCD SCHEDULER – HWC LAYER Considering using RTOS AP App. EP App. AP App. Lower Level EP App. Lower Level Opaque Background == implemented modules

30 CAN issues There are two alternatives: –DeviceNet module available from Microchip –CANopen module by Konstantin Sinyuk We will probably develop with the DeviceNet module since it doesn’t have the extra features of the CANopen, that we do not need for HWC.

31 Time Table 01/12/03 - BT Functional API Sublayer 15/12/03 - I²C module 01/02/04 – CAN-LOW & CANopen or DeviceNet module 01/03/04 – HWC Scheduler module 15/03/04 - AP / EP apps April 2004 - Presentation & Book Army Service – July 2004

32 To be continued


Download ppt "Home Wireless Control Students Ehud Ravitz Lee Blum Instructor Konstantin Sinyuk Part A Final Presentation Project A - 044167."

Similar presentations


Ads by Google