Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

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

2 Project Goals Create a data and control wireless network over household appliances. Should be implemented on cheap hardware. 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 using a wired CAN network.

5 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

6 Access Point Design Access Point CAN Comm. to other APs CAN Comm. to other APs CAN controller End Point End Point UART BT Philips BT Unit PIC18F458 Microchip PIC18F458 controller. Up to 127 Aps connected using CAN2.0A (CANopen) APs in rooms communicate with up to 128 End Points.

7 Specifications Microchip PIC18F452/8 40 MHz Operating Frequency 32KBytes Program Memory (ROM) 1536 BytesData Memory (RAM) YesUSART 2: No ; 8: YesCAN Phillips Bluetooth 2.4GHz to 2.4835GHz Frequency Up to 15m (integral antenna) Range HCI interface StackEmbedded Software Point to Multipoint (up to 7 slaves) Network Topology 3 to 3.4V (or from USB)Power Supply 45 x 48 x 7mmDimensions Can Module Pic18fxx8 - Can Module Implementation of the CAN protocol CAN 1.2, CAN 2.0A and CAN 2.0B 0 - 8 bytes data length Programmable bit rate up to 1 Mbit/sec Low power SLEEP mode

8 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. Work Frequencies

9 System’s Advantages CAN and BT are standards, thus the HWC can be easily accessed from outside. Robust enough to handle intended rate of communications, mainly short data transfers for control functions. Cheap hardware: –CAN: Telephone wiring –BT: Cheap unit, wireless.

10 CANopen CANopen is an application layer over the CAN physical layer. Transmissions using Object Dictionary. SDO (Service Data Object) for variable data transmissions. PDO (Process Data Object) for real time transmissions.

11 CANopen implementation Data Link Layer: CAN2.0A Can be easily transformed to CAN2.0B Static (and not dynamic) CAN ID allocation to reduce configuration effort. SDO was chosen over PDO since the PDO is limited to only 8 byte data transfers.

12 CANopen Protocol Advantages Standard Up to 127 units connected Connection is reliable and in sequence Liveliness maintained and failure detected Unlimited data messages length

13 The HWC Layer To Combine the BT and the CAN we needed to create a higher layer, the HWC Layer. –Controls the hybrid network structure and maintenance. –Transparently routes messages between the different networks.

14 HWC Protocol ConnectUpdate: Informs all EPs the BD address and HWC handle of the new EP. DisconnectUpdate: Informs all EPs a connected EP has disconnected. Data: Transfers Data from anyone to anyone. Data length limited to 119 bytes.

15 HWC protocol HWC handle 01234567891011121314151617181920212223 The HWC handle include the following data: –0-11:BT handle, 12 bits –16-22:CAN id, 7 bits –12-15+23:Class number, 5 bits AP handle includes its CAN id and zeros as the BT handler. EP handle includes the CAN id of the AP to which it connected and the BT handle that the AP received when it connected to it. The class number is saved for multicast usage.

16 HWC protocol HWC Packet header 012345678 The HWC packet header include the following data: –0-2:From, HWC handle, 3 bytes –3-5:To, HWC handle, 3 bytes –6:OpCode, 1 byte –7-8:Data length, 2 bytes OpCodes: –7 - ConnectUpdate –8 - DisconnectUpdate –9 - Data

17 MemoryModule BT base Module Control the BT unit BluetoothModule Manage the Bluetooth protocol Interrupt-Driven Module dependency diagram (AP) CAN base Module Control the CAN unit CANOPENModule Manage the CANOPEN protocol Interrupt-Driven HWC module Manage the HWC protocol

18 Memory module Memory allocation Shared between the different modules. 50 memory packets (12 bytes) in RAM. Managed by special FIFOs.

19 CAN base module Gets CAN receive buffers interrupts and place data in CAN FIFO. Send CAN messages by placing in CAN buffers. If busy, puts message in CAN FIFO, and transmit on first interrupt.

20 CANopen module Checks for received CAN packets in a CANopen FIFO. Implements the following CANOPEN layers: –NMT – Network ManagemenT Emergency. Node/Life Guarding. –SDO – Service Data Object HWC Index 2240 / 1

21 BT Base module Checks for interrupts in the UART receive register. When has full BT packet, places it in the BT HCI FIFO. On interrupt transmits 1 byte from UART FIFO.

22 BLUETOOTH HCI module Gets received BT packets from BT HCI FIFO. Implements The HCI layer to control the BLUETOOTH protocol. Notify the HWC on any new connection or disconnection. Transfer to the HWC all the data from the data packets received.

23 HWC module Connected to CAN and BT modules (FIFOs). Updates any new connection or disconnection in the HWC protocol. Routes received HWC packets to the designated destination.

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

25 Old Debugging Methods MPLab Debugger: not reliable LCD module: Too big 3 of the 4 LEDs were blocked by CAN ports.

26 New Debugging Methods Accessing Assembly code, PIC registers down to hardware level. We have developed both CAN and BT simulators in MSDEV6. One LED as a blinker to present data.

27 PIC18F Difficulties We reached almost all limitations of the PIC:We reached almost all limitations of the PIC: –Used all RAM (1.5k/1.5k) –Used 80% of ROM (26K/32K). –Program calls and interrupts increased while limited to max 31 in the return address stack. –More interrupts and long interrupt run time may cause loss of interrupts on big, busy networks.

28 MCC18 Difficulties Most MCC18 libraries are problematic and complicated to work with.Most MCC18 libraries are problematic and complicated to work with. MCC18 initialization is limited and cannot be trusted to initiate the static memory.MCC18 initialization is limited and cannot be trusted to initiate the static memory. MCC18 has some bugs, especially in the optimizations it makes.MCC18 has some bugs, especially in the optimizations it makes.

29 DEMONSTRATION

30 Summary The HWC project was much harder than anticipated, even after finishing part I. Although we had to work on it about 30 hours a week during a year and a half we are glad we’ve chosen this project. We learned a lot more than just the CAN and BT protocols. We learned how to work with a very limited hardware and how to find advanced solutions to problems we thought “can not be solved”.

31 Thank you


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

Similar presentations


Ads by Google