Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
SAINATH
PostPosted: Jul 02, 2010 - 12:58 PM
Hangaround


Joined: Feb 24, 2008
Posts: 102


Hello everyone ,

I am new to Zigbit
I am working on a project with ATZB 24 A2 modules .I am facing serious problems with programming those modules.

I have bought the modules and I am programming the module through JTAG using AVR dragon

But the problem is that the programmer does not always program the module and sometimes it shows the message in AVRDUDE that JTAG has been disabled
// ILLEGAL JTAG ID
//IS JTAG DISABLED
the following are the error messages

I have searched a lot for circuit to program it .Is ISP programming possible through Zigbit?

Thanks In Advance
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 02, 2010 - 07:29 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

SAINATH wrote:
But the problem is that the programmer does not always program the module and sometimes it shows the message in AVRDUDE that JTAG has been disabled

Looks like hardware problem on your side. What JTAG frequency do you use?

SAINATH wrote:
I have searched a lot for circuit to program it .Is ISP programming possible through Zigbit?


Connections for ISP are following: MISO(38), MOSI(39), RST(8), Vcc(24,25) and GND(9,22,23,35)?

I'm not sure if all Vccs and GNDs are connected internally.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
SAINATH
PostPosted: Jul 03, 2010 - 08:13 AM
Hangaround


Joined: Feb 24, 2008
Posts: 102


Thank you Alex for the reply.
After seeing the post I have gone through the Avrdude Manual to check the frequency and found it to be 1microsecond bit clock period.
Also I have a query .Is frequency of programming is decided by Avrdude or the AVRDragon with which we program?
Thank you for the ISP connections .Will try it out

Regards
Sainath
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 03, 2010 - 04:02 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

SAINATH wrote:
I have gone through the Avrdude Manual to check the frequency and found it to be 1microsecond bit clock period.

So it is 1 MHz frequency. It is rather high frequency, try something like 250 kHz (4 us period).

SAINATH wrote:
Is frequency of programming is decided by Avrdude or the AVRDragon with which we program?


It depends on implementation, I don't know how Dragon is designed.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
SAINATH
PostPosted: Jul 04, 2010 - 03:30 PM
Hangaround


Joined: Feb 24, 2008
Posts: 102


Thank you Alex,
I was able to program the Zigbit through ISP through Dragon.And sometimes the fuses get changed automatically and Avrdude shows that fuses have been changed.What should be my methodology to avoid that?
I will try ISP on all the chips I have and try to change their fuses for JTAG programming .

Regards
Sainath
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 04, 2010 - 03:42 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

SAINATH wrote:
What should be my methodology to avoid that?

I never programed ZigBits with something else than JTAGICEmkII but in my practice I programed a lot of AVR via lots of programmers and never seen fuses changes by themselves.

SAINATH wrote:
I will try ISP on all the chips I have and try to change their fuses for JTAG programming


Both ISP and JTAG are enabled by default on all modules.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
SAINATH
PostPosted: Jul 06, 2010 - 09:38 AM
Hangaround


Joined: Feb 24, 2008
Posts: 102


Yes both ISP and JTAG is enabled by default.
Do you have any schematic of Zigbit with both JTAG and ISP header and also with USB interface for bootloader.I have many boards and I want to have a generic PCB made for experimenting.

Thank you ,

Regards
Sainath
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 06, 2010 - 09:48 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Here is schematic for MeshBean board taken from meshnetics site while it was alive.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
SAINATH
PostPosted: Jul 06, 2010 - 10:46 AM
Hangaround


Joined: Feb 24, 2008
Posts: 102


Thank you Alex.
I already have the Mesh Bean Board so I have incorporated the test points as well as USB interface from that .I am now only left with the ISP header's .I will incorporate that too with a LED to each GPIO and prepare that .

Regards
Sainath
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Oct 04, 2010 - 03:59 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hi Alexru,
It it possible to use the isp programmer ATAVRISP2 to programm a RF? how can i check communication between 2 RF of Zigbit ATZB-24-A2R
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 04, 2010 - 04:54 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
It it possible to use the isp programmer ATAVRISP2 to programm a RF?
I've already answered this, yes it is possible. And there are a lot of posts on this forum on how to connect ZigBit to ISP programmer.

newjou wrote:
how can i check communication between 2 RF of Zigbit ATZB-24-A2R
Build any application from SDK and program them into modules.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 04, 2010 - 05:42 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Thank for your answer Alexru.

In fact, i am not using a SDK or a developpement kit, I just have 2 Zigbit module so, after reading some document, I found that i may use
- 2 Zigbits
- Buy the isp programmer ATAVRISP2
- and finaly buy a UUSB-MB5 of 4D system to communicate with PC.
I have'nt test yet to check if I may need additionnel hardware to test without developement kit.

For software, I heart about AVRstudio4 and AVR2052: BitCloud? I am still looking for the appropriate use of Bitcloud if someone knows.

Actually, i am use to MPLAB and Labview, and I wanted to now if someone has already use one of them for Zigbit.

Thank
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 04, 2010 - 05:51 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
In fact, i am not using a SDK
SDK is a software package that you need to download from atmel.com.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 04, 2010 - 06:48 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Please Alex,

do you have any idea about other question I sent?

thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 04, 2010 - 06:58 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
do you have any idea about other question I sent?
What questions? I personally don't care for MPLAB and Labview and I suspect that not a lot of people here do.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 04, 2010 - 09:17 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


OK

does 2 Zigbit + JTAG + uUSB-MB5 are enough to test a radio transceiver?

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 04, 2010 - 09:22 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
does 2 Zigbit + JTAG + uUSB-MB5 are enough to test a radio transceiver?
Depends on what do you mean by "test", if you can live without extensive output then you might use few LEDs for indication and get rid of uUSB-MB5. You haven't described your goal at all.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 04, 2010 - 10:48 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


For the moment,
I have'nt described a goal, I just want to test communication between 2 module. As input I will use a switch as DIO (digital Input Output) and joystick for ADC, for out put I will be using LEDs as DIO and a counter as DAC.

After all, I will get 6 more Zigbit to build a Network.

How will I test module if I unplug in computer?

Thank you Alex, your prompt answer helps me a lot.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 05, 2010 - 06:04 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
How will I test module if I unplug in computer?
None, of those tasks require interaction with computer. Download SDK and play with it, try to run sample applications from there. This is the only way I see.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
spincraft
PostPosted: Oct 20, 2010 - 06:01 AM
Wannabe


Joined: Sep 09, 2010
Posts: 85
Location: san diego CA US

Hi Neujou,

I read your post about using Labview & Zigbit. The RZ Raven kit has a USB stick that shows up (enumerates) as a COM port, after you install the Windows driver for it.

I have used NI-MAX to connect to the COM port and the serial write & read VI (look at examples) will read the ASCII strings in Labview. Set the baud = 38400 and use 8N1.

I just ordered a Zigbit-A2 and will try using the AT commands in BitCloud to read the COM port messages.

I hope this helps.
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 10:19 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hi,

thanks for your answers.

I ordered my first 2 zigbits ATZB-24-A2 and I just received them but I try to run without succes.

In fact, I looking for the basic application that can let me communicate with my modules.

I connect 1 Zigbit through the USB serial TTL-232R-PCB TO the Hyper terminal of PC so I can use AT command, but, As I did it, nothing worked.

I realise: it seems that I need additionnal hardware or software.
I try to download Bitcloud SDK from Atmel, after registering twice, i did'nt see a link to download an EXEC of Bitcloud.

For me it seems that I need a programmer, because it looks like a simple Zigbit has no program inside to run it, only stater kit has it but It is quite impossible for me to have a starter kit now.

I please you help to handle my Zigbit module
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 25, 2010 - 11:17 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
I connect 1 Zigbit through the USB serial TTL-232R-PCB TO the Hyper terminal of PC so I can use AT command, but, As I did it, nothing worked.
What pins exactly you connected?

newjou wrote:
i did'nt see a link to download an EXEC of Bitcloud.
SDK is a ZIP file, not exec. If you manage to get .zip about 70Mb in size - that's it.

newjou wrote:
For me it seems that I need a programmer, because it looks like a simple Zigbit has no program inside to run it
ZigBit has serial bootloader programmed. PC-part of bootloader is in SDK, you need working serial connection to module and reset button. Reset button may not be necessary for the first programming since only bootloader is running, but it will be required for the next one.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 12:49 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Quote:
What pins exactly you connected?


I connect
TXD-USB to 13: TXD zigbit
RXD-USB to 14: RXD zigbit
RTS#-USB to 15: RTS
CTS#- USB to 16: CTS

GND- USB to 9: zigbit
VCC-USB to a pot from 5V to 3,5V to 24: zigbit
I download driver of USB and I opend Hyp terminal but I did'nt see Baud rate, so i ll try to update my hyper termianl


Quote:
If you manage to get .zip about 70Mb in size - that's it.


I try to dowload SDK from this website
http://www.atmel.com/dyn/general/tech_d ... c_id=12052

but it direct me in this one
http://www.atmel.com/dyn/products/tools ... ol_id=4495

so, it gives only datasheet or register without download, please do you have the right link for that?

thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 25, 2010 - 01:04 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

You need to download "BitCloud SDK for ZigBit 900 modules/RCBs" (name is incorrect, it also includes SDK for 2.4GHz ZigBits). Tech support guys said that right now there are some technical difficulties with this download. Try again later.

Your connections seem to be correct, get SDK and try bootloader.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 01:36 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


thanks Alexru,

I will check when the SDK will be available on the website.

So, without, SDK i can't use zigbit even with hyper terminal?
Because if fnaly, SDK is not avalable, is there any other possibility to use Zigbit module?

Thans
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 25, 2010 - 01:40 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
So, without, SDK i can't use zigbit even with hyper terminal?
What do you want to do with it? Module is produced and supposed to be programmed, so it does not contain any program by default (except for bootloader).
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 01:57 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


In fact,
i want to built a network with 8 zigbit module.
I bought 2 to test I/O and CAN.

If it works I will measure and display temperature, pressure, and home automation (in 1km).

The developpement kit of Meshnetic allowed to handle 3 zigbit with AT command through Hyper terminal. But as developpement kit does'nt exist including his price so high,
I am looking for all tool I may need to run my projet with Zigbit.
If internal bootload is not enough, I may need additionnal programmer like JTAG?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 25, 2010 - 02:06 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
If internal bootload is not enough, I may need additionnal programmer like JTAG?
Internal bootloader should be enough, but you still need SDK to get PC bootloader and SerialNet.srec file to program into ZigBit.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 02:28 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


In case SDK is not on the website ASAP,
does some body who has it can send it by email?

SerialNet.srec is include in bitcloud SDK?

thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 25, 2010 - 02:55 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
In case SDK is not on the website ASAP,
does some body who has it can send it by email?
Sure, I've downloaded it while it still was available. I have it at home and as soon as I get there I'll attach them here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
sandmann
PostPosted: Oct 25, 2010 - 03:39 PM
Rookie


Joined: Dec 29, 2009
Posts: 34


You find it attached.
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 04:06 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Thank you Alex,
I have the file now, I will be looking for the SDK to stat with test.

Please, how am I suppose to joint SerialNet_RF230 with SDK?

thank you again for your great support
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 25, 2010 - 05:15 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
Please, how am I suppose to joint SerialNet_RF230 with SDK?
Here is bootloader and SerialNet from latest SDK. Run bootloader, tell it your COM-port and point it to .srec file. If UART connection works then module will be programmed with SerialNet and will be able to work with AT-commands.

PS: I'm not allowed to attach files more than 2MB in size, so here is the link to download: http://dl.dropbox.com/u/6121480/sn_bootldr.zip
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
spincraft
PostPosted: Oct 25, 2010 - 06:34 PM
Wannabe


Joined: Sep 09, 2010
Posts: 85
Location: san diego CA US

Hi,

I am following this thread and want to add some info. Just in case you need to connect up to a Dragon via JTAG, here is the JTAG connector to ZigBit A2 module pinout.
Code:

JTAG   Name   Description   ZigBit A2 pin#
Pin#         
1      JTAG_TCK    Scan clock      29
2      JTAG_GND    Digital ground    22, 23
3      JTAG_TDO    Test data output    28
4      JTAG_VCC    Controller supply volts     24,25
5      JTAG_TMS    Test mode select    26
6      JTAG_RST    Reset; active low    8
7       N_Cont     Not connected    n.c.
8       N_Cont     Not connected    n.c.
9      JTAG_TDI    Test data input    27
10     JTAG_GND    Digital ground    22,23

I hope someone with more experience than I will check this info to be sure.
Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Oct 25, 2010 - 08:36 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hi ALex,
thak you a lot I m really proud to stard sharing information with the Zig, I Will start working on my projet may be soon
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Oct 26, 2010 - 11:57 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hello!

I started sharing sharinf information like lighting a Led, but when I enter differents command to communicate with and other Zigbit, the zigbit return Ok until I enter AT+AUTONET=1Z, instead of returning EVENT:JOINED, the hyper terminal remain STATIC and it becomes impossible to enter any command until I reset the entier modul Zigbit and restard again.

Do you have a solution please?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 26, 2010 - 12:05 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
Do you have a solution please?
Correct command is "at+wautonet=1", what module says in response to "ati" command?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 26, 2010 - 12:24 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


I didn't use "ATI" yet, I don't know it yet,

I was in the first module.

Is the Hyper terminal enough to contrôl Zigbit? because I will like to use time, CAN, interrup...
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 26, 2010 - 12:33 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
I didn't use "ATI" yet, I don't know it yet,
Well, use it Smile

