Home

EMBEDDED௖PROGRAMMING EMBEDDED

image

Contents

1. Connected World magazine www connectedworld mag com M2M magazine www machinetomachine magazine com M2MXML m2mxml sourceforge net Synapse Wireless Inc SNAP Network Operating System Reference Manual for Version 2 4 2011 http forums synapse wireless com upload SNAP 20Reference 20Manual pdf Technical Manual SNAP Hardware Docu ment Revision v1 3 2010 http forums synapse wireless com upload SNAP 20Hardware 20 Technical 20Manual pdf Telecommunications Industry Association TR 50 Smart Device Communications www tiaonline org standards committees committee cfm commstr 50 M2M Standardization Task Force MSTF www tiaonline org standards mstf index cfm ZigBee Alliance ZigBee RF4CE Overview 2 009 www zigbee org Specifications ZigBeeRF4CE Overview aspx SOURCE SNAP Connect E10 embedded Linux computer Synapse Wireless Inc www synapse wireless com x April 2012 Issue 261 GLA Bestronice Engineering iar tha Propie e Wena ae GH Liman fotears Derrwtogewet Toots i LOCETOA reel Sumas PAGE H PAGE d LE LLAR PROUT Amio Senor baiar NOGHI a Oa LaL YEI amure Depe Motor Pertenece a THON aby LOCATION F LOCAT og Lind iii PAGE PaDE di Pict R CIRCUIT CELLAR DECEMBER 2011 ISSUE 257 coMM PROGRAMMABLE LOGIC Build a Cu MCU Based Sleep Stage Checkout Analysis Mitro Design 3 Hardware Inside the Mind of a with a USL
2. Next the flow con trol for UART1 is disabled CTS1 and RTS1 pins can be used as additional I O The crossConnect function ties both inputs and outputs of one object to another object here DS_UART1 and DS_TRANSPARENT are connected All data received by UART1 is routed to the radio s trans mitter and all data coming into the radio s receiver is routed to UARTI s transmitter using transparent mode Each radio can handle data as trans parent or serial packet which is how RPCs are used Finally the ucast Serial function limits transmis sions to a single node UcastSerial has the advantage of being acknowl edged by the recipient An unacknowl edged transmission will be resent based on the NV configuration ID 19 Radio Unicast Retries Assuming the edited script is loaded into two nodes which have RS 232 level shifters you can connect the nodes to serial devices and you re good to go Note You could connect to the SNAP engine directly and use the TTL level serial signals where RS 232 levels are not needed Since you have a number of NV ID reserved for your use you may want to define one of these as the otherNodes Addr This would enable the script to read this NV ID and use the address stored there as its counterpart Why bother doing this The ability to use a nonvolatile value enables it to be changed without having to rewrite the www circuitcellar com CIRCUIT CELLAR script using a hard
3. www circuitcellar com VIDRE Photo 2 SNAP evaluation boards that accept all SNAP engine modules include the USB bridge module a the Prototypel PCB b and the Prototype 2 PCB c address changes when you disconnect your laptop and reconnect at some other location The IP is fixed to a physical connection To remain inte grated in the mesh when you move you must reestablish your new loca tion with others either directly or through the grapevine On a smaller scale if you work with microcontroller devices you may be familiar with ZigBee mesh networks ZigBee was conceived as the first low power ad hoc protocol in 2003 with the latest incarnation being ZigBee PRO It should be noted that the ZigBee Alliance has recognized the need for simpler networks that remain within earshot no repeaters and has intro duced ZigBee Radio Frequency for Con sumer Electronics RF4CE A typical ZigBee network may consist of three types of devices a ZigBee Controller Reserved for Synapse use ID 18 ZC a ZigBee Router ZR and a Zig Bee End Device ZED A single ZC originates and coordinates the network keeping track of all active nodes ZRs can pass communication as a repeater and act as an endpoint for service while ZEDs are strictly endpoints There are other protocols available you should consider when looking for something to use with your new widget You may want to consider Wi Fi Blue tooth o
4. application rpc dstAddr remoteFnObj args RPC unicast that turns your PC into a SNAP node mcastRpc dstGroups ttl RPC multicast enabling it to be part of the SNAP net remoteFnObj args work through a bridge node connected via a serial or USB connection I used a SNAP stick a USB SNAP node dongle see Photo 2 as this bridge SNAP Por tal is an incredible application tool that enables you to develop download and interact with every node on the SNAP network Wait if SNAP devices already handle all the networking tasks for me what am I developing While it s true you don t have to worry about the net work stuff you will most likely want to gather disseminate and make use of data This requires application program ming specific to your task at hand a standard communication protocol Nonvolatile NV Parameters loadNvParam id Load indexed parameter from NV storage saveNvParam id obj Save object to indexed NV storage location Radio rx isEnabled Enable disable radio receiver txPwr power Adjust radio transmit level 0 is lowest 17 is highest setChannel channel Set radio channel getChannel Radio channel getLq Link quality in dBm getEnergy Detected RF energy in dBm current channel scanEnergy Detected RF energy in dBm all 16 channels peekRadio addr Read a memory location from inside the radio pokeRadio addr byteVal Write a memory location insi
5. color TFT LCD screen CDe6062 399 World s Smallest The world s smallest MSO This DIP sized 200kHz 2 channel scope includes a spectrum analyzer and arbitrary waveform generator It measures only 1 x 1 6 inches in size Xprotolab 49 i688 100MH2 M20 _ 2 channel 100MSa s oscilloscope and 8 ch logic analyzer USB 2 0 and 4M samples storage per channel with sophisticated triggering and math functions C2328A 1359 Handheld 2OMHz Ving Fast accurate handheld 20MHz 1 ch oscilloscope 100 M S sample rate SpE 3 5 in color TFT LCD 6 hour battery life Inc rugged impact resistant case HD amp 1021M 289 95 cae selections at ba a T b 4 Follow us on z April 2012 Issue 261 When Invoked Called on device bootup Parameters HOOK_STARTUP passes no parameters Hook Name HOOK STARTUP Sample Signature SetHook HOOK _STARTUP def onBoot pass setHook HOOK _GPIN def pinChg pinNum pass setHook HOOK_1MS def doEverylms tick pass HOOK_GPIN Called on transition of a monitored hardware pin pinNum The pin number of the pin that has transitioned 1 isSet A Boolean value indicat ing whether the pin is set isSet HOOK_1IMS Called every millisecond tick A rolling 16 bit integer incremented every millisecond indicating the current count on the internal clock The same counter is used for all four t
6. different ring tone you can do this by using multiple inputs You might create multiple button inputs with each input associated with a particular value Or you might assign one input for the button and other inputs to configuration jumpers that the script can read as a selected value In either case the value is sent as the function s argument defining which bell has been requested It can be noted that additional bell nodes could be placed in every room of the house all happy to execute their annun ciation when requested by any door Suppose the piezo ele ment and associated transistor driver were not installed on the node The SNAP device doesn t care in fact it doesn t even know So we could do additional things on this node like flash a light on and off simply by using an unused I O pin to drive any support circuitry needed for the task and include the script statements necessary to support that task This way any bell node could have a different arrangement of circuitry and still use the same node script SPREADING THE WEALTH Perhaps you can begin to see the possibilities with this type of network where everyone is created equal Every node has the potential to act on data received from any other node in the network Imagine your spouse complain ing that the room lighting is a safety hazard at night You could jump onto the network and tell the reading lamp to pay attention to the hall light switch
7. not a UART The talk of connecting the UART object to the TRANSPARENT object makes a good mental picture how ever there are other objects that don t require a connection at all These are all SNAPPy API functions and can be used at any time Referring back to Table 1 you can see that the scripts can contain functions that communicate with external CBUS SPI and PC slave devices physically attached to predefined I O pins Internally there are GPIO digital I O pins for logic monitoring and control as well as an analog to digital converter ADC for converting analog inputs Let s consider an example that uses only GPIO The simplest example I can think of might be a wireless doorbell One node has a push button connected to a digital input pin and the other node has a piezo element connected to a digital output pin If the push button event uses a mul ticast function like mcastRcp group ttl function arguments then it doesn t even need to know where it is sending the message The function will execute on any node that hears it If the second node has its piezo element connected to the GPIO associated with pulse width modu lation PWM then the script can simply beep or if you re clever it can play a little ditty You could simply add more push button nodes for the other doors In fact each door button could request a different tone pattern To eliminate having to program each button node with a different script requesting a
8. phase bit order and physical interface spiRead byteCount bitsInLastByte Receive data in from SPl returns response string three wire SPI only spiWrite byteStr bitsin LastByte Send data out SPl bitsInLastByte defaults to 8 can be less spiXfer byteStr bitsin LastByte Bidirectional SPI transfer returns response string four wire SPI only Switchboard crossConnect dataSrc1 dataSrc2 Cross connect SNAP datasources uniConnect dst src Connect src gt dst SNAP datasources System getMs System ms tick 16 bit getInfo which Get specified system information getStat which Get radio traffic status information call Invoke a user defined binary function peek addr Read a memory location poke addr byteVal Write a memory location errno Read and reset last error code imageName Name of current SNAPPy image random Returns a random number 0 4095 reboot Reboot the device sleep mode ticks Enter Sleep mode for specified number of ticks reso lution accuracy and maximum duration vary between hardware platforms For example on an RF100 SNAP engine In mode 0 ticks are 1 024 s each 30 In mode 1 ticks are 1 s each and can be 0 1073 On some platforms negative values for ticks produce times shorter than 1 s UARTs initUart uartNum bps Enable UART at
9. DIY Smart Electronic Microprocessor Developer Thermal A Embedded Linux System Platforms Interference Immunity tmin fOr Electronic EA Joystick Control v Bluetooth Connectivity iia specializing in embedded systems and design 12 issues per year for just Print OR Digital 50 Combo Print Digital 85 www circuitcellar com subscription
10. OK_RPC_SENT does not necessarily indi cate that the packet was sent and received successfully It is an indication that SNAP has completed processing the packet setHook HOOK_RPC_SENT def rpcDone bufRef pass Table 3 S5NAP is an event driven language These functions are built in events that a SNAPPy script can use within its application looking for a pairing request by enabling the whol sOut There function A second push button iAmLooking could invoke the whol sOutThere function using setHook HOOK_GPIN The first responder would get paired Another approach might be to use the node s serial con nection and a terminal program A command line interpreter script would enable you to request and collect responding node addresses display and choose from among the avail able nodes How does a command line interpreter relate to a node that is being used as a transparent serial link The transparent application just shuffles data from endpoint to endpoint the UART at each end of the wireless link A command line interpreter will recognize specific data to ini tiate some event In the crossConnect DS_UART1 DS_TRANSPARENT of the first example there is no way for any of the data passing through to be analyzed If you use crossConnect DS_UART1 DS_STDIO then you are con necting user I O to UART1 Data received by the UART is available through the event setHook HOOK_STDOUT Any function can send data to the UAR
11. Q amp A Electronics Engineering for the People PROJECT WRAP UP DIY Color Identifier INSIGhT Linux Software Development Tools LOCATION Australia LOCATION United States LOCATION United States PAGE 22 PAGE 28 PAGE 64 GIRGUIT CELLAR TENORO OROCEMOR EMBEDDED ELECTRONICS O a INf ORMATION EMBEDDED PROGRAMMING TE oh Build a Capacitive Touch Personal Amp An MCU for Low Power Applications Mesh Networking with the SNAP OS a An Examination of EE Capacitors a Il Automatic Code Generators Tas ae Il Configuration Control Programs Fae 7 2527457534909 M BON te Were Il Testing Verification amp Validation ae 7 50 US oe 50 cana a wer 2 essa II And More Mn et a ee ae SS a Automation Reduces Repetitive Tasks ha Se seins N i SIIS Reprinted by permission For subscription information call 1 800 269 6301 or visit www circuitcellar com subscriptions Entire contents copyright 2012 Circuit Cellar Inc All rights reserved by Jeff Bachiochi USA ROM THE BENCH QO April 2012 Issue 261 SNAP to It Part 1 Mesh Networking Simplified Mesh networking relies on nodes to capture distribute and reproduce data It is the glue that Keeps the Internet and cellular towers connected While there are many standard protocols available for localized networks e g Wi Fi Bluetooth or wireless USB this article focuses on the SNAP network operating system crea
12. T for transmission via the print statement Data is available as characters Mode 1 or carriage return CR terminated lines Mode 0 using stdin Mode Mode Echo Echo 1 will resend the characters back to the sender With this setup you can monitor the data and look for a specific string like the used in systems to provide an AT command set to trigger a redirection of data This might be the checkForNodes function described earlier after which data would again become transparent If you followed this you may be thinking transparent with what There is no connection now to DS_TRANS PARENT and the radio That is correct and it is illegal to connect a source like the UART1 with two destinations like DS_STDIO and DS_ TRANSPARENT However we can use the Rpc address function arguments state ment to request the execution of a user function which could pass any data as the argument of that function On the far end that function can perform any necessary dis section of the data or merely use the print statement to pass it onto the UART In this case the UART and the STDIO objects are cross connected and the radio connec tion is made through RPC functions of the SNAPPy API LOOK MOM NO HANDS Most of the discussion so far has been on wirelessly CIRCUIT CELLAR www circuitcellar com connecting two UART objects It s an activity that most can relate to What happens when the object is
13. and voila an extra light now goes on and off with the hall switch I looked briefly at using a command line interpreter with a SNAP node which can give your PC applications the www circuitcellar com CIRCUIT CELLAR ability to interact with your scripts via a serial connection Optionally the licensed SNAP connect server application will enable your applications written in almost any lan guage to directly invoke functions on any SNAP node even over the Internet using XML RPC The term machine to machine M2M is becoming a pop ular phrase today as it refers to the technologies that enable systems to communicate with one another You know things are getting serious by the number of standards committees that have been formed This just may be one market where we can flex our technological muscles And if security is an issue for you each SNAP device has a Basic encryption algorithm built in AES 128 encryption is also available on most devices by simply downloading a special version of the SNAP OS It is good programming practice to be confident in your application before turning on any encryption as debugging and use of the sniffer will be all but futile al Jeff Bachiochi pronounced BAH key AH key has been writing for Circuit Cellar since 1988 His background includes product design and manufacturing You can reach him at jeff bachiochi imaginethat now com or at www imaginethatnow com RESOURCES BiTXml www bitxml org
14. coded address each time you want to pair up a set of nodes as in the first example Wouldn t it make sense to be able to pair SNAP nodes dynamically There are two ways of transmitting data The first was just discussed uni castSerial the second is multi castSerial When you send data using mul ticastSerial it is sent as an unacknowledged message to all nodes You can think of it as a general shout out We ve already seen that the user can define a function as in the StartupEvent of the first example Suppose I defined a checkFor Nodes function consisting of mcast Rpc 1 1 wholsOutThere This RPC would be multicast to all nodes in group all using 1 hop looking to invoke the function whol sOutThere on all those nodes listening If the whol sOutThere function is defined consisting of the RPC function rpc rpcSourceAddr iAm then this enables the node to respond to the one who originated the request with a unicast RPC requesting to invode func tion iAm The originator s function i Am consisted of otherNodesAddr rpc SourceAddr the variable otherNodesAddr would then hold the node ID of the first responding node Finally if the originator unicast back the rpc rpcSourceAddr i Am function the responder could complete transaction knowing it was chosen as the pairing node While this description is a bit simplistic I hope you can see how one node may discove
15. de the radio Table 2 continued from p 70 continues on p 72 Mesh Networking Simplified ya Everything you need Experience the Fastest Growing Mesh Network Technology SNAP from Synapse Wireless Easiest platform for rapid prototyping and development Over the air programming with free IDE called Portal Batteries included for remote control applications Get ready for a world of Smart Machines Get SNAP SNAP Network Starter kit Order yours today MSRP 99 00 synapse wireless com kit Risk rreo A O A y Wireless Technology to Control and day money as A TM back guarantee s aaa Monitor Anything from Anywhere E April 2012 Issue 261 www circuitcellar com CIRCUIT CELLAR m N April 2012 Issue 261 One of the most useful applications for a node is to become a SNAP sniffer When a node is pro grammed as a SNAP sniffer it monitors all net work traffic and when connected to a PC run ning the free sniffer application you can see and log the data for debug purposes The SNAP OS handles all the networking tasks and provides the user with a Python like virtual machine within each SNAP device Your applications are written in this script language called SNAPPy a subset of Python SNAPPy scripts are text files that are compiled into SNAPPy images to save space You can create a single SNAPPy script for all nodes or create spe cialized scrip
16. erial connection This is a typical applica tion for connecting two serial devices wirelessly without a physical connection between them One important note here is that there must be some way for nodes to identify their counterpart A node is uniquely identified by its node address which is the last 3 bytes of its MAC address printed on the label attached to each device and pre programmed into configuration register ID2 The script in Figure 1 is the same for each node except that the node address of its counterpart is fixed within the script that is downloaded to a node Let s go over this example script The first line imports the switchboard py script from CIRCUIT CELLAR www circuitcellar com the Synapse subdirectory This script defines each data source DS object that can be used by the cross Connect and uniConnect functions Here DS_UART1 and DS_TRANSPARENT are used The second line defines the other node s address which is used as the ucast destination for all outgoing communication The third line indicates the beginning of an event indicated by the setHook function See Table 3 for a list of the available event hooks This event is called upon reset and will run once The user defined function startup Event is all that is needed to com plete this application This function initializes UART1 for 9600 bps note the databits parity and stopbits are not explicitly defined and so they default to 8 N 1
17. function of power output low power radios have a rather limited range This can be a good thing if you wish to limit the interference you cause It can be a bad thing if you need to span a consider able distance within a group of radios When a radio must not only transmit and receive its own data but also relay the data of others it is being used as part of a mesh network As one may expect the strategies for this may be as simple as every radio repeating what it has heard or as sophisticated as dynamic mapping of the most efficient route The simplest strate gies can create a throughput clogging uproar of activity as each receives and retransmits the same message So at least a little bit of smarts are required to cut this to an acceptable level MESH NETWORKS You can think of the Internet as the world s largest wired mesh network Information trav els from one router repeater director to the next until it reaches its destination Your IP aT WH T RF ENGINE RFE W 001C2C1E vA 86001082 FCC ID USO RFE IC 7084A RFE E ail a L A a A AELE STs ca ki k j u3999779932 0 ey RL B RF ENGINE RFET HE Mal bare O01C2CIE Ys T OD6001389 FCC D U90 RFET IC_7084A RFET ies 5 pi il F e r e pan 5 NOFSEHIRPLESS COM Photo 1 SNAP engine modules are available with an integrated antenna a and an RP SMA connector for using an external antenna b CIRCUIT CELLAR
18. iming hooks HOOK_10MS setHook HOOK_10MS def doEveryl0ms tick pass Called every 10 ms tick A rolling 16 bit integer incremented every millisecond indicating the current count on the internal clock The same counter is used for all four timing hooks HOOK_100MS setHook HOOK_100MS def doEveryl00ms tick pass Called every 100 ms tick A rolling 16 bit integer incremented every millisecond indicating the current count on the internal clock The same counter is used for all four timing hooks HOOK_1S setHook HOOK_1S def doEverySec tick pass Called every second tick A rolling 16 bit integer incremented every millisecond indicating the current count on the internal clock The same counter is used for all four timing hooks data A data buffer containing one or more received characters HOOK_STDIN setHook HOOK_STDIN def getInput data pass setHook HOOK STDOUT def printed pass Called when user input data is received HOOK_STDOUT Called when user output data is sent HOOK_STDOUT passes no parameters m oN April 2012 Issue 261 HOOK_RPC_SENT Called when the buffer for an outgoing RPC call is cleared bufRef an integer reference to the packet that the RPC call attempted to send This inte ger will correspond to the value returned from getInfo 9 when called immediately after an RPC call is made The receipt of a value from HO
19. l 2012 Issue 261 THE NEW PICOSCOPE 2205 MSO MIXED SIGNAL OSCILLOSCOPE GREAT VALUE PORTABLE HIGH END FEATURES AS STANDARD AND EASY TO USE Think Logically ICO P Technology 2 Analog 16 Digital Bandwidth Analog 25 MHz Digital frequency Digital 1OOMHz combined Sampling rate 200MS s Trigger modes Edge Window Pulse width Window pulse width Dropout Runt pulse Digital Logic Price 575 www picotech com pco467 1 800 591 2796 Window dropout Interval Datamode py from synapse switchboard import otherNodeAddr setHook HOOK STARTUP def startupEvent xO00 x00 xFF lt put the address of the OTHER node here initUart 1 9600 lt put your desired baudrate here flowControl 1 False lt set flow control to True or False as needed crossConnect DS_UART1 DS TRANSPARENT ucastSerial otherNodeAddr Figure 1 This simple script can be loaded into two nodes enabling them to act as a wireless serial link between two R5 232 devices ADC readAdc channel Sample ADC on specified input channel returns raw reading CBUS Master Emulation cbusRd numToRead Reads numToRead bytes from CBUS returns string cbusWr byteSir Writes every byte in byteSir to the CBUS GPIO setPinDir pin isOutput Set direction for parallel I O pin setPinPullup pin isEnabled Enable pull up resistor for Input pin setPinS
20. lew pin isRateCon Enable slew rate control for Output pin monitorPin pin isMonitored Enable GPIN events on Input pin pulsePin pin msWidth isPositive Apply pulse to Output pin readPin pin Read current level of pin writePin pin isHigh Set Output pin level setRate rateCode Set pin sampling rate to off 0 100 ms 1 10 ms 2 or 1 ms 3 C Master Emulation getl2cResult Returns the result of the most recent 1 C operation i2cInit enablePullups Prepare for C operations i2cRead str numBytes retries ignoreFirstAck Write str out then read numBytes back in from I C bus Parameters retries and ignoreFirstAck are used with slow or special case devices i2cWrite str retries ignore FirstAck Write str out over the I C bus Parameters retries and ignoreFirstAck are used with slow or special case devices Miscellaneous setSegments segments Set eval board LED segments clockwise bitmask bist Built in self test eraselmage Erase user application flash memory resetVm Reset the embedded virtual machine prep for upload initVm Initialize embedded virtual machine vmStat statusCode args Solicit a tellVmStat for system parameters writeChunk ofs str Write string to user application flash memory chr number Returns the character string representation of number st
21. r another node and swap node addresses by a mix of multicast and unicast transmissions Here are a few things you must think about for this to work Assuming all nodes are using the same script with all of the above functions there must be a way of determining when these func tions should be allowed What if there are more than two nodes out there If a paired set of nodes has already saved the NV ID defined as otherNodes Addr you could skip all of this pairing If a findNewNodeAddress push button is implemented using setHook HOOK_GPIN then a function might clear the NV ID otherNodesAddr Any nodes with an erased address would be S N j ee i j t 1 CT CCOPE CELECTIE oe maya a s J i 4 i p Ay fin J IE AY j pe Bl 7 25MHz2 Scope Remarkable low cost 25MHz 2 channel plus trigger USB bench scope with 8 inch full color LCD display Spectrum analysis and autoscale functions PD250222 979 iPhone Scope 5MHz mixed signal yy oscilloscope adapter for the iPhone iPad and iPod Touch A FREE iMSO 104 app is available for download from Apple App Store iM amp 0 104 297 99 100MHz Srope High end 1OOMHz fags 165a s 2 channel ae a benchscope with me i 1MSa memory and USB memory port Includes a FREE scope carry case New low price D21102E 399 zA 6GOMHz Scope yeee SOMHz 2 channel g digital scope with a s500 MSas sample rate 10M5a memory amp 8
22. r ob j Returns the string representation of obj int obj Returns the integer representation of obj Notice that you cannot specify the base Decimal is assumed len str Returns the length of string str 0 255 random Returns a pseudo random number 0 4 095 stdinMode mode echo Mode is 0 for line 1 for character at a time Table 2 continued on p 71 Table 2 The built in SNAPPy API functions available grouped together by the category CIRCUIT CELLAR e www circuitcellar com Network SNAP network and a Linux environ getNetld Current network ID ment running SNAP Connect SNAP setNetld netld Set network ID 1 OxFFFE Connect is a licensed API that enables localAddr Local network address 3 byte binary string client applications to access the SNAP rpcSourceAddr Originating address of current RPC context none if network using XML RPC XML RPC is called outside RPC mceastSerial dstGroups ttl Set serial transparent mode to ee utilizing hypertext transfer protocol ucastSerial dstAddr Set serial transparent mode to unicast HTTP to transport remote procedure callback callbackFnObj RPC back to the original invoker of RPC results calls RPCs encoded using eXtensible remoteFnObj args callout addr callbackFnObj RPC to an arbitrary node address of RPC results Markup Language XML _ remoteFnObj args SNAP Portal is a free PC
23. r wireless USB as capable candi dates depending on the application Or read on further as I take you through the SNAP network operating system OS created by Synapse Wireless SYNAPSE WIRELESS Not to be confused with USNAP see my article Smart Network Access Point Circuit Cellar 246 2011 Synapse Wireless has created a family Collision avoidance ID 40 of products around the SNAP OS which is a communication and control protocol used to create and maintain a mesh network of SNAP nodes SNAP nodes contain a SNAP device a micro controller executing the SNAP OS that interfaces with communication hardware i e radio I O A SNAP device can be integrated directly into your product but is also available as part of a SNAP engine The SNAP engine contains a SNAP device and radio prepackaged as a standard foot print module providing a common development interface see Photo 1 A SNAP bridge is a SNAP node used to connect two networks such as a SNAP network and the Internet SNAP Connect E10 a PC or a second SNAP network For instance the SNAP Con nect E10 is an end product incorporating a SNAP node as a bridge between a SNAPPy CRC Reserved for Synapse use ID 19 Radio unicast retries ID 41 Platform MAC Address ID 20 Mesh routing maximum timeout ID 42 49 Reserved for future use Network ID ID 21 Mesh routing minimum timeout ID 50 Enable encryption Channel ID 22 Mesh ro
24. specified rate zero rate to disable initUart uartNum bps dataBits parity stop Enable UART at specified rate zero rate to disable data bits parity and stop bits flowControl uartNum isEnabled Enable RTS CTS flow control If enabled the CTS pin functions as a Clear to Send indicator flowControl uartNum isEnabled isTxEnable Enable RTS CTS flow control If enabled and param eter isTxEnable is True then the CTS pin functions as a transmit enable TXENA signal If enabled and is xEnable is False then the CTS pin functions as a Clear to Send indicator Table 2 continued from p 71 accomplished wirelessly using the bridge node Let s start with a simple script that enables two nodes to available for use within SNAPPy scripts that a node will execute The best way to learn how these are used is to look at the demos that are available for use Many of these were designed for use with the SNAP prototyping or demo boards that form the basis of evaluation kits These boards will accept the complete line of SNAP engines that plug in with the standard footprint While two nodes form the minimum network I will be using three nodes one of which is the node used exclusively as a bridge from the PC to the network A bridge node makes development much easier because you do not have to plug each node into the PC to program your SNAPPy script into it This can be act as a wireless s
25. ted by Synapse Wireless he telephone has all but eliminated letter writing the long time de facto standard for keeping in touch with friends and families Today not only has this convenience gone wire less but it is being used for far more than stay ing in contact with one another Parents arm their kids with cell phones for peace of mind Kids have a texting agility that is inherited from their video gaming skills It s a sad com mentary that there are far fewer minutes devoted to cell conversations than the senseless plethora of audio and video candy available When our Boy scout troop goes camping we encourage the boys to leave all of their electron ics at home When traveling any distance we use walkie talkies for communication between vehicles even though the adults have cell phones The boys share a responsibility to keep tabs on every vehicle in the group and make sure no one takes an unexpected turn It amazes me how each GPS will calculate certain routes differently This convoy style string can sometimes exceed the distance of a walkie talkie making the middle vehicles the only link between the front runner and the rear sweeper Communication must be relayed repeated by one radio that has contact with those ahead and behind The number of repeats or hops is related to how much the vehicles are spread out and the range of the radios So it is with low power communications Since transmission distance is a
26. ts for each node Before I get into the SNAPPy scripting language let s look at mesh networks in general and see how SNAP handles different situations A MISHMASH OF MESHING One feature of SNAP networks is that by design the protocol doesn t require any coordina tor to keep track of everything Each SNAP node can automatically retransmit a request to help reach nodes beyond the range of the sender If every node was to do this there could be a lot of unnecessary chatter Therefore it is important that SNAP recognizes who is not only within range but who has the best shot at communicat ing with a neighbor signal strength SNAPPy script functions that send data include parameters that adjust how a message is sent and retransmitted These include the ability to isolate certain nodes by forming subgroups and defining how many times a message can be retransmitted Many functions are based on a configured param eter SNAP uses nonvolatile memory to store these configurations between power cycles and resets About half of the allocated space for these parame ters is available for user defined parameters see Table 1 Network parameters can be adjusted to optimize how the nodes react depending on your network s physical configuration SNAPPy Table 2 shows the built in functions that each node has SPI Master Emulation spilnit cpol cpha isMs bFirst isFourWire Setup for SPI with specified clock polarity clock
27. uting new timeout ID 51 Encryption key Multicast processed groups ID 23 Mesh routing used timeout ID 52 Lockdown Multicast forwarded groups ID 24 Mesh routing delete timeout ID 53 Maximum loyalty Manufacturing date ID 25 Mesh routing RREQ retries ID 54 59 Reserved for future use Device name ID 26 Mesh routing RREQ wait time ID 60 Last version booted deprecated Last system error ID 27 Mesh routing initial hop limit ID 61 Reboots remaining Device type ID 28 Mesh routing maximum hop limit ID 62 Reserved for future use Feature bits ID 29 Mesh sequence number ID 63 Alternate radio trim value Default UART ID 30 Mesh override ID 64 Vendor specific settings Buffering timeout ID 31 Mesh routing LQ threshold ID 65 Clock regulator Buffering threshold ID 32 Mesh rejection LQ threshold ID 66 127 Reserved for future use Intercharacter timeout ID 33 Noise floor ID 70 Transmit power limit Carrier sense ID 34 38 Reserved for future use ID 128 254 Available for user definition Collision detect ID 39 Table 1 Nonvolatile memory is set aside for internal parameters that support function configuration Additional slots are reserved for the user www circuitcellar com CIRCUIT CELLAR Radio LQ threshold ID 255 Reserved for Synapse use April 9012 Issue 261 o m Apri

Download Pdf Manuals

image

Related Search

Related Contents

Instruções de Utilização Manual de instrucciones  OmniMount CL-S  (M)SDS - 純正化学株式会社 製品検索・MSDS検索  TOYOTA bB Funcargo Vitz ist  Der HDC-500 im Einsatz  X Juegos Deportivos Centroamericanos Beisbol Manual Técnico  JVC HR-P125EE User's Manual  TG I50d deutsch TG I50d english TG I50d français    User`s Manual  

Copyright © All rights reserved.
Failed to retrieve file