Parallax Forums
  HomeLog InRegisterCommunity CalendarSearch the ForumHelp
   
Parallax Forums > Public Forums > Propeller Chip > Wireless Communication  Forum Quick Jump
 
New Topic Post Reply Printable Version
[ << Previous Thread | Next Thread >> ] | Show Newest Post First ]

SAN
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2008
Total Posts : 22
 
   Posted 10/19/2009 7:19 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Hi!
I am making 2 autonomous robot,using Propeller Chip which needs to communicate with each other.
Is it better to use Easy Bluetooth Module(#30085) for this purpose ?
Is it possible to transfer data all the time using a new cog in propeller, even when other cogs are doing another tasks ?
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13559
 
   Posted 10/19/2009 8:28 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
1) Yes, the Easy Bluetooth Module would be a good way for the two robots to communicate as long as you remember the distance limitations (30m).

2) Yes, you can use a cog (probably 2) to completely manage communications using the Easy Bluetooth. You probably will need a 2nd cog to handle the low-level serial I/O and provide a buffered input routine (FullDuplexSerial). The communications management cog would communicate with the other cogs by using shared variables in the main (hub) memory.
Back to Top
 

SAN
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2008
Total Posts : 22
 
   Posted 10/20/2009 3:44 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Thank you very much sir.
One more question...
Is it possible to declare and use 2d array variable in Spin Language for Propeller chip ? - Like other computer language.
Back to Top
 

StefanL38
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Sep 2006
Total Posts : 958
 
   Posted 10/20/2009 5:19 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
You can define as many arrays as you want until the 32kB of RAM is filled up.

Analyse how big the values are that you want to store in the array-elements.
you can define arrays of byte (values 0-255), word(-32767 to 32678 or long (-2.147.483.648 to 2.147.483.648)

arrays of word need two bytes per array-element
arrays of long need four bytes per array-element

best regards

Stefan
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13559
 
   Posted 10/20/2009 5:37 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Your question was about 2D arrays.

Spin only supports 1D arrays. You can't declare 2D or higher order arrays.

Part of the reason for this is that there's limited memory available ... 32K bytes for the storage of a program and its data. It's expensive in terms of memory to store the amounts of data usually involved in 2D arrays. It's not hard to implement 2D arrays using 1D arrays and putting the subscript calculations explicitly like A[ i*5+j ] = B[ j*5+k ] + C[ i*5+k] for A[ i,j ] = B[ j,k ] + C[ i,k ] where A, B, and C are 5 x 5 arrays.

That said, I think one of the 3rd party Spin compilers (homespun) implements multiple dimension arrays.

There's also the Catalina C compiler and, if your programs are not that large, ImageCraft allows free use of their commercial C compiler for programs up to 16K in size.
Back to Top
 

SAN
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2008
Total Posts : 22
 
   Posted 11/3/2009 2:35 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Hello Sir,
I have bought a pair of Parallax Easy Bluetooth Module (#30085).
Now, I want to know how I can connect to bluetooth module for communication ?
Is there any perticular object for that or the Serial obj, cna be used ?
Plz help me.
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13559
 
   Posted 11/3/2009 6:25 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Any of the serial objects can be used to communicate with the Easy Bluetooth module. I would recommend using the FullDuplexSerial object that comes with the Propeller Tool, mostly because it's buffered and can operate at high speeds if you want. The Easy Bluetooth module can operate directly off the +3.3V supply used by the Propeller and can be directly connected to any two I/O pins. I suggest using a series 2.2K resistor in the Tx lead of the Easy Bluetooth module to protect the Prop and Easy Bluetooth module in case you accidentally make the Prop pin an output opposite to the Easy Bluetooth module's signal polarity (one high and the other low). It's not necessary, but it would be prudent.
Back to Top
 

SAN
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2008
Total Posts : 22
 
   Posted 11/3/2009 9:04 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Than u sir.
Now I can connect the module with my PC and its working fine with FullDuplexSerial object.
But my ques is how i can connect two Easy Bluetooth Module ? Is there any command to Specify the MAC address of the bluetooth ?
If u can give me a sample code.
Back to Top
 

w8an
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Jul 2009
Total Posts : 47
 
   Posted 11/3/2009 8:40 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
There is some sample code at the Parallax store...
www.parallax.com/StoreSearchResults/tabid/768/txtSearch/30085/List/0/SortField/4/ProductID/550/Default.aspx
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13559
 
   Posted 11/3/2009 8:45 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
You need to study the documentation, both for the Easy Bluetooth Module and the RBT-001 Bluetooth module that is part of it. All of that documentation and sample code is provided as links on the webpage that wBan mentioned.
Back to Top
 

Ken Peterson
Court Jester



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Mar 2007
Total Posts : 802
 
   Posted 11/4/2009 5:15 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
I would like to point out that although SPIN doesn't support 2D arrays directly, there are several ways simulating a 2D array in code. Search the forum to find them.

Here's one way:

con
  MAX_X = 15
  MAX_Y = 15

var
  BYTE array[(MAX_X + 1) * (MAX_Y + 1)]

pub initialize_array | x, y
  repeat x from 0 to MAX_X
    repeat y from 0 to MAX_Y
      array[x<<4+y] := 0



It helps if your array dimensions are powers of 2 so you can use the "<<" operator.

As for radio links, you may want to look at ZigBee as well.


"A government big enough to give you everything you want, is big enough to take away everything you have. "
- Thomas Jefferson

Post Edited (Ken Peterson) : 11/4/2009 1:21:34 PM GMT

Back to Top
 
[ << Previous Thread | Next Thread >> ]
New Topic Post Reply Printable Version
 
Forum Information
Currently it is Saturday, November 21, 2009 11:43 AM (GMT -8)
There are a total of 393,863 posts in 55,536 threads.
In the last 3 days there were 84 new threads and 713 reply posts. View Active Threads
Who's Online
This forum has 17693 registered members. Please welcome our newest member, Fosco.
77 Guest(s), 10 Registered Member(s) are currently online.  Details
heater, Mike Green, Jim Fouch, JRetSapDoog, Dogg, hover1, Harley, Sapieha, Electronegativity, Tubular