PLEASE PLEASE PLEASE EXPLAIN ME THE WHOLE CODE OF THE SENSOR MONITOR DEMO?
I CAN UNDERSTAND SOMETHING, BUT MOST OF THE CODE IS VERY CONFUSING.
PLEASE EXPLAIN THE CODE DEEPLY?
THANKS A LOT!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
PLEASE PLEASE PLEASE EXPLAIN ME THE WHOLE CODE OF THE SENSOR MONITOR DEMO?
I CAN UNDERSTAND SOMETHING, BUT MOST OF THE CODE IS VERY CONFUSING.
PLEASE EXPLAIN THE CODE DEEPLY?
THANKS A LOT!
To understand the full code read the following pdfs Deeply.
1) Wireless Sensor Monitor Using the eZ430-RF2500.
2)eZ430-RF2500 Development Tool.
3)MSP430x2xx_Family_User's_Guide_(Rev._D)_slau144d.
the complicated things you found are in 3rd pdf. its still though, but it wil help.
which kit r u using? and version?
We'll start with the Demo_AP.c after Main()
Line 150 Initializes the Board (LEDs, Switches, I/O locations, etc)
Lines 152 to 158 Sets the address of the SimpliciTI node. It reads the top part of the flash Info Memory (0x10F0) and if that memory is erased, it will generate a psuedo random number by reading the VLO and using it as a seed number. That seed number will generate the a Random SimpliciTI address, write it to the Flash Info Memory.
Lines 158 to 162 will take the SimpliciTI address written in the info memory and write it to the SimpliciTI Address registers.
Line 163 sets the SimpliciTI node address.
Line 165 initializes the MSP430F2274 specifically the UART and Timer A, and then will transmit a message to the Terminal via line 168
Line 170 does a SimpliciTI init, in which it initializes the device as an Access Point, set up as a Data Hub, with a Join Token defined in SMPL_Config.dat and SMPL_NWK_Config.dat. It also sets up a Callback function sCB that will be used to signal the Data Hub that a message (Join Request or data) has been received.
Line 176 sets up an endless While Loop that will forever do:
a. Line 181, Looks for a Semaphor signalling a Join Request (that was set by the sCB callback function) and has space for a new join (number of devices allowed to join is set by the -DNUM_CONNECTIONS=7 which is line 40 of the smpl_config.dat
b. If a join request was received and there is enough space (less than 7) to add a new peer to the data hub, Line 184 will put the End Device that resides in the data hub into a LinkListen mode and will continue to Listen for a link request until it returns a connection with the device that just joined the network (the battery powered device) if that device does a LinkTo.
c. Line 185's execution means the Link Listen request was responded to, the Data Hub has a new peer, and therefore the number peers that are being supported is incremented (which will be tested against the 7 allowed).
d. Line 186 will ensure that the sCB callback function is not called until line 189 can decrement the number of Join Semaphors by 1 and line 191 allows the sCB callback function to be called.
e. If Timer A expires (about once a second), it will trigger a self measure semaphor that will tell the MSP430 to read it's data converter for temperature and voltage. Line 195 checks for that semaphor
f. Lines 204 to 209 reads the data converter for temperature information. The result is placed in results[0] in line 209. Line 208 turns off the MCU which will sleep until an ADC complete Interrupt occurs.
g. Lines 213 to 219 do the same for the Vcc, storing the results in results[1] in line 218. Line 220 turns off the data converter
h. Lines 225 to 237 convert the temperature and the voltage and place it in the msg[ ] array and writes it to the terminal application
i. Line 245 looks for a peer message (set by a semaphor in the sCB callback function) that would come from one of the battery boards (another end device with a Link ID that came from the Link Listen request)
j. If a peer message is there, line 252 will read all the LinkIDs message storage locations for messages until
1. A message is found, which then the RSSI information and the data from the other end device is sent to the Terminal (via the UART) in Lines 256 and 257
2. or when the message received Semaphor is decremented (Line 260) to zero, which means no more messages are pending
k. The while loop is executed again, via the } in line 266
Line 434 is the Callback function sCB and looks for a Peer data transmission or a Join Request and will increment the Join and Peer semaphors Line 438 and 442 accordingly
That's the bulk of the SimpliciTI Data Hub application (the USB device).
hi...can you help me to develop a wireless chat application with assigning node ids to multiple motes(ez430-rf2500)
plz reply soon....
thnx