	*** OLIMEX demo project for the MOD-ZIGBEE ***

1. Requirements
	- At least 2 MOD-ZIGBEE demo boards by Olimex
	- RS232 level converter or adapter board (ex. MOD-USB-RS232 by Olimex)
	- Compatible debugger, for example PICkit3 or ICD2
	- MPLAB IDE by Microchip with installed MPLAB C18 Compiler 
	- Power source - CR2032 lithium battery or external source
	
2. Description
	This is a demo project that can be used to control PowerPoint presentations by generating Left and Right arrow keys under Windows Environment.

	The demo uses ZigBee stack library provided by Microchip. One of the devices uses the project 'DemoPIC18Coordinator' and is configures as a ZigBee coordinator that sets up a network and wait for devices to connect. The other type of device is RFD, uses the other project named 'DemoPIC18RFD' and upon startup it tries to connect to the coordinator. Upon successfull connection the RFD falls to sleep. When the user presses one of the buttons on the board the RFD wakes up and sends a message indicating which of the buttons was pressed. The message should be received by the coordinator and when decoded the Coordinator prints one of these messages "RIGHT BUTTON PRESSED" or "LEFT BUTTON PRESSED" on its UART console (please see section 3 on how to implement the console), the LED2 on the coordinator is also toggled when a message is received. 
	
	The user can control whether messages are received or ignored by pressing B2 on the coordinator. LED1 indicates the current state. Upon powerup message reception is disabled.
	
	In order to generate the keypress messages there is a support desktop application provided (ArrowsPPT.exe in the Prebuilt folder). Its function is simply to monitor output on the coordinator console for the presense of the strings "RIGHT BUTTON PRESSED" or "LEFT BUTTON PRESSED". When a string is detected the application sends a keypress message (left or right arrow key) to the active application. Complete source code is provided for this support application so the user can easily emulate other buttons or events by editing the source code. The application was built with Visual Studio 2010 and .NET support.
		
3. How to setup Coordinator to print messages:
	The easiest configuration is to have available MOD-ZIGBEE rev.B board and a MOD-USB-RS232 board. Then you will just have to configure MOD-USB-RS232 in host mode (TX on pin 3 of the UEXT, RX on pin 4) plug one into the other and that is all.
	
	In any other case you will have to manually connect pins RC6 (TX as seen from the MCU), and RC7 (RX as seen from the MCU) and GND of the MOD-ZIGBEE board to the respective pins of the level converter.

4. How to use this demo
	The board ships with demo firmware for the End Device preinstalled which has the same functionality as in this project at time of manufacture (maybe there is an update to the demo when you read this).
	
	To download the firmware to the board you need some sort of programmer/debugger compatible with the PIC18F26K20 processor.
	
	The fastest possible way to get things running is to download the precompiled hex file to the processor memory. The file needed for the Coordinator is called "Coordinator.hex" and for end devices it is "RFD.hex". Import this file in MPLAB and select processor PIC18F26K20.
	
	An alternative is to open the workspace (\ZigBeePPT\ZigBeePIC18_PPT.mcw.mcw) in MPLAB, compile the assocaite project it and then debug it. This sample workspace may also be your starting point in developing new applications using the board.
	
	Build info:
		MPLAB IDE v8.63
		MPLAB C18 v3.34
		ZigBee2006Res-v2.0-2.6c
		
	Debugger used:
		PICKit3 by Microchip

5. Further reading
	User's manual for the MOD-ZIGBEE board. Also feel free to consult all documents released by Microchip regarding their MiWi DE support and related PIC18 support documents and application notes.

6. Support
	http://www.microchip.com/
	http://www.olimex.com/dev/
	
Last edit
	31 May 2011