newjou wrote:
Is the Hyper terminal enough to contrôl Zigbit? because I will like to use time, CAN, interrup...
Of course not, ATmega1281 that is inside ZigBit does not have CAN support. To use timers, interrupts, etc you'll need full SDK and program in C.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 26, 2010 - 12:35 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


I m using the first module,

When I enter command "at+wautonet=1" the answer is OK not "event: joined" I waited.
I will now do the same with the second Zig in the same computer hopping to see "EVENT:CHILD_JOINEDxxxxx)
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 26, 2010 - 12:39 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
When I enter command "at+wautonet=1" the answer is OK not "event: joined" I waited.
Well, you have enabled autonetwork feature, event will be raised on the other device.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 26, 2010 - 02:28 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


thank for your answer,

instead of AT+WAUTONET=1Z
I used AT+WAUTONET=1 and the hyper terminal is not static but does'nt display EVENT:JOINED

ATI command though displays (bitcloud, zigbit, serialNet and the address 00000001 of the fisrt Zig modul)

In the same PC i plug the next modul and follow the instruction but the last command "AT+WAUTONET=10 Z" dose'nt work, i just use " AT+WAUTONET=10" without "Z"
no EVENT: JOINED CHILD is mentionned thus i can't test the communication between 2 moduls.
When I try the command "AT+WNWK" it states "ERROR"

Do I need 2 PC?
How can I check the communication until it mention EVENT: JOINED?
Does any other possibility exist to test communication?

Quote:
you'll need full SDK and program in C
I will keep checking if there is full SDK on the website but it seems not available since...
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 26, 2010 - 02:48 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
I used AT+WAUTONET=1 and the hyper terminal is not static but does'nt display EVENT:JOINED
To join a network you need to have coordinator or setup this one as coordinator. Show exact commands you enter on devices.

newjou wrote:
ATI command though displays (bitcloud, zigbit, serialNet and the address 00000001 of the fisrt Zig modul)
I need EXACT output, I need to know version numbers, different versions have different bugs.

newjou wrote:
In the same PC i plug the next modul and follow the instruction but the last command "AT+WAUTONET=10 Z"
What instruction? autonet is a binary parameter it can be 1 or 0, 'Z's are something that should not be there at all. Download official SerialNet manual from Atmel site.

To setup modules you need to enter series of commands. What commnds - see documentation.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 26, 2010 - 03:18 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


I am working with this document
http://www.lextronic.fr/~lextronic_doc/Tutorial.pdf

To set the coordinator throw HYPER TERMINAL I entered command as follow:
AT, ATX, AT+GSN=1, AT+PANID=1620, AT+WCHMASK=100000, AT+ WROLE=0 + WSRC=0, AT+AUTONET=1Z,

Then I set the second as router in a new window:
AT, ATX, AT+GSN=2, AT+PANID=1620, AT+WCHMASK=100000, AT+ WROLE=2 + WSRC=55, AT+AUTONET=10 Z,

Impossible to acceptate the command with Z and thus communicate with each orther.

Quote:
I need EXACT output, I need to know version numbers, different versions have different bugs.

ATI
ATMEL
ZIGBIT
BitCloud v.1.10.0; SerialNet v.2.4.0
0000000000000000
OK
the "00000000" change to "000000001" when GSN=1


I used bootload just for connexion in the beginning, and hyper terminal for command
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 26, 2010 - 03:28 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Use next command set:
Code:

coordinator:
AT+WSRC=0
AT+WROLE=0
AT+WPANID=1234
AT+WCHMASK=40000
ATX0
AT+WJOIN

router:
AT+WSRC=1
AT+WROLE=1
AT+WPANID=1234
AT+WCHMASK=40000
ATX0
AT+WJOIN


And get official documentation to know what command exactly does.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Oct 26, 2010 - 03:42 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Thanks,

All command work exept "AT+WJOIN" witch displayed error in both case.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 26, 2010 - 05:08 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
All command work exept "AT+WJOIN" witch displayed error in both case.


You may need to set at+gsn=<unique value> before it.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lightsinthesky
PostPosted: Oct 28, 2010 - 08:05 PM
Rookie


Joined: Jul 16, 2010
Posts: 30


alexru wrote:
newjou wrote:
Please, how am I suppose to joint SerialNet_RF230 with SDK?
Here is bootloader and SerialNet from latest SDK. Run bootloader, tell it your COM-port and point it to .srec file. If UART connection works then module will be programmed with SerialNet and will be able to work with AT-commands.

PS: I'm not allowed to attach files more than 2MB in size, so here is the link to download: http://dl.dropbox.com/u/6121480/sn_bootldr.zip


Thanks for that. I thought the modules came preprogrammed with the serialnet application. I guess that explains why I've been having so many problems! Smile

Now I can communicate with the module via usb! YAY!!
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Nov 04, 2010 - 07:13 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hello,

Can somebody tells me the different between logical addres (WSRC) and MAC adress (GSN)?
Do I need always boths of them for my application?

Because my network plants when I leave (Wleave) but it is impossible to join the net again unless I reset all device.

Thank
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 04, 2010 - 07:24 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
Can somebody tells me the different between logical addres (WSRC) and MAC adress (GSN)?
WSRC is a short (16 bit) address which should be unique in the particular network, GSN is an extended address (64-bit) which should be world-wide unique and range.

newjou wrote:
Do I need always boths of them for my application?
Yes, they both important for proper operation of ZigBee network.

newjou wrote:
Because my network plants when I leave (Wleave) but it is impossible to join the net again unless I reset all device.
Don't see how it is connected with the fact that there are two kinds of addresses.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Nov 04, 2010 - 07:54 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Thank you Alex,


about GSN for example, can I define Cordinator: GSN=1 (0 reserved), Router1: GSN=2, End device:GSN=3? So for DATA to be send we only use logical address? (ATD 0,1,5) What is the useful of GSN?

Please why can the Hyperterminal plant?
if is not from address.
Is it wait time? sometime a simple DATA is transmitted normaly. After some instruction, the same DATA to be transmitted plant.

How can we do without RESETING the all device?

Thank
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Nov 04, 2010 - 09:41 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


In fact I notice that GSN identifie each module in the net and WSRC is used to communicate between each module on the net.

I finaly notice that one of my Zigbit module loses all configuration everytime after configuration (less than 2 or 3 min) I checked configuration register to noticed it when the network was lost. I don't knw why it does so.

I m now study how to programm the module in C with time, interrupt... The Bitcloud SDK (if I remember can include "C") for Zigbee seems not to be available any more in atmel because I register to download several time, it still ask to register again.

Does any one have an other solution to programme Zigbit or a link to dowload SDK bitcloud?

I can now use most command throw hypperTerminal.thank you for your great help Alex

+++
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 04, 2010 - 09:50 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
In fact I notice that GSN identifie each module in the net and WSRC is used to communicate between each module on the net.
SerialNet exposes very little of real ZigBee, they both can be used to communicate, but not in SerialNet. The analogy here is GSN is a MAC address and WSRC is an IP address.

newjou wrote:
seems not to be available any more in atmel because I register to download several time, it still ask to register again.
There were problems with download few days ago, but now it should be fine.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Nov 05, 2010 - 11:48 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Please can you provide me the available link?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 06, 2010 - 06:51 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
Please can you provide me the available link?
Here is direct link http://www.atmel.com/dyn/resources/prod_documents/BitCloud_ZIGBIT_1_10_0.zip
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Nov 26, 2010 - 09:09 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hello,

I am trying to developpe custum application with zigbit mobule now but I face to a problem.

I Started using SerialNet. It only allow me to test Communication between Zigbit module and it was helpfull to light LED in a module through the same module or an other module. It also help me to check if a button is pressed or not. But not to contrôl a LED with a button.
Does the SerialNet could do better than that?

Here is the main problem.
I upload the blinking example to midified the frequence and to contrôl de output through the input, unfortunatly I did'nt see where to:
- Define PORTGPIO as input or as output.
- Modifie the timer
- Change an output according to the input

