Zigbee project!!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Almosawi
Posts: 6
Joined: Tue Jan 25, 2011 11:08 pm
Contact:

Zigbee project!!

Post by Almosawi »

Hi

Im working on a project with zigbee modules, I have 2 zigbee modules.. the first one is connected to a PC via zigbee USB adapter.
The other one is connected to PIC16f877a on EB-006-00-6.

I made a loopback communication test between the zigbee modules with successful results, but when i connect a module to the PIC and send output (see attachments) to PC6 (TX) pin by using flowcode the communication will be losted

Note: I made the connection for only the necessary pins (Vcc, Dout, Din, GND).

Please help me to know what is the problem and how to solve it.
Attachments
2.jpg
2.jpg (2.97 KiB) Viewed 6585 times
1.jpg
1.jpg (151.58 KiB) Viewed 6585 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Zigbee project!!

Post by Benj »

Hello,

Sorry for some reason your post did not come up in my new post list.

Are you using the Flowcode component and connecting the Zigbee board to PortC? Also what jumper settings are you using on the board?

Can you confirm if your PIC program is running at all eg flashing a LED. You might also want to make a 1 second flasher program to ensure your configuration and clock speed settings etc are all correct in Flowcode. If they are not correct then your UART baud rates will be out and could explain why the board is not working.

If your still stuck then please can you attach your program and explain how your Zigbee board is connected up or send another photo showing the Zigbee board.

Almosawi
Posts: 6
Joined: Tue Jan 25, 2011 11:08 pm
Contact:

Re: Zigbee project!!

Post by Almosawi »

Hi Benj

thanks for your reply

Im not using (Zigbee board EB051-00-1), but usnig my board that i weld by myself (attached)
the zigbee is working on loopback test

let me explain to you what zigbee pins that i connect

1. VCC
I connect VCC to the output of the regulator that gives 3.3v .

2. GND
to the ground of the circuit .

3. Dout
Its connected to PC7 (RX) of the microcontroller .

4. Din
Its coonected to PC6 (TX) of the microcontroller .


About LED testing, I made that and its flashing and no problem with that.

Note: my program is only the output order that I attached and its in continuous loop.
Attachments
3.jpg
3.jpg (50.13 KiB) Viewed 6568 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Zigbee project!!

Post by Benj »

Hello,

Ah I see, Could it be that the XBEE module does not like 5V signals from the PIC? On our E-block we use a MAX3002 chip to convert signals from 5V to 3.3V and back.

I would also look at the schematic for our E-block and make sure you have everything connected up as shown for example the sleep signal etc.

Finally have you done the 1 second flasher program I mentioned? This is vital to getting the baud rate right as you will not see any data without this being correct.

Loop
{
Output 1
Delay 1 second
Output 0
Delay 1 second
}

If delays on the hardware are equal to 1 second then you have chip configuration and Flowcode clock speed set up correctly for your hardware.

Almosawi
Posts: 6
Joined: Tue Jan 25, 2011 11:08 pm
Contact:

Re: Zigbee project!!

Post by Almosawi »

I made the LED test
but on hardware the delay is almost 6.5 sec

how to change the baud rate??

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Zigbee project!!

Post by Benj »

Hello,

For your delays to equal 1 second on the hardware you must have your chip configuration settings correct and your Flowcode clock speed correct for your hardware.

Configuration settings are available from here.

Chip -> Configure -> Switch to expert settings

Clock speed settings are available from here.

View -> Project options

Once you have both of these correct your delays will be 1 second and the zigbee component baud rates will be correct.

Almosawi
Posts: 6
Joined: Tue Jan 25, 2011 11:08 pm
Contact:

Re: Zigbee project!!

Post by Almosawi »

Hello

whan i made the flowcode clock speed 3276800, the 1 sec on flowcode is equal 1.85 sec on the hardware
and whan i made the flowcode clock speed 2000000, the 1 sec on flowcode is equal 2.15 sec on the hardware

so no clock speed can make 1 sec on the hardware!!!

also which zigbee baud rate is good to use with PIC?? (the default is 9600)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Zigbee project!!

Post by Benj »

Hello,

Ok what frequency crystal are you using to drive the PIC? Do you have the oscillator switch in the XTAL position?

Also if you attach your program to the forum then I will check that the configuration settings you are using are correct.

Almosawi
Posts: 6
Joined: Tue Jan 25, 2011 11:08 pm
Contact:

Re: Zigbee project!!

Post by Almosawi »

Hi bro

I changed the oscillator to XTAL and I can get 1 sec on the hardware. But still cant send via zigbee !!

I think the problem is one of these reasons:

1. The baud rate of the zigbee needs to be compatible with the microcontroller.

2. The output voltage is 5v, but zigbee gets only 3.26v (checked at loopback test). I tried to use regulator to change the voltage but I'm sure that its a bad idea because the data will be losted.


Now I'll try to check all the 8 choices of zigbee's baud rates maybe it can make something (I am disappointed) ...... I think I have to enable uart, but how??


Note: I used two ways to send data via (TX pin) and its attached. I don't know if that programs are good to do.
also there is a photo for my board (Please tell me if I made something wrong).
Attachments
Send.fcf
(3 KiB) Downloaded 238 times
4.jpg
4.jpg (177.7 KiB) Viewed 6542 times
Send2.fcf
(4.5 KiB) Downloaded 257 times

Almosawi
Posts: 6
Joined: Tue Jan 25, 2011 11:08 pm
Contact:

Re: Zigbee project!!

Post by Almosawi »

I solved the problem, I have to send the char to zigbee like sending it to RS232 Board because that can enable the uart... so the sending is by TX pin

thanks Benj for your time

Post Reply