My XBee experiments

Show or discuss your existing Home automation project here, so a detailed explanation!.....

My XBee experiments

Postby Willem4ever » Sun Oct 18, 2009 2:20 pm

Sometime ago I promised you guys to share my XBee experiments with you.

Yesterday and today, in preparation of the arrival of the WIZ812MJ, I found some time to put some together which is actually presentable. Below on the left you can see the PE micro USB multilink interface. The interface is used for programming en in circuit debugging of the Freescale MC9S08QG8.

On the prototyping board you can find the Microcontroller (MC), a LED (red), a PIR (top right side) and the XBee interface which is connected to the serial interface of the MC. The Xbee has two additional I/O connected (SLEEP & SLEEP_RQ) to the MC which allow me to reduce power consumption when not neede. The Xbee is pre-programmed as a Zigbee router.

The MC has 16 pins which are configured as followed.

1) 4 pins are connected to the XBee (tx,rx,sleep,sleep_rq).
2) 4 pins are reserved for the WIZ812MJ (Ethernet Interface)
3) 2 pins to feed the controller (vdd/vss).
4) 2 pins are used for debugging / flashing etc.
5) 1 pin for the LED.
6) 1 pin for the PIR.

Leaving 2 pins free. One for general I/O and one either as general I/O or AD.

It is not an Arduino and you have to do more programming but it gives you all the flexibility you need.

Next steps:

1) Connect the the Ethernet Interface
2) Change the Xbee to API mode (currently AT) to get better control of it.

That's all for now and for promotional purpose I have included the features of the microcontroller at the bottom of this post/


Image

The Real Time Debugger on the right. On the left the X-CTU a tool provided by Digi (FOC)

Image

<b>8-Bit HCS08 Central Processor Unit (CPU) </b>
20-MHz HCS08 CPU (central processor unit)
HC08 instruction set with added BGND instruction
Background debugging system
Breakpointcapability to allow single breakpoint setting during in-circuit debugging (plus two more breakpoints in on-chip debug module)
Debugmodule containing two comparators and nine trigger modes. Eight deep FIFO for storing change-of-#64258;ow addresses and event-only data
Debug module supports both tag and force breakpoints
Support for up to 32 interrupt/reset sources

<b>Memory Options </b>
FLASH read/program/erase over full operating voltage and temperature
MC9S08QG88KbytesFLASH,512bytesRAM, MC9S08QG44KbytesFLASH,256bytesRAM

<b>Power-Saving Mode</b>s
Wait plus three stops

<b>Clock Source Options </b>
ICS Internal clock source module containing a frequency-locked-loop(FLL)controlled by internal external reference; precisiont rimming of internal reference allows 0.2% resolution and 2% deviation over temperature and voltage; supports bus frequencies from 1 MHz to 10 MHz
XOSC Low-power oscillator module with software selectable crystal or ceramic resonator range,31.25kHzto38.4kHzor1MHzto16MHz,
and supports external clock source input up to 20MHz

<b>System Protection</b>
Watchdog computer operating properly (COP) reset with option to run from dedicated 1-kHz internal clock source or bus clock
Low-voltage detection with reset or interrupt
Illegalopcode detection withreset
Illegaladdress detection withreset
FLASH block protect

<b>Peripherals</b>
ADC 8-channel, 10-bit analog-to-digital converter with automatic compare function, asynchronous clock source, temperature sensor, and internal bandgap reference channel; ADC is hardware triggerable using the RTI counter
ACMP Analog comparator module with option to compare to internal reference; output can be optionally routed to TPM module
SCI Serial communications interface module with option for 13-bit break capabilities
SPI Serial peripheral interface module
IIC Inter-integrated circuit bus module
TPM 2-channel timer/pulse-width modulator; each channel can be used for input capture, output compare, buffered edge-aligned PWM, or buffered center-aligned PWM
MTIM 8-bit modulo timer module with 8-bit prescaler
KBI8-pinkeyboardinterruptmodulewithsoftware selectable polarity on edge or edge/level modes

<b>Input/Output </b>
12general-purpose input/output (I/O) pins, one input-only pin and one output-only pin; outputs 10mA each, 60 mA max for package
Software selectable pullups on ports when used as input
Software selectable slew rate control and drive strength on ports when used as output
Internal pullup onRESET andIRQ pins to reduce customer system cost

<b>Development Support </b>
Single-wire background debug interface
On-chip, in-circuit emulation (ICE) with real-time bus capture
User avatar
Willem4ever
Global Moderator
Global Moderator
 
Posts: 804
Joined: October 2006
Location: Uithoorn / Netherlands

My XBee experiments

Postby Willem4ever » Fri Oct 23, 2009 9:14 pm

I have added the WIZNET812MJ and with some borrowed code it was up running within the hour. Besides the Ethernet interface I also added an AMS302 NaPiCa lightsensor,
it is connected to last free AD pin of the micro-controller. It takes a sample per second and it display the average of 32 samples.


Image
User avatar
Willem4ever
Global Moderator
Global Moderator
 
Posts: 804
Joined: October 2006
Location: Uithoorn / Netherlands

My XBee experiments

Postby Niknik » Sat Oct 24, 2009 12:01 pm

That Wiz sure look like a Tibbo... Have you ever tried those? Have Ethernet and are easily programmable in a kind of BASIC language.
Niknik
Member
Member
 
Posts: 255
Joined: April 2006
Location: Portugal

My XBee experiments

Postby Willem4ever » Sun Oct 25, 2009 10:06 am

The WIZ81xMx series is based om W5100 single-chip Internet-enabled 10/100 Ethernet controller
designed for embedded applications where ease of integration, stability, performance, area
and system cost control are required. The W5100 has been designed to facilitate easy
implementation of Internet connectivity without OS. The W5100 is IEEE 802.3 10BASE-T and
802.3u 100BASE-TX compliant.

The W5100 includes fully hardwired, market-proven TCP/IP stack and integrated Ethernet
MAC & PHY. Hardwired TCP/IP stack supports TCP, UDP, IPv4, ICMP, ARP, IGMP and PPPoE
which has been proven in various applications for several years. 16Kbytes internal buffer is
included for data transmission. No need of consideration for handling Ethernet Controller, but
simple socket programming is required.

For easy integration, three different interfaces like memory access way, called direct,
indirect bus and SPI, are supported on the MCU side.


Features

- Support Hardwired TCP/IP Protocols : TCP, UDP, ICMP, IPv4 ARP, IGMP, PPPoE, Ethernet
- 10BaseT/100BaseTX Ethernet PHY embedded
- Support Auto Negotiation (Full-duplex and half duplex)
- Support Auto MDI/MDIX
- Support ADSL connection (with support PPPoE Protocol with PAP/CHAP Authentication mode)
- Supports 4 independent sockets simultaneously
- Not support IP Fragmentation
- Internal 16Kbytes Memory for Tx/Rx Buffers
- 0.18 m CMOS technology
- 3.3V operation with 5V I/O signal tolerance
- Small 80 Pin LQFP Package
- Lead-Free Package
- Support Serial Peripheral Interface(SPI MODE 0)
- Multi-function LED outputs (TX, RX, Full/Half duplex, Collision, Link, Speed)

So not bound to any language or manufacturer !
Last edited by Willem4ever on Sat Dec 19, 2009 5:28 pm, edited 2 times in total.
User avatar
Willem4ever
Global Moderator
Global Moderator
 
Posts: 804
Joined: October 2006
Location: Uithoorn / Netherlands

Re: My XBee experiments

Postby Dhruval » Mon Sep 29, 2014 9:52 am

without debugger how can i upload or load code in programmable Xbee module?
Dhruval
Starting Member
Starting Member
 
Posts: 1
Joined: September 2014

Re: My XBee experiments

Postby Digit » Thu Oct 02, 2014 11:47 pm

An Xbee module can be configured, but it cannot run code (other than the firmwares).
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands


Return to Home Automation Projects

Who is online

Users browsing this forum: No registered users and 1 guest