I see function who contrôl LED
Code:
void APL_TaskHandler(void)
{
...
static void blinkTimerFired()
{

I went in blink.h and ZDO to check if a can have acces to input but noway, I went in AppFrame.h with is include in ZDO, noway too.

Here is my question:
- Where is it possible to get access to I/O and configure them?
- Where can I modified the time of blinking?
- does "appToggleLed" are instruction or function?

- Does button has any effet on blink application?
because I check it while seing this code and have no effect
Code:
#ifndef _BUTTONS_
static HAL_AppTimer_t changeBlinkTimer;                     // Buttons emulation timer.
#endif //#ifndef _BUTTONS_


Thank you for your great care
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 26, 2010 - 11:47 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
But not to contrôl a LED with a button.
Does the SerialNet could do better than that?
Not directly, but it is possible using host controller.

Your questions are kind of general and I don't even know where to start.

newjou wrote:
Here is my question:
- Where is it possible to get access to I/O and configure them?

Use macros from gpio.h

newjou wrote:
- Where can I modified the time of blinking?
In Configuration file.

newjou wrote:
- does "appToggleLed" are instruction or function?
Use search, it will answer most of your questions. appToggleLed() is defined in blink.h.

newjou wrote:
- Does button has any effet on blink application?

Yes, they change period of blinking.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Nov 29, 2010 - 08:33 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hello,
when i started to modifie de app blink.c I noticed i have to modifie "appTimer.h or .c, blikn.h, ZDO"
when I got to the file to modifie I noticed I would go to appclock etc... and finaly I found it was'nt eseay to modifie the application through too musch file.

I follow the advice Zigbit without meshbean to modified blink.c without getting in other file so i don't have any include, I copie each function(ex BSP...) but I allways have ERROR for compilation.

how can I do to compil blink without having error depending on Meshbean board?

I better like a simple programm where I can
Configure in the same file
- PORT GPIO
- Interrup
- Timer

Is that possible?
Does somebody has a simple programm doing that?

Sorry for these questions and thank you for your help.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 29, 2010 - 08:54 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
Hello,
when i started to modifie de app blink.c I noticed i have to modifie "appTimer.h or .c, blikn.h, ZDO"
when I got to the file to modifie I noticed I would go to appclock etc... and finaly I found it was'nt eseay to modifie the application through too musch file.
Please setup spell-checker. Up there is a mess of words which does not make any sense, to me at least. Why would someone want to read your messages if you haven't put much effort into writing them?

newjou wrote:
but I allways have ERROR for compilation.

how can I do to compil blink without having error depending on Meshbean board?
Read error messages and resolve errors.

newjou wrote:
Is that possible?
Yes, but you need to make at least some effort. What is your final goal?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Nov 29, 2010 - 10:07 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Thank you for your attention!

here is my project:
I have to make 3 robots.
They have to communicate toghether to move a load.

How do they do that?
A test should be check to identifie if all three robot are in the same line.
If YES they push a load just by moving forward
If NO, Robot out of line should joint the line

Each robot are contrôle by Zigbit ATZB-24-A2.

How are Robot contrôl?
their wheel are trundle by servomotor
If Zigbit send an impuls of
- 1mS Servomotor turn in right way for example
- 2mS Servomotor turn in left way
The gap between each impul define the speed of servomotor but it should be around 20mS

How am I wanted to set sofware?
First:
to move the robot foward:
- Use GPIO.0 as output for wheel_1 to generate 2 timer, Timer1 for 1ms and Timer2 for 20mS
- Use GPIO.1 as output for wheel_2 to generate 2 timer, Timer1 for 2ms and Timer2 for 20mS

To move the robot backward I just need to remplace 1mS by 2ms and 2ms by 1ms.

to control speed:
- modify timer2 between 15ms and 500ms
-------------
Second:
Controle de displacement of robot
(by TEST in the Zigbit use for current Robot)
- By an input to enable foward or bacward (GPIO.0 and GPIO.1)
- contrôl the speed by and input (increment or decrement Timer2)

(reality contrôl the current Zigbit from a coordinator)
- By simple remote contrôl wich include one Zigbit (Coordinator).
Coordinator has theses functions:
°° Enable foward or bacward (GPIO.0 and GPIO.1)
°° Contrôl speed (increment or decrement Timer2)
---------
Third:
Include sensor inside ROBOT to detect its position.
If ROBOT are in the correct line it sends an signal to coordinator and STOP. If not it moves on right or left accordind to it position.
Once all robot send "ok" to coordinator they move forward
that all.

As I don't have a particular DATASHEET of Zigbit (PORT, timer, interrupt)I takes me too much time to manipulate Zigbit.

TO ACHIEVED THAT PROJECT I WANTED TO
- use simple application in one Zigbit (set Input/output, timer and interrupt)
- Set a net with coordinator and router
- Finaly build my application

What I did before?
I used SerialNet where I could
- established a netword between Zigbit
- Set input/output
- Light a LED in Router by coordinator
But all these was useful but not enough to make my projet.
I test blink application where I was just able to modifie de blink interval.

thank you for your care

IF NOT POSSIBLE IN THE TIME ALLOW FOR THE PROJECT
I use PIC Controler from microchip whithout remote control but the zigbit was required at first.

I hope it is undestandable but I will try my best to be clear in a part that is not enough clear.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 29, 2010 - 11:45 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
If Zigbit send an impuls of
- 1mS Servomotor turn in right way for example
- 2mS Servomotor turn in left way
So direction is controlled by impulse width? What kind of servo it is?

Where did you get such approach to controlling robots in general? It is somewhat unorthodox and I have doubts that it will work at all.

newjou wrote:
As I don't have a particular DATASHEET of Zigbit (PORT, timer, interrupt)I takes me too much time to manipulate Zigbit.
ZigBit has atmega1281 inside, datasheet for it is available.


Macros for manipulating GPIOs are located in gpio.h file. Or you can use regular AVR instructions to access ports. There is nothing specific to BitCloud.

BitCloud application timers have 10 ms resolution, so you need to use hardware AVR timers, nothing specific to BitCloud either.

So basically feasibility of the project depends on how familiar you are with AVRs.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Nov 29, 2010 - 12:59 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Quote:
So direction is controlled by impulse width? What kind of servo it is?

exactly. I use a S3003 FUTABA. I modified the servo wich normaly rotate 180° so that it make a full rotation. The command of the robot depends on the type of engine who pulls it.
Quote:
ZigBit has atmega1281 inside, datasheet for it is available.
I have Datasheet but it is difficult to adapt intruction of ATMEGA1281 to zigbit taht is why i asked for a simple code wich show me how to use
DDxn: to set direction of pin
PORTxn: to set the state of output
sei: Enable or disable interrupt
OC0A: Output compare for timer
TIFR0: timer Interrup flag
TCNT0: timer counter register
Configure frequence, Watch dog...
In fact i can use it in a regular atmega controler.
Quote:
Macros for manipulating GPIOs are located in gpio.h file. Or you can use regular AVR instructions to access ports
I am afraid to modifie that file I wanted to use all instruction in the same file. Here is a part of code in gpio.h where i found DDR and PORT register
Code:
#define HAL_ASSIGN_PIN(name, port, bit) \
INLINE void  GPIO_##name##_set()         {PORT##port |= (1 << bit);} \
INLINE void  GPIO_##name##_clr()         {PORT##port &= ~(1 << bit);} \
INLINE uint8_t  GPIO_##name##_read()     {return (PIN##port & (1 << bit)) != 0;} \
INLINE uint8_t  GPIO_##name##_state()    {return (DDR##port & (1 << bit)) != 0;} \
INLINE void  GPIO_##name##_make_out()    {DDR##port |= (1 << bit);} \
INLINE void  GPIO_##name##_make_in()     {DDR##port &= ~(1 << bit); PORT##port &= ~(1 << bit);} \
INLINE void  GPIO_##name##_make_pullup() {PORT##port |= (1 << bit);}\
INLINE void  GPIO_##name##_toggle()      {PORT##port ^= (1 << bit);}


Quote:
BitCloud application timers have 10 ms resolution, so you need to use hardware AVR timers, nothing specific to BitCloud either.

I will finaly use an other contrôler for servomoteur to generate timer. The input to genrate timer will be connect to GPIO as "0" or "1" output.
The Zigbit will be use for communication. That way I think i can go faster than using Zigbit for 1ms impuls

If it is possible, I will just need a basic application to set I/O in the same file of my projet and avoid as much as possible modifiying and other file

Thank you
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Nov 29, 2010 - 01:11 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Quote:
but it is difficult to adapt intruction of ATMEGA1281 to zigbit
You don't need to adapt anything, just use them as you would use them regularly.

Quote:
sei: Enable or disable interrupt
This should not be done, global interrupt enable flag should be enabled at all times. Use individual modules interrupt enable flag to control interrupts from them.

Quote:
I am afraid to modifie that file
You don't need to.

Code:

#include <gpio.h>

GPIO_1_make_out();
GPIO_1_clr();
// etc


Quote:
If it is possible, I will just need a basic application to set I/O in the same file of my projet and avoid as much as possible modifiying and other file
You don't need to modify anything, just add your code to blink or another application.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Dec 01, 2010 - 12:17 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Thank you sooo much.

I noticed that "void APL_TaskHandler(void)" is the main of aplication, whithout it, no compilation is possible!
I removed all instruction inside "APL_TaskHandler" and all other function exept ZDO function because when I remove ZDO function the compilation is not possible.
I set up my own I/O so I can light a LED, create my own blink application with or whithout timer.
How many time last one intruction? (One cycle intruction is 4 clok periode in a regular controler).

I set interrupt but it does'nt work this is how I did
Code:
#include <irq.h>
#define   interruption   GPIO_IRQ_7_read()
void APL_TaskHandler(void)
{
IRQ_FALLING_EDGE; // interruption actif à l'état bas
int HAL_EnableIrq(HAL_IrqNumber_t GPIO_IRQ_7);// autoriser les interruptions   
if(interruption==0)
interrupt(); }

interrupt() has the instruction in case of interrution in falling edge. Please where is wrong inside?

I have an other problem wich is not really disturbing. when I compil I have this message "Coordinator: Error when trying to make JTAGICE target device enter programming mode and Coordinator: error loading object file" but when I "clear current configuration (F12) in AVRSTUDIO" the compilation is good. Is it possible to cancel this error?
I will now set nework between Zigbit
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 01, 2010 - 06:07 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
I set interrupt but it does'nt work this is how I did
Code:
#include <irq.h>
#define   interruption   GPIO_IRQ_7_read()
void APL_TaskHandler(void)
{
IRQ_FALLING_EDGE; // interruption actif à l'état bas
int HAL_EnableIrq(HAL_IrqNumber_t GPIO_IRQ_7);// autoriser les interruptions   
if(interruption==0)
interrupt(); }

interrupt() has the instruction in case of interrution in falling edge. Please where is wrong inside?
Start by learning C, I don't even know where to start commenting that code, it is wrong from the top and all the way through. It should not even compile. Or read how it is done in BSP.

newjou wrote:
I have an other problem wich is not really disturbing.
You should really resolve first problem first.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Dec 06, 2010 - 09:12 PM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hello,

After getting more information from BSP I had instruction to set interruption. I could not run it because of the last instruction to enable interruption after the interrupt function is exécute.


Code:
   #include <irq.h> // header for interrupt
#define BSP_readKEY0() GPIO_IRQ_6_read() // PORT interrupt select

// In the APL_TaskHandler
{
HAL_RegisterIrq(IRQ_6, IRQ_LOW_LEVEL, bspKey0InterruptHandler); // interrupt config
   HAL_EnableIrq(IRQ_6);// enable interrupt
}

void bspKey0InterruptHandler(void)//  run this function in case of interruption
   {
     HAL_DisableIrq(IRQ_6);// disable interrupt
   GPIO_0_toggle();   // INSTRUCTION
   intervaltimer /=2;
  bspPostTask0(BSP_BUTTONS);// Clr interrupt flag                  
   }


Please wich argument can I send to bspPostTask0(xxxx);instead of BSP_BUTTONS?
Is it automatic that an action in BSP_readKEY0()will set the interruption or I need to read it first in APL_TaskHandler?

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
newjou
PostPosted: Dec 07, 2010 - 12:35 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


HELLO AGAIN!!!Smile

I m really please to handle a Zigbit module thank to your great help. Very Happy
As the resolution of Zigbit is 10mS, I used a PIC contrôler to drive Servomotors (1ms and 2 ms) using a timer and it works very well now (foward, bakward, left right). I will used USART (13 - 14) of Zigbit to exchange DATA between both controler.

According to network, I will be learning how to light a LED from one Zigbit to an other like I did with AT command.

Between all sample application of bitcloud, wich one is best describe to esealy be modifie for this purpose( I am using one coordinator and 3 router)


Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 07, 2010 - 06:49 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
bspPostTask0(BSP_BUTTONS);// Clr interrupt flag
It is not "Clr interrupt flag" it. This functions tells task manager to schedule and run BSP task. That task will check if button is released and will re-enable an IRQ.

newjou wrote:
Please wich argument can I send to bspPostTask0(xxxx);instead of BSP_BUTTONS?
Any you want, given that you'll also provide corresponding task handler function.

newjou wrote:
Is it automatic that an action in BSP_readKEY0() will set the interruption or I need to read it first in APL_TaskHandler?
I don't understand you here. BSP_readKEY0() just reads current state of pin, that's all.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
alexru
PostPosted: Dec 07, 2010 - 06:52 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

newjou wrote:
As the resolution of Zigbit is 10mS,
Resolution of application timers is 10ms, you still can use hardware timers as you did on PIC and get whatever resolution you like.

newjou wrote:
Between all sample application of bitcloud, wich one is best describe to esealy be modifie for this purpose
They all will require modifications, but closest ones are Peer2Peer and LowPower, I guess.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
newjou
PostPosted: Dec 08, 2010 - 09:01 AM
Rookie


Joined: Oct 02, 2010
Posts: 39


Hello!
After reading samples applications, I found that "lowpower" is interresting for sending data from coordinator to end device.
But config depends on MESHBEAN board which defines the role of each board by short adress config by dipswitch. As lowpower has 3 files (end device, coordinator and lowpower) but only one .srec to fire the zigbit, please how can I create only 2 projects (one for coordinator and one for router) with generates their own .srec file without loosing AVR parameter? . I also want to avoid a modification inside configuration and Makefile related with lowpower application.
The solution I adopt was to modified peer2peer because it only has 1 file. I can do 2 copie


My second great need is to include lest file in one projet and configure all parameter in the same file.
Here is the parameter of coordinator. Please, how can set //Data request ATX0 and joining procedure WJOINI
at the end of this code? (please also have a look on my coordinator config
Code:
void init_coordinator (void)
{
CS_DEVICE_TYPE_ID=0                 // WROLE=0 --> 0for coordinator  (1 if router)
CS_NWK_ADDR_ID=0                    // WSRC=0 --> local adress for coordinator  "1" for the first router "2" for the second...
CS_EXT_PANID = 0xAAAAAAAAAAAAAAAALL //WPANID=0x---LL.. Was 1234 in AT command
CS_MAX_CHILDREN_AMOUNT   3          // 3 Router are used for project
CS_NEIB_TABLE_SIZE = 3              // Each router has 3 device???
CS_MAX_CHILDREN_ROUTER_AMOUNT = 0   // Coordinator has no parent router will have 1
CS_ROUTE_TABLE_SIZE = 3             // 3 report be sent to coordinator "0" for router
CS_END_DEVICE_SLEEP_PERIOD = 10000  // Not necessary bcs no end device
CS_CHANNEL_MASK = 40000             // WCHMASK=40000
CS_CHANNEL_PAGE = 0                 // WCHPAGE=0 BPSK modulation
CS_RX_ON_WHEN_IDLE = true           // Never sleep because coordinator
CS_NWK_UNIQUE_ADDR_ID = false       // Be avoid
// No security
// ATX0                          //
// AT+WJOIN

}
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 08, 2010 - 01:05 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Generally there will be no easy path, you'll have to understand how things work. LowPower is not bound to MeshBean, if you study code you'll find that there is a way to make LowPower to use defined value instead of switches.

Again, your code is not valid C code. As for parameters values:
Code:

CS_MAX_CHILDREN_AMOUNT   3          // 3 Router are used for project
CS_MAX_CHILDREN_ROUTER_AMOUNT = 0   // Coordinator has no parent router will have 1
Comments and values are contradicting each other, I don't know which is valid.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lst111
PostPosted: Jan 13, 2011 - 02:41 PM
Newbie


Joined: Jan 13, 2011
Posts: 7


Hey guys!I`m testing Zigbit modules. I was reading what You wrote here and I`ve got a question. How can I get this different code you show. I know how to test, bootload modules but never changing and write any code. Is there any Zigbee profiles i can get somewhere or build on my own and load that on modules adding that to Zigbee stack?? What language it support? How it works? is it only a application layer code kinda script? Thank You in advance for Your help.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 14, 2011 - 06:12 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Download SDK and look what sample applications there are. They all written in C.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lst111
PostPosted: Jan 14, 2011 - 09:55 AM
Newbie


Joined: Jan 13, 2011
Posts: 7


Thank You Alex. Could You explain me in short how can I load that to my Zigbit modules. Is it possible to do that by this bootloader I`ve used to load serialnet? Sorry I`m not good programmer I know so so C but I don`t have a clue how put code into my modules( I suppose sth to do with makefile;)) Really appreciate Your help.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 14, 2011 - 11:51 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

lst111 wrote:
Thank You Alex. Could You explain me in short how can I load that to my Zigbit modules.
Before loading you need to compile applications, and it is not trivial to explain. In a few words: you need to run "make clean all" in the directory with Makefile in it. But you need to understand what you are dong to read possible error messages.

lst111 wrote:
Is it possible to do that by this bootloader I`ve used to load serialnet?
Yes, after compiling you'll get .srec file.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 02:12 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


Hi,

I begin a test with Zigbee, I have a RAVEN kit and one Zigbit module ATZB-24 A2 (dual chip antenna)
I have programed (JTAG) the AT90USB1287 with BitCloud_ATAVRRZRAVEN_1_10_0 WSNDEMO code to set this stick in coordinator and one of RAVEN module in router mode and the last in end-device.
When I run WSDEMO, my network is drawing correctly.
Now I want include my Zigbit module in this network, I program it with BitCloud_ZIGBIT_1_10_0 to set my module in End-Device mode.
When my zigbit start, the LED blink and staying 'on' (according to the documentation, the module have join the network) but the end-device isn’t appeared in WSNDEMO.

For information:
- For the Zigbit module, I have just plug the power supply, the JTAG and 1 LED on GPIO0
- I have the same CS_EXT_PANID = 0xAAAAAAAAAAAAAAAALL
- And I have added this code in WSNDemoApp.h
Code:

#undef _TEMPERATURE_SENSOR_
#undef _LIGHT_SENSOR_
#undef _BATTERY_SENSOR_
#undef _SLIDERS_
#undef _BUTTONS_
#undef _LCD_

Can you say me if it’s possible to display this module in WSNDEMO and if my approach is the good one?
Thank in advance.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 14, 2011 - 03:11 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Ludo wrote:
When my zigbit start, the LED blink and staying 'on' (according to the documentation, the module have join the network) but the end-device isn’t appeared in WSNDEMO.
It probably assumed the role of coordinator and started new network. You need to change APP_DEVICE_TYPE if you don't have sliders.

Ludo wrote:
And I have added this code in WSNDemoApp.h


Also add "#define OMIT_READING_SENSORS".
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 03:17 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


Thanks for your quick answer !
I have already change the APP_DEVICE_TYPE = DEV_TYPE_ENDDEVICE
I will try to add “#define OMIT_READING_SENSORS"
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 14, 2011 - 03:24 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Ludo wrote:
Thanks for your quick answer !
I have already change the APP_DEVICE_TYPE = DEV_TYPE_ENDDEVICE


To check if it is really end device disable all other nodes and this one should continuously blink.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 03:39 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


yes it's the case, when I stop the coordinator, the LED blinking
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 14, 2011 - 03:42 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Ludo wrote:
yes it's the case, when I stop the coordinator, the LED blinking
Then check that CS_UID parameter is different on all devices.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 04:24 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


I have add “#define OMIT_READING_SENSORS" but no changes
 
 View user's profile Send private message  
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 04:26 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


CS_UID = 0x4LL for Zigbit
CS_UID = 0x2LL for Raven End-Device
CS_UID = 0x0LL for coordinator
 
 View user's profile Send private message  
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 04:32 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


I don't know what I have doing but now the LED blinking if coordinator is down and "off" when the coordinator is "on"
 
 View user's profile Send private message  
Reply with quote Back to top
Ludo
PostPosted: Jan 14, 2011 - 05:00 PM
Newbie


Joined: Jan 14, 2011
Posts: 8


I have clear all test and download a new bitcloud package to restart from scratch.
now it's working !
the LED is "Off" when the module joining network but my module appearing in wsndemo.
Alexru, thanks a lot for your help !!

Ludo
 
 View user's profile Send private message  
Reply with quote Back to top
lst111
PostPosted: Jan 25, 2011 - 02:30 PM
Newbie


Joined: Jan 13, 2011
Posts: 7


Hey guys! I`ve got a question. I have a network 1 coordinator and 1 end-device. And if i set end-device to the sleep mode how can I wake it up? I use serial net to manage my network. Duty cycle on end device sleep/active what I put into by command at+wpwr is 6000,0 what means it`s always active until i enter command wsleep and it is in sleep mode by 10 minutes. Can I wake it up before this 10 minutes I mean Can I wake it up by using any ping from coordinator or other dates from coordinator or in other way?? Anyone knows how to measure wake-up time using scope or other stuff? Thanks in advance.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 25, 2011 - 02:35 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

lst111 wrote:
Can I wake it up before this 10 minutes I mean Can I wake it up by using any ping from coordinator or other dates from coordinator or in other way??
No, that's the point of sleeping. Bur you can wake up device by asserting DTR pin.

lst111 wrote:
Anyone knows how to measure wake-up time using scope or other stuff? Thanks in advance.
Depends on what you need it for. One way is to measure power consumption.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lst111
PostPosted: Jan 26, 2011 - 12:21 PM
Newbie


Joined: Jan 13, 2011
Posts: 7


Thank You Alex for Your help. Now I decided to test a DTR line. Normally I have PCB where I use only TX and RX of RS232. It is enough only to send a command and managing of nodes. Now I connect in addition line from dtr ft232 to pin 37 of my atzb-24-a2 but it doesn`t work. Do I need other lines of rs232 to make dtr working right?? Dtr is active low according to serialnet reference manual and is setting by at&d1 command and i set that. I`ve tried just to connect pin 37 of module to ground to force wake-up after sleeping node but it doesn`t wake up. How it should looks like? Any ideas?? Regards Lukas
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 26, 2011 - 12:45 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Connecting only DTR pin should be enough. Can you post complete list of command you enter on both devices?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lst111
PostPosted: Jan 26, 2011 - 12:56 PM
Newbie


Joined: Jan 13, 2011
Posts: 7


my settings

Coordinator
ATX
at +GSN=1
at+WPANID=1620
at+WCHMASK=00000800
at+WROLE=0
at+WSRC=0
at+WJOIN
at+WAUTONET=1

End device
atx
at +GSN=2
at+WPANID=1620
at+WCHMASK=00000800
at+WROLE=2
at+WSRC=2
at+wpwr= 6000,0 (10 minutes sleep if put at+wsleep, normally always active)
at&d1
at+WAUTONET=1
at+WJOIN

And when network is established i make on enddevice sleep mode using a command at+wsleep and I can`t wake it up even when I connect dtr pin to ground or VCC.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 26, 2011 - 01:01 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

One thing I see is that you need to have the same settings for +wpwr on both C and ED (see manual for explanations). But this is not connected to a problem at hand.

I'll check this and write back.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lst111
PostPosted: Jan 26, 2011 - 01:09 PM
Newbie


Joined: Jan 13, 2011
Posts: 7


Other thing is that I connect with my module using a ft232rl there is a line like dtr so should I connect directly dtr from ft232 to pin of my atmel 37?? Sometimes it is properly to connect Capacitor to eliminate a constant-voltage component like here http://electronics-diy.com/electronic_s ... php?id=923 What do You think? But anyway I was testing pin 37 by connecting that directly to ground and VCC.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 26, 2011 - 02:04 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

I can't make it work either, maybe something is wrong there, I've never used this feature nor I've ever seen how it works.

Contact avr@atmel.com, they might know better.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
lst111
PostPosted: Jan 26, 2011 - 09:05 PM
Newbie


Joined: Jan 13, 2011
Posts: 7


Now in my case it works but only manually, connecting a pin 37 to ground.( earlier it was just not visible, break- not connected pin with pad on board) but dtr still doesn`t work. I will try to get information from atmel. If i get know sth i would inform You as well. Thank You Alex.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 26, 2011 - 09:10 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

lst111 wrote:
Now in my case it works but only manually, connecting a pin 37 to ground ... but dtr still doesn`t work.
So does it work or does not?

I've spoken to a FAE and he confirmed that DTR wakeup works. I was checking it on ZigBit mounted on MeshBean and there is an error on the board that prevents it from working. But it should work on a standalone ZigBit module.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Mar 15, 2011 - 10:39 AM
Newbie


Joined: Jun 14, 2009
Posts: 15


Hi,
I have some problems, I think is something wrong with my application which is uploaded to the modules. I made myself boards with leds,sliders and USB<->RS232 converter.I uploaded blink sample application with added in configurationfile CS_UID ones 0x1ll and second 0x2ll. And modules don't talk together-> they blink asynchronous.Should I do something more? I don't know what to do now. I tried with many configurations
->changed device type , short adres scholastic and different static also in ConfigServer.h.

Anyone knows what I do wrong?

Regards,
Qbo

*EDIT
I won't go further with my own application if I won't be sure if is everything ok with my hardware.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 15, 2011 - 10:57 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Qbo_electronics wrote:
And modules don't talk together-> they blink asynchronous.
Well, Blink sample application does exactly what name says, it blinks without starting a network Smile

Try other applications, they actually do something useful with RF-part.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Mar 15, 2011 - 11:39 AM
Newbie


Joined: Jun 14, 2009
Posts: 15


In the begging I though it is something wrong with RF and I checked on scope CPU_CLOCK and its is 8MHz like in configuration file. I tried it compile the files with IAR also. Let me add that layout of the board don't have ground plane on top and bottom under antennas. Now I understand that CS_UID isn't a reason because there is no network at all. I can't check if they really transmit on analyzer because it's DSSS modulation. Could you tell me if there is any reason why this application don't work?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 15, 2011 - 11:46 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Again, Blink does not transmit because it should not. It is written to blink LEDs. Take LowPower application, for example.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Mar 15, 2011 - 12:00 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


Aha, I understood from BitCloud documentation that they should blink synchronously with certain period.. I lost week trying launch this Smile I will now start with low power application.

Thanks Alex for help!
Regards,
Qbo
 
 View user's profile Send private message  
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 01:15 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


Hi there,
I started again play with modules. I uploaded LowPower from BitCloud_ZIGBIT_1_12_0. And there is comunication via air. I changed short adres and CS_UID. Network joins but end device doesn't go sleeps(GreenLed always is on) and doesn't send sensor measurment.Either coordinator doesn't send data by USART. Could you tell me what i do wrong?

Regards,
Qbo
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 20, 2011 - 04:32 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

What hardware do you have?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 05:58 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


That was the problem.I don't have light and temperature sensors. I've changed application in the way it starts from battery and stays in this measurement. I don't use channel 0 for this measurement but channel 1 that why battery.c was modified(HAL_ReadAdc(HAL_ADC_CHANNEL1)). In this channel I have voltage divider but the reading which i get is wrong. I changed reference voltage to AVCC because i use it. I fight with this ADC more then week and i thought i do something wrong but now i don't really understand why the readings are different while I'm using battery code. For example i will give some code of ADC init and measurement which i made before.
Code:

static HAL_AdcParams_t PotentiometrADC=               //descriptor adc
{
    .resolution        = RESOLUTION_8_BIT,
    .sampleRate        = ADC_4800SPS,
    .voltageReference  = AVCC,
    .bufferPointer     = &Buffer.ADCData,
    .selectionsAmount  = 1,
};

and measurement

void ADCmeasurement(void){
   HAL_OpenAdc(&PotentiometrADC);
   HAL_ReadAdc(HAL_ADC_CHANNEL1);
   voltADC = ((Buffer.ADCData *3300ul*2ul)/256ul); 
   
}


Thanks Alex for answer.


Last edited by Qbo_electronics on Aug 20, 2011 - 06:05 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 20, 2011 - 06:04 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

What is "wrong"? Give more information: real AVcc voltage, value of Buffer.ADCData after the measurement.

Battery code applies some scaling after measurement is taken to convert acquired to mV units. Do you take this into account?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 06:06 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


I've updated. It looks like that the divider is resistor with termistor. The measurement don't change at all with temperature.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 20, 2011 - 06:10 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

After HAL_ReadAdc() you need to wait for confirmation callback.

LE: which you don't even fill:
Code:
adcParam.callback = batteryCallback;
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 06:15 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


Ok, I thought about it. But if I changed the battery.c code (in LowPower application) only measurement channel from 0 to 1 the callback stay this same. Am I wrong?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 20, 2011 - 06:26 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

If you change battery.c code, then yes, it will be the same, but this code:
Code:

   HAL_ReadAdc(HAL_ADC_CHANNEL1);
   voltADC = ((Buffer.ADCData *3300ul*2ul)/256ul); 
is just wrong, Buffer.ADCData at this point contains garbage.

Also, conversion formula is different for different reference voltages.

What voltage do you have for AVcc and what is the input voltage?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 06:32 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


In ADC1 pin i've have 2.2 V but it's no problem of conversion formula(I will change it). Now i just won't to make a measurement. Because if i have thermistor and i put near lighted match the voltage which I get should change (in Low power application). I add that I've checked all connections and voltages in hardware and with temperature voltage is changing on adc pin.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 20, 2011 - 06:37 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

I'm asking for the last time, what voltage do you have on the AVcc pin? What reading do you get? How much it is changing? Can you put there potentiometer to get consistent readings?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 06:46 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


I have digital VDD 3.3V thus AVCC I think is filtered digital supply. Voltage is changing 1.5V to 2.2V because its NTC thermistor. It's in 0603 package. But If I short pin to GND reading is this same. Reading which I get via USART is 206 mV.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 20, 2011 - 06:50 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Try without conversion to mV first, to see real ADC value.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 07:01 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


Code:

  value = (batteryControl.batteryData);

I made it and reading is 13. Short to 3.3V or GND has no effect.
 
 View user's profile Send private message  
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 20, 2011 - 07:41 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


I'm confused because I was curious and checked what tells other ADCs channels. At second was reference (253 almost 3.3V) and my multimetr says 0V .Then I back to channel 1 and it was no 13 just 253. Still no response for short to GND. It looks like that it is non volatile value or something wrong with adresses. I'm using IAR.Could it be something with ESD? I play around the hardware for a while. Have you got any other idea?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 21, 2011 - 06:05 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Well, I don't know, it is hard to say without having the hardware. You may try to use direct AVR registers access instead of BitClout API, just to make sure.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 21, 2011 - 07:10 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


I tried today. No effect. Tomorrow I will buy new modules because also must make more nodes. We will see. Thanks Alex for help,have a nice end of sunday.
 
 View user's profile Send private message  
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 23, 2011 - 07:52 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


Hi there, i desoldered old module ad put in this place now one. Everthing works good. I dont know what was the reason. Alex i have a question. When the node goes in the sleep mode(power-down,power-save etc.). I won't to set/clear pin(0,1) and stay in this state(0 or 1) for time when it sleeps or . It is possible?If yes where I can look for it?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 23, 2011 - 08:00 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Sleep modes preserve pins state, set them to whatever value you like, just remember that I/O pins may also drain your battery.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 27, 2011 - 09:12 PM
Newbie


Joined: Jun 14, 2009
Posts: 15


Hi,
I don't understand something. I play with the lowpower application and want to get in all sensor type this same reading. For example I have BSP task handler.
Code:
void BSP_TaskHandler(void)
{
  if (bspTaskFlags & BSP_BUTTONS)
  {
    bspTaskFlags &= (~BSP_BUTTONS);
    bspButtonsHandler();
  }
  if (bspTaskFlags & BSP_TEMPERATURE)
  {
    bspTaskFlags &= (~BSP_TEMPERATURE);
    //bspLM73Handler();
    bspBatteryHandler();
  }
  if (bspTaskFlags & BSP_BATTERY)
  {
    bspTaskFlags &= (~BSP_BATTERY);
    bspBatteryHandler();
  }
  if (bspTaskFlags)
  {
    SYS_PostTask(BSP_TASK_ID);
  }
}

And I have identical read sensor funcitions
Code:

void boardAbstractionReadSensor(AppSensorType_t t, AppSensorCallback_t cb)
{
  if (APP_SENSOR_TYPE_TEMPERATURE == t)
  {
    batteryCallback = cb;
    BSP_ReadBatteryData(batterySensorHandler);
  }
  if (APP_SENSOR_TYPE_BATTERY == t)
  {
    batteryCallback = cb;
    BSP_ReadBatteryData(batterySensorHandler);
    return;
  }
  cb(false, 0);
}

When the network is working reading for battery is right but for temperature sensor is 0. This looks like the buffer(appMessageBuffer.msg.report.value) when reading temp task have result false. Even if I modify in battery.c task -> bspPostTask(BSP_TEMPERATURE); has no reasponse. Could You tell me what I do wrong?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Aug 28, 2011 - 09:24 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

You've forgot to copy "return" statement in the first "if", so it calls callback right away.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Qbo_electronics
PostPosted: Aug 28, 2011 - 09:54 AM
Newbie


Joined: Jun 14, 2009
Posts: 15


Shame on me.. Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
petter@inventech.no
PostPosted: Oct 12, 2011 - 09:47 AM
Rookie


Joined: Oct 12, 2011
Posts: 26
Location: Norway

Hi,
I'm trying out the serialnet democode from the sdk downloaded from atmel on a atzb-24-a2 module(no developer board, custom for my app). when i download over isp i can connect over serial communication at 38400baud and it reply's to command's and everything is fine. but when i put in a bootloader or use the bootloader preloaded on the module. i cant connect at all. the device don't reply to any serial commands.

When i use ISP to transfer the code i use the SerialNet_ZigBit_Rf230.hex file from the sdk, avrisp and AVRStudio 5.0.

when i use bootloader to transfer i use the bootloader provided in the sdk to upload SerialNet_ZigBit_Rf230.srec. in both cases the code is verified and ok on the chip.

Is there any difference to the hex code and the srec code?
or is the bootloading disrupting the code in some way??

Has anyone succededed in uploading the serialnet code using bootloader or is everyone using jtag or isp to upload code?

Anyone got any idea of why i got this problem? Smile
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 12, 2011 - 12:03 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

It should work. Can you program bootloader, upload the image using bootloader and then read back full image?

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
aquafood
PostPosted: Oct 12, 2011 - 07:18 PM
Newbie


Joined: Sep 28, 2009
Posts: 6


Hi,
I am trying to use an ATZb-24-A2.
I made a blinking program.Its source code is:
Code:

#include <avr/io.h>
#include <util/delay.h>

int main(void) {
   DDRG=0xff;
   DDRD=0xff;

   PORTD=0xff;
   PORTG=0xff;

   while(1)
   {
      PORTG=0xff;
      PORTD=0xff;
      _delay_ms(1000);
      PORTG=0x00;
      PORTD=0x00;
      _delay_ms(1000);
   }
}

It is working fine.
I try to write the same program that uses the bitcloud API. Its source code is:
Code:

#include <appTimer.h>
#include <zdo.h>
#include <blink.h>
#include <gpio.h>


static HAL_AppTimer_t blinkTimer;                           // Blink timer.
static void blinkTimerFired(void);                         // blinkTimer handler.

void APL_TaskHandler(void)
{
   
   GPIO_4_make_out();
   GPIO_4_set();   

   GPIO_6_make_out();
   GPIO_6_set();   
      
   GPIO_7_make_out();
   GPIO_7_set();   
   
  // Configure blink timer
  blinkTimer.interval = 2000;           // Timer interval
  blinkTimer.mode     = TIMER_REPEAT_MODE;        // Repeating mode (TIMER_REPEAT_MODE or TIMER_ONE_SHOT_MODE)
  blinkTimer.callback = blinkTimerFired;          // Callback function for timer fire event
  HAL_StartAppTimer(&blinkTimer);                 // Start blink timer
}

static void blinkTimerFired()
{
 
  GPIO_4_toggle();
  GPIO_6_toggle();
  GPIO_7_toggle();
   
}
/*******************************************************************************
  Description: just a stub.

  Parameters: are not used.
 
  Returns: nothing.
*******************************************************************************/
void ZDO_MgmtNwkUpdateNotf(ZDO_MgmtNwkUpdateNotf_t *nwkParams)
{
  nwkParams = nwkParams;  // Unused parameter warning prevention
}

/*******************************************************************************
  Description: just a stub.

  Parameters: none.
 
  Returns: nothing.
*******************************************************************************/
void ZDO_WakeUpInd(void)
{
}

#ifdef _BINDING_
/***********************************************************************************
  Stub for ZDO Binding Indication

  Parameters:
    bindInd - indication

  Return:
    none

 ***********************************************************************************/
void ZDO_BindIndication(ZDO_BindInd_t *bindInd)
{
  (void)bindInd;
}

/***********************************************************************************
  Stub for ZDO Unbinding Indication

  Parameters:
    unbindInd - indication

  Return:
    none

 ***********************************************************************************/
void ZDO_UnbindIndication(ZDO_UnbindInd_t *unbindInd)
{
  (void)unbindInd;
}
#endif //_BINDING_

//eof blink.c


But the leds are not blinking.
What can be the problem?

Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 12, 2011 - 07:27 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Where is your main() function? It looks correct otherwise.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
aquafood
PostPosted: Oct 12, 2011 - 09:34 PM
Newbie


Joined: Sep 28, 2009
Posts: 6


Sorry, but i don't understand your question.
What kind of main function do you miss?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Oct 13, 2011 - 05:14 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

All C applications should have a "void main(void)" function.
In BitCloud applications it usually looks like:
Code:
int main(void)
{
  SYS_SysInit();

  for(;;)
  {
    SYS_RunTask();
  }
}
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
babic060
PostPosted: Jan 15, 2012 - 03:52 AM
Newbie


Joined: Jan 15, 2012
Posts: 6


Hi,

I have a problem to establish any connection between two ATMEL atzb-24-A2 modules.
I have two keyboards, two displays and two uC STM32F100RB. When those two are connected via UART using wires, exchange messages works perfectly. Now, i want to do it wireless, but receiver doesnt receive anything.
I am student and beginner in this area.

I want to send some text from first uC to another via ZigBee, and from second to first. So, both of them shoud be coordinator and end device at a time.

At start, i configure both of them as a receiver. The one that shoud send some text is firstly configured as a transfmitter, and after that, the message is sent, but the receiver didnt receive anything.

When sending:
AT+WAUTONET=0 z
CR
ATX
CR
AT+GSN=1
CR
AT+WPANID=1620
CR
AT+WCHMASK=100000
CR
AT+WROLE=0 +WSRC=0
CR
AT+WWAIT=3000
CR
AT+WAUTONET=1 z
CR

ATD 55
CR
myText
CR


When receiving:
AT+WAUTONET=0 z
CR
ATX
CR
AT+GSN=2
CR
AT+WPANID=1620
CR
AT+WCHMASK=100000
CR
AT+WROLE=1 +WSRC=55
CR
AT+WAUTONET=1 z
CR

After every command i get OK so i have no idea what is wrong.
Please, do you have any idea to help me?
Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 16, 2012 - 08:17 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Try using AT+WJOIN instead of switching autonet on and off.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
babic060
PostPosted: Jan 20, 2012 - 12:23 PM
Newbie


Joined: Jan 15, 2012
Posts: 6


Hi,

When I tried with WJOIN, it seems it works faster to get OK, but still, there is no successful exchange of any data.
Actually, I have new problems. I am using two LEDs to watch current status. Initially, both modules are configured as receivers, and while configuration is on, those LEDs are on too. After getting every OK, LEDs are turning off which means that both ZigBees are ready to receive. The problem is that both LEDs are very often always on, which means that some OKs was issed. In that case, the code was written to repeat sending that AT command until OK is there, but it almost never comes up.

But, when configuration successes, after i push the button on one uC, one Atmel is started to be configured as a transmitter, after i send data and configure as a receiver again. But, the other uC still doesnt receive anything.


My question is:
is it ok to always repeat the described situatin: configure a modul as Rx and wait for data. When it should transmit, configure it as a transmitter, send some data, and configure it back as a receiver?

Is there anything else I should do to receive data except configuring with next AT commands:
ATX
AT+GSN=2
AT+WPANID=1620
AT+WCHMASK=100000
AT+WROLE=1 +WSRC=55
AT+WJOIN
and, of course, enabling interrupt for uart?

I am not sure if ZigBee modul should return any status after sending data:
ATD 55
CR
myData
CR

I expected to get OK or ERROR after every CR that i send to ZigBee modul, but after ATD 55 or DATA, i dont receive anything.



I am sorry if my english was bad or if my text was too long.
Thanks for any help.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 20, 2012 - 09:57 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

There is no "configuration as transmitter" and "configuration as receiver". Once configured (and not sleeping) node always in receive state unless asked to send data.

Here are minimal configuration commands for Coordinator, Router and End Device:
Code:

AT+GSN=1
AT+WSRC=0
AT+WROLE=0
AT+WPANID=1234
AT+WCHMASK=40000
ATX0
AT+WJOIN


AT+GSN=2
AT+WSRC=1
AT+WROLE=1
AT+WPANID=1234
AT+WCHMASK=40000
ATX1
AT+WJOIN

AT+GSN=3
AT+WSRC=2
AT+WROLE=2
AT+WPANID=1234
AT+WCHMASK=40000
ATX1
AT+WJOIN


Data should return OK or ERROR status, but in case of error it might take a while (up to 40 seconds).

Try running this commands (1 and 2) on two devices and post what responses do you get to each of them.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
babic060
PostPosted: Jan 21, 2012 - 10:52 PM
Newbie


Joined: Jan 15, 2012
Posts: 6


Hi,

Your previous post was very useful to me. Now, i have something Smile
I ran commands (1 and 2), and I turned echo on too (ATE1 command).

Should I always resend those sets of AT commands after returning power on or only ATD and DATA are enough to start sending?


When I had sent set 1 or 2, i got error for every command except ATX and WJOIN (those two gave me OK). When I asked "ATS0?", i found that some commands was not able to be processed at current state,
and some unspecified error (code 4).
And when I used wautonet instead of wjoin, i got OK for every message. After that, I used WJOIN again, was getting some errors again, but now i was able to send some data.
I suppose those commands are stored in rom, so those errors have no efect.

My problem at the moment is that the other side receives the message but with some bytes missing. If I send "123456", I will receive something
like this: "AA 000, 6:145" but i thought i will get DATA 0,6:123456" or something like that.

I turned on hardware flow control, but I am not sure if it is helpful for this.



So, is there a way to stabilize sending and not to lose any byte?

Are those sets of AT commands (minimal configuration commands) ok to stay intact or shoud i add something more?

For how long shoud my uart wait for data? Is there any charachter that is always sent the last by ZigBee when uC receives (maybe CR or LF)?

And thanks a lot Smile
 
 View user's profile Send private message  
Reply with quote Back to top
babic060
PostPosted: Jan 22, 2012 - 06:44 PM
Newbie


Joined: Jan 15, 2012
Posts: 6


Hi, again.

I solved the problem. My program was too busy in interrupt routine. I found a way to properly receive a data and to put it on display, but i can send it once successfuly and every next try results in errror after about 30sec.
Maybe I can fix it too with better optimized program, but i want only to ask about the procedure for send/receive.
I am using wautonet on and off to configure modules, and after that only atd0 and data (atd1 and data for other device).

So, my questions are:
-what is the procedure to exchange data (text) normally, something like chat? The question is about (re)configuring modules and other AT commands.

-What are advantages and disadvantages with using wautonet and wjoin? I really don't know what to choose for final. With wjoin, initialization is shorter, but i get errors with setting wrole, wsrc... with autonet it is slower, but all results are ok

BR
 
 View user's profile Send private message  
Reply with quote Back to top
babic060
PostPosted: Jan 22, 2012 - 07:46 PM
Newbie


Joined: Jan 15, 2012
Posts: 6


...and update of the current status:

one keyboard, displey, uC and ZigBee is A, and the other set is B:
sending data from A to B and from B to A in next order:

src; data sent; dest; data received;

A 1 B 1
B 2 A 2
A 3 B 3
B 4 A 4
B 5 A (none)
A 6 B 6
A 7 B (none)
A 8 B (none)
B 9 A 9 but now B receives '8' (7 never arrived)

So, i can exchange data successfuly, but one must to send and to receive before next send. I hope that this is not a must and i hope that my program has some bug unfound yet.
Next, if i try to send from A or B three times in a row, some error ocures, and the sender receive some response:
Sometimes it is D1<data that i tried to send>
and sometimes it is TD1<data> and i have to wait for about 10 sec (like reinitilizing with wautonet).

I hope this is familiar to you. It is possible that i have a problem with memory menagment and i will try few things, but i wonder if this is some known issue.

Thanks anyway
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 23, 2012 - 07:54 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

babic060 wrote:
So, my questions are:
-what is the procedure to exchange data (text) normally, something like chat? The question is about (re)configuring modules and other AT commands.
Just a regular ATD command is usually enough. There is no need to reconfigure anything.

babic060 wrote:
-What are advantages and disadvantages with using wautonet and wjoin? I really don't know what to choose for final. With wjoin, initialization is shorter, but i get errors with setting wrole, wsrc... with autonet it is slower, but all results are ok
Autonet just makes sure that module will try to join automatically. Settings are exactly the same for both them. When you say that you receive errors please post complete log of commands you send, it is impossible to say what is wrong otherwise.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
alexru
PostPosted: Jan 23, 2012 - 07:56 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

babic060 wrote:
So, i can exchange data successfuly, but one must to send and to receive before next send.
I think you have some problems with handling received data.

babic060 wrote:
Next, if i try to send from A or B three times in a row, some error ocures, and the sender receive some response:
Do you wait for OK or ERROR between those attempts?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
babic060
PostPosted: Jan 25, 2012 - 10:59 PM
Newbie


Joined: Jan 15, 2012
Posts: 6


It's amazing how much you helped me with so few words Smile
Thank you very much. Now, everything works perfectly. The main problem was because i had disabled receiving (generating an interrupt) in interrupt routine after one message had been received. With receiver always enabled, it is all ok.

Once more again, thank you very much Smile
 
 View user's profile Send private message  
Reply with quote Back to top
mkpolska
PostPosted: Feb 09, 2012 - 04:29 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


Hi,

i don't want to create new topic so i write here.
I have one question.
I have new atzb-24-a2 module.
I want load to this module SerialNet.
It is posible through ISP programmer?
It is posible through RS232(via converter with MAX3232)?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 04:43 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Yes and yes.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mkpolska
PostPosted: Feb 09, 2012 - 05:17 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


Ok.
so i'd like to use ISP programmer.
should i connect pins in this configuration?:

PROGRAMMER | ATZB-24

MOSI <-> SPI_MOSI(3)
MISO <-> SPI_MISO(2)
GND <-> GND(9,22,23,35)
VCC <-> VCC(24,25)
RST <-> RESET(8 )
SCK <-> SPI_CLK(1)

?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 05:34 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

I don't remember from the top of my head. Here is ZigBit schematic: http://dl.dropbox.com/u/6121480/ATZB_24_A2_sch.jpg

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mkpolska
PostPosted: Feb 09, 2012 - 05:44 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


ok, but on first page of this topic You wrote:

Quote:
Connections for ISP are following: MISO(3Cool, MOSI(39), RST(Cool, Vcc(24,25) and GND(9,22,23,35)


i want to be sure
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 09, 2012 - 05:46 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

I was right the first time.

You see, I don't keep it in my head all the time, and frankly I'm getting tired of looking it up for everyone. That's why I referred you to a schematic and proposed to think a bit for yourself.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mkpolska
PostPosted: Feb 09, 2012 - 06:06 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


i understand that You are frustrated, but it's my beginning in zigbee.
Now I find in datasheet that's pins 38 and 39 are for USART and SPI.
 
 View user's profile Send private message  
Reply with quote Back to top
mkpolska
PostPosted: Feb 11, 2012 - 06:29 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


i connect atzb to pc via stk200. can i somehow make sure that's everything is properly connected?
what program do You recommmend to load SerialNet to atzb?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 11, 2012 - 06:40 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

I don't know what works with stk200, I'd try avrdude or avarice.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Marco84
PostPosted: Mar 13, 2012 - 12:08 PM
Newbie


Joined: Feb 23, 2012
Posts: 11


Hello everyone ,

I am new to AVR RAVEN and I am working on a project with two modules without RZUSBSTICK.
My goal is to write a simple program that allows wireless communication between this modules.
I already seen the documentation but I cannot found what i want.
Can anyone give me a hand?

Thanks everyone.

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
mkpolska
PostPosted: Mar 26, 2012 - 03:35 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


hi,

how can i change baud rate in ATZB-24?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 26, 2012 - 03:45 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Yes, you can.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mkpolska
PostPosted: Mar 26, 2012 - 05:30 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


My question was "how can" not "can I" Wink
btw. please tell me only where can i find how change baud rate.
I need the easiest way, because i use only AT
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 26, 2012 - 05:34 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Use "6.7.8 +IPR - Serial port communication rate" command. It is described in the datasheet. Keep in mind that changing baudrate will result in increased baudrate setting error.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mkpolska
PostPosted: Mar 26, 2012 - 06:34 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


hmmm.
I did as You wrote. I set 1200 and now my atzb doesn't respond for at command...
what now?Wink
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 26, 2012 - 06:39 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Check that your PC is set to 1200. Then if you don't have oscilloscope there is nothing you can do but reprogram the module.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mkpolska
PostPosted: Mar 26, 2012 - 06:53 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


successful;-) i set different baud rate and sent "at&f"
atzb respond many time with error frame, but for 9600 it's work and now baud rate is 38400.
 
 View user's profile Send private message  
Reply with quote Back to top
mkpolska
PostPosted: Mar 26, 2012 - 07:19 PM
Newbie


Joined: Jan 22, 2012
Posts: 10


i set 9600 and now atzb respond for AT. Why it doesn't work with 1200?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 26, 2012 - 08:13 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Probably there is too much difference between sending and receiving side. You can't set exactly 1200 using 8 MHz crystal.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 08, 2012 - 01:52 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Hi all,

Is the current firmware that uses SerialNet and AT commands available as a source code and is it possible just to upgrade that code with my own routines? I plan to use UART bootloader, but which compiler should I use in that case because I am new with Atmel (have used another MCUs).

Second question is about modules themselves: Does the coordinator command to router/node wakes up the router/node if it is in a sleep mode, or the router/node processes command after it wakes up by previously defined scheme?

Thanks ahead!
BR,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 08, 2012 - 06:36 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

No, SerialNet source code is not available.

Radio is turned off in a sleep mode (hence "sleep"), so the only way to wakeup is using external interrupt or timer.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 08, 2012 - 11:04 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Thank you very much alexru for your quick response!

Is the PeerToPeer source code similar to default one in the module's MCU and if not, what are basic differences, in short?

Are there any limitations in default firmware concerning number of nodes in network like in P2P example?

BR,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 09, 2012 - 04:38 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

There is no default PeerToPeer in the module. By default modules come only with serial bootloader.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 09, 2012 - 10:44 AM
Newbie


Joined: Nov 24, 2008
Posts: 17


Ok than, is the PeerToPeer source code similar to the, let's say SerialNet_ZigBit_Rf230.hex and what are basic differences, in short?

And what about limitation of SerialNet_ZigBit_Rf230.hex firmware concerning number of nodes in network like in P2P example?

Thanks alexru!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 09, 2012 - 03:55 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Perr2Peer is just simple application that is limited to 8 nodes and only pairs of nodes can send data to each other.

SerialNet has a complete command-line serial interface; there are limitations in SerialNet but they will be a problem after 50-70 devices in the network.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
barjaktar
PostPosted: Apr 09, 2012 - 04:56 PM
Rookie


Joined: Apr 20, 2011
Posts: 40


Question moved to:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=944481#944481


Last edited by barjaktar on Apr 09, 2012 - 06:16 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
ssergeievich
PostPosted: Apr 09, 2012 - 05:44 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Thank you alexru once again!

I am facing a new problem with my network. When I set up a network with 1 Coordinator, 1 Router and 1 End node (which has +wpwr=100,100) everything works just fine. But, if I change the sleep/active ratio to 60s/1s, after a while my End node gets lost. Is there any technique to reset it?(The +wautonet property is set to 1, so I guess it should hook up to the network after restart). The same problem appears when coordinator node is powered after powering up other nodes.

So, my question is how to reset other nodes and enforce them to connect to the just formed network - upon booting up of the coordinator node?

Best regards,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 09, 2012 - 05:48 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

1. You should have the same setting for +wpwr on all devices in the network.
2. What do you mean by "gets lost"?
3. With autonet=1 node should resolve such problems by itself, without restarting.


barjaktar, please separate your question to another topic.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
barjaktar
PostPosted: Apr 09, 2012 - 06:12 PM
Rookie


Joined: Apr 20, 2011
Posts: 40


All right, I am sorry. I just thought that the generality of the topic title encloses my problem also.
 
 View user's profile Send private message  
Reply with quote Back to top
ssergeievich
PostPosted: Apr 09, 2012 - 07:00 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Is it mandatory for all of them to have the same +wpwr settings? Let's say that Coordinator node is connected to the PC, and it doesn't have to go to sleep mode.

By gets lost I mean it's lost from the net and never gets back on to it even with +wautonet=1 parameter.

BR,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 09, 2012 - 07:01 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Yes, it is mandatory, parents keep track of their children, so they need to know how often children will be awake.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 09, 2012 - 07:20 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Sorry alexru if I bother you, but I have another question.

May I ask why this application is not available as free and is it available for buying?

How hard would it be to implement such firmware like SerialNet using BitCloud SDK or just a part of it with basic functionality? The main reason for this is that the MCU that this module uses is powerful enough to run some simple additional routines,
without need for engaging other MCU and UART communication to module.

Thank you alexru for all your help, time and patience answering my questions!

Best regards,
Sergei

P.S. Maybe I sound silly like one kid who asked how hard would it be for him as a beginner in C programming to make his own Windows OS. Laughing
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 09, 2012 - 08:31 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

ssergeievich wrote:
May I ask why this application is not available as free and is it available for buying?
It is not my decision, but I assume it will create more load on a support side of things. It can be obtained under NDA.

ssergeievich wrote:
How hard would it be to implement such firmware like SerialNet using BitCloud SDK or just a part of it with basic functionality?
That depends on your skills, but in general it is not hard at all. And it will be easier for you instead of implementing complex application that takes into account all possible scenarios, implement simple application that does exactly want you need.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 09, 2012 - 09:21 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Just tell me what is a got place to start and are all necessary functions in BitCloud SDK? Some basic project would help me - is it the P2P example, or some other?

Because I'm new in AVR (have used other Atmel and PIC MCUs), what compiler and IDE for Windows do you recommend me?

That's all! I won't bother you again. Smile Thank you very much, or should I say спасибо

Regards,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 09, 2012 - 09:25 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

ssergeievich wrote:
Just tell me what is a got place to start and are all necessary functions in BitCloud SDK?
Start by getting familiar with BitCloud applications. All functions are available in the SDK, SerialNet is just an application like any other application.

ssergeievich wrote:
It would help me some basic project - is it the P2P example, or some other?
Different sample applications show different scenarios, start with whatever is closer to yours.

ssergeievich wrote:
Because I'm new in AVR (have used other Atmel and PIC MCUs), what compiler IDE for Windows do you recommend me?
Totally depends on your preferences, I use text editor, WinAVR and Makefiles.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 19, 2012 - 06:29 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Hello alexru, guys,

I can not find information about ATZB AD Convertor resolution when using SerialNet Application. Is it just 8bit or else?

For a correct ADC readouts via AT commands, correct me if I am wrong, I need to connect A_Vref (pin 34) to the D_Vcc (3.3V), set ADC ATS100=F (all 4 channels) and read it with ATS10x? where x = [1,2,3,4]

When no voltage is applied to A_Vref pin and AD pins also float, is it correct if readouts are equal to 255 for all ADC S registers?

BR,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 19, 2012 - 09:04 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Yes, it is 8-bit sample.

I have no idea what happens when pins are floating.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 20, 2012 - 09:38 AM
Newbie


Joined: Nov 24, 2008
Posts: 17


And what about a proper connection of A_Vref pin?
Quote:
For a correct ADC readouts via AT commands, correct me if I am wrong, I need to connect A_Vref (pin 34) to the D_Vcc (3.3V), set ADC ATS100=F (all 4 channels) and read it with ATS10x? where x = [1,2,3,4]

Is this procedure correct?

BR,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
ssergeievich
PostPosted: Apr 20, 2012 - 10:32 AM
Newbie


Joined: Nov 24, 2008
Posts: 17


I've just found the correct manual which states that ADC Reference voltage should be in range from 1V to Vcc-3!? This is a little bit awkward, because with voltage supply with max. rating of 3.6V, range would be 1V to 0.6V.

I don't want to damage my ZigBit modules, so please advise me regarding this issue.

Also, the manual says that the ADC Resolution is 10bits. This is probably the MCU ADC resolution, where the SerialNet App. disregards higher byte of the sample (upper 2 bits). Please, comment...

Regards,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 20, 2012 - 04:23 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Which manual is "correct"? ZigBit has ATmega1281 inside, and datasheet says:

Reference Voltage
Single Ended Conversion min=1.0 max=AVCC
Differential Conversion min=1.0 max=AVCC - 0.5V

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Apr 23, 2012 - 09:59 AM
Newbie


Joined: Nov 24, 2008
Posts: 17


Quote:
Which manual is "correct"?

This topic is about ATZB, so the manual is appropriate datasheet - related to ATZB-24-A2. This datasheet states:
Quote:
... ADC Reference voltage should be in range from 1V to Vcc-3!?

Is it a type mismatch in ATZB-24-A2/B0 datasheet or what? (It might be Vcc-0.3V)
I think that my questions/comments are clear enough to be answered/commented...
Anyway, thank you for your help so far.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Apr 23, 2012 - 03:52 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

It looks like a typo in the datasheet, just look at atmega1281 datasheet.

Anyway it is extremely hard to kill ZigBit by applying voltages within 3.5V to any pins in any combinations.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
gatebit
PostPosted: Jul 17, 2012 - 11:13 AM
Newbie


Joined: Jul 17, 2012
Posts: 6


Hi everyone!

I just started working with ATMEL ZigBit modules and I am having problem with the testing of the sample programs supplied with the latest (1.14) BitCloud stack.

I would like to run the ThrougputTest demo. If I compile to code for acting as a Coordinator everything is fine. The ZigBit module works as expected, I can see the messages in the Hyperterminal.
However, if I complie the code for acting as a Router something is wrong with the Network joining procedure. The code is running on the module (Network joining indicator LED is flashing), but it can not connect to the network of the Coordinator. It stays in "Network finding" state.
I have already tried to investigate what is going on and I find a very strange thing:
I have modified the ZDO_StartNetworkConf function in the following way to find out the problem:

Code:

static void ZDO_StartNetworkConf(ZDO_StartNetworkConf_t *confirmInfo)
{
  if (ZDO_SUCCESS_STATUS == confirmInfo->status)
  {
       static uint8_t msgBuf[] = "CONNECTED!!!!\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);

     HAL_StopAppTimer(&startingNetworkTimer);
      BSP_OnLed(NETWORK_LED); // Indicate successful network join by turning LED on

      appState = APP_IN_NETWORK_STATE; // Switch state

      // Register endpoint
      APS_RegisterEndpointReq(&endpointParams);

     // Configure and start delay timer
     delayTimer.interval = APP_TIMER_DELAY_PERIOD;
     delayTimer.mode     = TIMER_ONE_SHOT_MODE;
     delayTimer.callback = delayTimerFired;
     HAL_StartAppTimer(&delayTimer);
  } else if(confirmInfo->status == ZDO_INVALID_PARAMETERS_STATUS) {
   //  Wrong parameters were put into the primitive.
     static uint8_t msgBuf[] = "Error: 1\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
  } else if(confirmInfo->status == ZDO_BUSY_STATUS) {
   //  ZDO layer is busy and cannot execute the primitive.
     static uint8_t msgBuf[] = "Error: 2\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
  } else if(confirmInfo->status == ZDO_NO_NETWORKS_STATUS) {
   //  No network was found.
     static uint8_t msgBuf[] = "Error: 3\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
  } else if(confirmInfo->status == ZDO_EXTPANID_ALREADY_EXIST_STATUS) {
   //  There is a network with the same extended PANID.
     static uint8_t msgBuf[] = "Error: 4\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
  } else if(confirmInfo->status == ZDO_FAIL_STATUS) {
   //  Unknown error.
     static uint8_t msgBuf[] = "Error: 5\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
  } else if(confirmInfo->status == ZDO_CMD_COMPLETED_STATUS) {    
     static uint8_t msgBuf[] = "Error: 6\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);

  } else if(confirmInfo->status == ZDO_NO_KEY_PAIR_DESCRIPTOR_STATUS) {
   //  Trust center could not find key pair descriptor to authenticate device.
     static uint8_t msgBuf[] = "Error: 7\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_UPDATE_LINK_KEY_STATUS) {
   //  Link key for device was updated.
     static uint8_t msgBuf[] = "Error: 8\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_UPDATE_MASTER_KEY_STATUS) {
   //  Master key for device was updated.
     static uint8_t msgBuf[] = "Error: 9\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_DELETE_KEY_PAIR_STATUS) {
   //  Key pair descriptor was deleted.
     static uint8_t msgBuf[] = "Error: 10\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_DELETE_LINK_KEY_STATUS) {
   //  Link key for device was deleted.
     static uint8_t msgBuf[] = "Error: 11\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_TC_NOT_AVAILABLE_STATUS) {
   //  TC is not responding to keep-alive requests.
     static uint8_t msgBuf[] = "Error: 12\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_INVALID_REQUEST_STATUS) {
   //  ZDP request is invalid.
     static uint8_t msgBuf[] = "Error: 13\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_DEVICE_NOT_FOUND_STATUS) {
   //  Requested device was not found.
     static uint8_t msgBuf[] = "Error: 14\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_INVALID_EP_STATUS) {
   //  Unsupported endpoint of 0x00 or between 0xF1 and 0xFF was requested.
     static uint8_t msgBuf[] = "Error: 15\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NOT_ACTIVE_STATUS) {
   //  Requested endpoint has not been registered.
     static uint8_t msgBuf[] = "Error: 16\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NOT_SUPPORTED_STATUS) {
   //  Requested optional feature is not supported.
     static uint8_t msgBuf[] = "Error: 17\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_TIMEOUT_STATUS) {
   //  Timeout occured during the requested operation.
     static uint8_t msgBuf[] = "Error: 18\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NO_MATCH_STATUS) {
   //  End device bind request is unsuccessful due to a failure to match any suitable clusters.
     static uint8_t msgBuf[] = "Error: 19\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NO_ENTRY_STATUS) {
   //  Unbind request is unsuccessful.
     static uint8_t msgBuf[] = "Error: 20\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NO_DESCRIPTOR_STATUS) {
   //  Child descriptor is not available.
     static uint8_t msgBuf[] = "Error: 21\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_INSUFFICIENT_SPACE_STATUS) {
   //  Device does not have enough storage space.
     static uint8_t msgBuf[] = "Error: 22\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NOT_PERMITTED_STATUS) {
   //  The device does not have storage space to support the requested operation.
     static uint8_t msgBuf[] = "Error: 23\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_TABLE_FULL_STATUS) {
   //  Device does not have enough table space.
     static uint8_t msgBuf[] = "Error: 24\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NOT_AUTHORIZED_STATUS) {
   //  Request is not authorized from this device.
     static uint8_t msgBuf[] = "Error: 25\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NWK_UPDATE_STATUS) {
   //  Network parameters have been updated (channel, PanId, shortAddr...)
     static uint8_t msgBuf[] = "Error: 26\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NETWORK_STARTED_STATUS) {
   //  Device has joined/rejoined a network and data can be transmitted.
     static uint8_t msgBuf[] = "Error: 27\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NETWORK_LOST_STATUS) {
   //  Device has lost connection with a parent and the stack tries rejoin by itself. In this case transmission should be stopped.
     static uint8_t msgBuf[] = "Error: 28\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_NETWORK_LEFT_STATUS) {
   //  Device has left a network. If autonetwork option is on, the stack will rejoin a network. Otherwise, an application should rejoin.
     static uint8_t msgBuf[] = "Error: 29\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_CHILD_JOINED_STATUS) {
   //  New device has joined a network as a child of this device.
     static uint8_t msgBuf[] = "Error: 30\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_CHILD_REMOVED_STATUS) {
   //  Child has been removed from children list.
     static uint8_t msgBuf[] = "Error: 31\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_USER_DESCRIPTOR_UPDATE_STATUS) {
   //  User descriptor is changed event.
     static uint8_t msgBuf[] = "Error: 32\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
 
  } else if(confirmInfo->status == ZDO_STATIC_ADDRESS_CONFLICT_STATUS) {
   //  On the device with static addressing the conflict of network addresses has been detected.
     static uint8_t msgBuf[] = "Error: 33\r\n"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
  }   
  else
  {
     static uint8_t msgBuf[] = "Strange ERROR!"; // Buffer UART message
     appWriteDataToUart(msgBuf, sizeof(msgBuf)-1);
       BSP_ToggleLed(DATA_TX_LED);

    SYS_PostTask(APL_TASK_ID);
  }
}


(Sorry for the long code)
So I basically test every possible status state, but always the last(!) else block is executed.

Has anyone had similar problem? Any idea what can cause this behavior?

I am using the makefile for the MESHBEAN board, however I have just a simple ZigBit module with some LEDs and a FTDI UART (so no development board).
 
 View user's profile Send private message  
Reply with quote Back to top
gatebit
PostPosted: Jul 17, 2012 - 11:46 AM
Newbie


Joined: Jul 17, 2012
Posts: 6


In addition here is my APL_TaskHandler function:

Code:

void APL_TaskHandler(void)
{
  switch (appState)
  {
    // Node has initial state
    case APP_INITING_STATE:
      simpleDescriptor.AppDeviceId = CPU_TO_LE16(1);
      simpleDescriptor.AppProfileId = CPU_TO_LE16(1);
      simpleDescriptor.endpoint = END_POINT;
      simpleDescriptor.AppDeviceVersion = 1;

      BSP_OpenLeds();
      endpointParams.simpleDescriptor = &simpleDescriptor;

        // All other states mean Router
        appDeviceType = DEVICE_TYPE_ROUTER;
        endpointParams.APS_DataInd = NULL;

      CS_WriteParameter(CS_DEVICE_TYPE_ID, &appDeviceType);
      appInitUARTManager();  // Init UART manager

      // Configure and start network starting timer
      startingNetworkTimer.interval = APP_TIMER_STARTING_NETWORK;
      startingNetworkTimer.mode     = TIMER_REPEAT_MODE;
      startingNetworkTimer.callback = startingNetworkTimerFired;
      HAL_StartAppTimer(&startingNetworkTimer);

      appState = APP_NETWORK_STARTING_STATE; // Switch state
      SYS_PostTask(APL_TASK_ID);
      break;

    case APP_NETWORK_STARTING_STATE:
      {
        // Configure network start parameters
        networkParams.ZDO_StartNetworkConf = ZDO_StartNetworkConf;

        // Start network
        ZDO_StartNetworkReq(&networkParams);
        break;
      }

    // Node is in network
    case APP_IN_NETWORK_STATE:

      appRouterTaskHandler();
      break;

    // Node is out of network
    case APP_NO_NETWORK_STATE:
      break;

    default:
      break;
  }
}


The configuration.h:
Code:

#ifndef _CONFIGURATION_H_
#define _CONFIGURATION_H_

//-----------------------------------------------
// Disables board-specific peripherals support
//-----------------------------------------------
//#define APP_DISABLE_BSP 1
#define APP_DISABLE_BSP 0

//-----------------------------------------------
// Includes board-specific peripherals support in application.
//-----------------------------------------------
#include <BoardConfig.h>

//-----------------------------------------------
// Atmel communication interfaces identifiers.
// Supported interfaces are platform and application dependent.
//-----------------------------------------------
#define APP_INTERFACE_USART 0x01
#define APP_INTERFACE_VCP 0x02
#define APP_INTERFACE_SPI 0x03
#define APP_INTERFACE_UART 0x04
#define APP_INTERFACE_USBFIFO 0x05

//-----------------------------------------------
// Atmel external memory identifiers.
// Supported memory is platform and application dependent.
//-----------------------------------------------
#define AT25F2048  0x01
#define AT45DB041  0x02
#define AT25DF041A 0x03

// Enables or disables request of APS Acknowledgement for outgoing frames.
#define APP_USE_APS_ACK 0
//#define APP_USE_APS_ACK 1

// Device type detection (for the boards without DIP switches)
//#define APP_DEVICE_TYPE DEV_TYPE_COORDINATOR
//Device is Router
#define APP_DEVICE_TYPE DEV_TYPE_ROUTER

// Period of sending throughput value to USART (ms)
#define APP_TIMER_TRACK_PERIOD 1000

// Packet transmission start delay (ms)
#define APP_TIMER_DELAY_PERIOD 1000

//-----------------------------------------------
//BOARD_MESHBEAN
//-----------------------------------------------
#ifdef BOARD_MESHBEAN
  // Enable this option if target board belongs to MNZB-EVBx family
  #define BSP_MNZB_EVB_SUPPORT 0
  //#define BSP_MNZB_EVB_SUPPORT 1
 
  // Defines primary serial interface type to be used by application.
  #define APP_INTERFACE APP_INTERFACE_USART
 
  // Defines USART interface name to be used by application.
  #define APP_USART_CHANNEL USART_CHANNEL_1
#endif

  // 32-bit mask of channels to be scanned before network is started. Channels that
  // should be used are marked with logical 1 at corresponding bit location.
  //  Valid channel numbers for 2.4 GHz band are 0x0b - 0x1a
  //  Valid channel numbers for 900 MHz band are 0x00 - 0x0a
  //
  //  Notes:
  //  1. for small amount of enabled channels it is more convinient to specify list
  // of channels in the form of '(1ul << 0x0b)'
  //  2. For 900 MHz band you also need to specify channel page
  //
  //  Value range: 32-bit values:
  //  Valid channel numbers for 2.4 GHz band are 0x0b - 0x1a
  //  Valid channel numbers for 900 MHz band are 0x00 - 0x0a
  //
  //  C-type: uint32_t
  //  Can be set: at any time before network start
  //  Persistent: Yes
  #define CS_CHANNEL_MASK (1L<<0x0f)

// The parameter specifies the predefined extended PANID of the network to be
// formed (for the coordinator) or joined (for a router or an end device). For a
// router or an end device the parameter can equal 0 allowing them to join the
// first suitable network that they discover.
//
//  Value range: All 64-bit values except for 0xFFFFFFFFFFFFFFFFLL; specify a value
// in the 0x123456789ABCDEFLL format.
//  C-type: ExtPanId_t (equal to uint64_t)
//  Can be set: at any time before network start
//  Persistent: Yes
#define CS_EXT_PANID 0xAAAAAAAAAAAAAAAALL

// 64-bit Unique Identifier (UID) determining the device extended address. If this
// value is 0 stack will try to read hardware UID from external UID or EEPROM chip.
// at startup. Location of hardware UID is platform dependend and it may not be
// available on all platforms. If the latter case then UID value must be provided
// by user via this parameter. This parameter must be unique for each device in a
// network.
//
//  Value range: any 64-bit value except for broadcast extended addresses
//  C-type: ExtAddr_t
//  Can be set: at any time before network start
//  Persistent: Yes
#define CS_UID 0x0123456789012377LL

// The maximum number of direct children that a given device (the coordinator or a
// router) can have.
//
//  The parameter is only enabled for routers and the coordinator. An end device
// can not have children. If an actual number of children reaches a parameter's
// value, the node will have not been able to accept any more children joining the
// network. The parameter can be set to 0 on a router thus preventing it from
// accepting any children and can help form a desired network topology. For
// example, if the parameter is set to 0 on all routers, then the coordinator will
// be the only device that can have children and the network will have star
// topology.
//
//  Value range: from 0 to CS_NEIB_TABLE_SIZE
//  C-type: uint8_t
//  Can be set: at compile time only
//  Persistent: No
#define CS_MAX_CHILDREN_AMOUNT 2

// The maximum number of routers among the direct children of the device
//
//  The parameter determines how many routers the device can have as children. Note
// that the maximum number of end devices is equal to CS_MAX_CHILDREN_AMOUNT -
// CS_MAX_CHILDREN_ROUTER_AMOUNT.
//
//  Value range: from 0 to CS_MAX_CHILDREN_AMOUNT
//  C-type: uint8_t
//  Can be set: at compile time only
//  Persistent: No
#define CS_MAX_CHILDREN_ROUTER_AMOUNT 2

// Network depht limits amount of hops that packet may travel in the network.
// Actual maximum number of hops is network depth multiplied by 2.
//
//  The parameter determines the maximum depth of a network tree formed by
// child-parent relationships between nodes.
//
//  While joining the network the node receives beacon responses from potential
// parents containing their actual network depth and declines those which show
// values not less than the maximum network depth on the joining device. A
// potential parent will also reject a beacon from the joining device and will not
// sent a response if the joining device shows the network depth greater than it is
// allowed on the potential parent. This logic is enabled if the parameter value is
// not greater than 15. If its value is greater than 15, then device does not
// perform any checkings of the network depth, neither when joining a network nor
// when accepting other nodes as children. This allows forming long chains of
// devices across considerable distances.
//
//  The stack also uses the parameter to calculate several timeouts. Besides, the
// parameter determines the maximum radius of a data packet, that is, the maximum
// number of hops that a packet may travel, which is calculated by the following
// formula:
//
//  maximum radius = 2 * MIN(2 * maxNetworkDepth, 255)
//
//
//  These uses of the parameter do not change if its value is greater than 15.
// Therefore to enable transmitting data over long chains of devices, the parameter
// should be set to a real desired network depth, rather than to an accidental
// value over 15.
//
//  The parameter should be the same on all devices in the network.
//
//  Value range: from 0 to 255
//  C-type: uint8_t
//  Can be set: at compile time only
//  Persistent: No
#define CS_MAX_NETWORK_DEPTH 2


And I am using the Makefile_All_ZigBit_Atmega1281_Rf230B_8Mhz_Gcc configration.

Thank you very much for the help in advance!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 17, 2012 - 05:04 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Code returned in StartNetworkConf is a combination of all possible codes from all layers. Prefix ZDO_* just indicates that those codes originate on ZDO layer. In your case it is likely to be one of NWK or PHY codes.

So just print the number and look what it is.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
gatebit
PostPosted: Jul 17, 2012 - 06:26 PM
Newbie


Joined: Jul 17, 2012
Posts: 6


Thanks for you quick reply.
I get 0xEA!
I have checked in the API Reference and this status code belongs to NWK_MAC_NO_BEACON_STATUS (A scan operation failed to find any network beacons.).
Why do I not get ZDO_NO_NETWORKS_STATUS (No network was found.) instead?

So it means that the problem is on the coordinator side?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 17, 2012 - 06:30 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

ZDO_NO_NETWORKS_STATUS is returned when there were beacons received, but none of them was suitable (wrong PAN ID, no space to join, etc).

NWK_MAC_NO_BEACON_STATUS means that there were no beacons. If you are sure that your coordinator is properly configured and is on, then it is possible that there are problems with your hardware.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
gatebit
PostPosted: Jul 20, 2012 - 12:01 PM
Newbie


Joined: Jul 17, 2012
Posts: 6


alexru, thanks for your help! However, I can't get the demo programs supplied with the BitCloud stack version 1.14 run! Routers and End devices aren't connecting to the Coordinator.

I was managed to download the earlier 1.13 version of the stack and for my surprise, all of the demo programs are working as a charm! I have to modify only the configuration.h and I have no problem at all.
A really strange thing, if I compile the code for the coordinator with the 1.14 stack, it is working fine with the 1.13 router and 1.13 end device code, but not with the 1.14 router/end device. So according to my earlier post, where I get NO_BEACON_STATUS on my router (1.14), it can not be right, because 1.13 devices can connect to the coordinator.

Any ideas? I can hardly belive that something is wrong with the fresh stack version...


Last edited by gatebit on Jul 20, 2012 - 06:01 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 20, 2012 - 04:52 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Check CS_UID parameter. It should be non-zero and unique to each node.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
gatebit
PostPosted: Jul 20, 2012 - 06:00 PM
Newbie


Joined: Jul 17, 2012
Posts: 6


I changed the CS_UID parameter in the configuration.h every time I recompiled the project (Coordinator, Router, End device).
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jul 20, 2012 - 06:51 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

This is really weird, I don't know what might cause this. I would check it myself, but I just don't have any time to spare, and this probably will be this way for 1-2 weeks.

I'm assuming you don't have a sniffer?

Anyway this seems like a very specific problem that should be easy to reproduce, so you may want to contact avr@atmel.com.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
gatebit
PostPosted: Jul 20, 2012 - 06:59 PM
Newbie


Joined: Jul 17, 2012
Posts: 6


At the moment I have got no time to investigate as well. I'm happy that I have no problem with the 1.13 stack so far, I will use this version in my project.
On the other hand, I'm curious too, so I will probably contact ATMEL.
 
 View user's profile Send private message  
Reply with quote Back to top
0xCAFE10CC
PostPosted: Dec 16, 2012 - 01:26 AM
Newbie


Joined: Dec 15, 2012
Posts: 2


Hallo, I'm trying to use module ATZB-24-A2 with my own simple PCB and sample project Blink.
There are connected 3 LEDS, 3 buttons and 3 sliders according to Meshnetisc schematics (http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=1016670#1016670).
I'm using BitCloud_ZIGBIT_1_14_0 and Atmel AVR Toolchain 3.4.1. Compiled Blink.srec was copied with bootloader into module.

For some reason LEDs connected to GPIO-GPIO2 does not blink.

Measured values:
Vcc = 2.99V Icc=2.6mA
CPU_CLK: f=1.00MHz Vpp=2.9V
OSC32K_OUT: f~32.761kHz, Vpp=931mV

When I'm copying original file WSNDemo_Coord_Rf230B.srec to module then after reset and after about 2 seconds flash two LEDs (G+B) for about 0.2 s. Then lit red LED. So LEDs are connected properly. But I think there should also some LED blink.

In Makefile I'm using setting:
Code:
PROJECT_NAME = MeshBean
CONFIG_NAME = All_ZigBit_Atmega1281_Rf230B_8Mhz_Gcc


In configuration.h I have added after #include <BoardConfig.h> (according to http://www.avrfreaks.net/index.php?name ... 6#822696):
Code:
#undef _TEMPERATURE_SENSOR_
#undef _LIGHT_SENSOR_
#undef _BATTERY_SENSOR_
#undef _SLIDERS_
#undef _BUTTONS_
#undef _LCD_
#define OMIT_READING_SENSORS


and also changed CS_UID to:
Code:
#define CS_UID 0x01LL


What can I do to make LEDs blinking with firmware Blink.srec?
Thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Dec 17, 2012 - 05:05 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Blink is very basic, so all those changes you've made are not necessary (except may be CS_UID), it should just work.

Your problem might be related to this topic: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=123950. Just make changes to the linker file as described and it should work fine.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
0xCAFE10CC
PostPosted: Dec 17, 2012 - 11:34 PM
Newbie


Joined: Dec 15, 2012
Posts: 2


Hallo alexru, thank you for answer. Then it was not hard to find a solution.

I made changes in linkerScr/atmega1281.ld:
Code:
- after KEEP (*(.init8)) was added
*(.init9)
KEEP (*(.init9))

- deleted DISCARD section:
/DISCARD/ :
{
  *(.init9)
  *(.fini*)
}


Now is generated file bigger.
Code:
old:
   text      data       bss       dec       hex   filename
   5276      4096      2490     11862      2e56   All_ZigBit_Atmega1281_Rf230B_8Mhz_Gcc/Exe/Blink.elf
new:
   text      data       bss       dec       hex   filename
  94750      4256      4257    103263     1935f   All_ZigBit_Atmega1281_Rf230B_8Mhz_Gcc/Exe/Blink.elf


And it works - blinks !
Thank you very much.
 
 View user's profile Send private message  
Reply with quote Back to top
ssergeievich
PostPosted: Feb 20, 2013 - 10:42 AM
Newbie


Joined: Nov 24, 2008
Posts: 17


Hello guys,

I have implemented some firmware that uses BitCloud stack, based on SerialNet firmware (with AT commands). Response to one of my query commands (AT+SENS?) is 10bit ADC readouts from 4 ADC channels (ADC0,1,2,3) and is working excellent. Now, I would like to use all of the available ATZB-24-A2 ADC channels (all 8 channels) of the MCU ATMEGA1281, by disabling JTAG in firmware. Unfortunately, this doesn't work. Sad

Here is the code:
Code:
      // Disabling the JTAG - must be executed twice within 4 clock cycles
      MCUCR |=(1<<JTD);
      MCUCR |=(1<<JTD);
      
      Uint16   tempVal;
      char   i;
      tempStr[0] = 0;
      tempResults[0] = 0;      
      
      for(i=0;i<8;i++)
      {
         mibSrv.adcConf = 1<<i;
         adcOpen(mibSrv.adcConf);
         adcStart(i);
         while (!adcGet(&tempVal));
         adcClose();
         utoa(tempVal,tempStr,10);
         strcat(tempResults,tempStr);
         if(i<3)
            strcat(tempResults,",");
         tempStr[0] = 0;
      }
      
      
      
      // Parameter write out
      pParam->subParams[0].str = tempResults;
      resCode = SN_RES_CODE_OK;

I have also added all these channels to the enum HAL_AdcChannelNumber_t - HAL_ADC_CHANNEL4, 5, 6 and 7 in adc.h in BitCloud stack->include folder.

Does anyone have an idea how this should be implemented?

Best regards,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
ssergeievich
PostPosted: Feb 20, 2013 - 11:13 AM
Newbie


Joined: Nov 24, 2008
Posts: 17


Me again... Smile

I am providing you with additional info concerning my previous question. So, here is the code for the functions used in prev. post:

Code:

void adcOpen(Uint8 channel)
{
  adcParam.bufferPointer = &sample;
  adcParam.callback = adcCalback;
  adcParam.voltageReference = AREF;
  adcParam.resolution = RESOLUTION_10_BIT;
  adcParam.sampleRate = ADC_4800SPS;
  adcParam.selectionsAmount = 2;
  HAL_OpenAdc(&adcParam);
  adcState = IDLE;
  adcMask = channel;
}
void adcClose(void)
{
  adcMask = 0;
  HAL_CloseAdc();
}
void adcStart(Uint8 channel)
{
  volatile Uint8 i = (1 << channel);
  HAL_AdcChannelNumber_t adcChannel = HAL_ADC_CHANNEL0;
  if(0 != (adcMask & i))
  {
    adcState = BUSY;
    switch (channel)
    {
     
     case 0:
      adcChannel = HAL_ADC_CHANNEL0;
      break;
     // :ajkalos}
     case 1:
        adcChannel = HAL_ADC_CHANNEL1;
        break;
      case 2:
        adcChannel = HAL_ADC_CHANNEL2;
        break;
      case 3:
        adcChannel = HAL_ADC_CHANNEL3;
        break;
     
      case 4:
        adcChannel = HAL_ADC_CHANNEL4;
        break;
     case 5:
        adcChannel = HAL_ADC_CHANNEL5;
        break;
     case 6:
        adcChannel = HAL_ADC_CHANNEL6;
        break;
     case 7:
        adcChannel = HAL_ADC_CHANNEL7;
        break;
    
      default:
        adcChannel = -1;//HAL_ADC_CHANNEL0;
    }
    HAL_ReadAdc(adcChannel);
  }
}
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 20, 2013 - 05:02 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4860
Location: San Jose, CA

Just adding lines to enum is not enough, you also need to change the code that handles ADC. Look at the function halStartAdc() in HAL\avr\atmega1281\common\src\halAdc.c. The first if will treat your extended channels as differential channels.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ssergeievich
PostPosted: Feb 21, 2013 - 12:22 PM
Newbie


Joined: Nov 24, 2008
Posts: 17


Thank you alexru once again for pointing me to the right track. For others which might have the same problem, I made these changes in BitCloud halADC.c - halStartAdc function (disabling digital inputs on appropriate pins):
Code:
if (HAL_ADC_CHANNEL7 >= channel) // instead HAL_ADC_CHANNEL3 >= channel
  {
    DIDR0 = (1 << channel);
  }

and also this small change of function HAL_ReadAdc in adc.c (for returning the correct ADC readout):

Code:
if (((channel > HAL_ADC_CHANNEL7) && (channel < HAL_ADC_DIFF_CHANNEL0)) || (channel > HAL_ADC_DIFF_CHANNEL7))  // instead channel > HAL_ADC_CHANNEL3
    return -1;

Everything works perfectly right now.

Regards,
Sergei
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits