Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLIP-Radio support for Econotag #1

Closed
sdawans opened this issue Feb 19, 2013 · 4 comments
Closed

SLIP-Radio support for Econotag #1

sdawans opened this issue Feb 19, 2013 · 4 comments
Assignees

Comments

@sdawans
Copy link
Collaborator

sdawans commented Feb 19, 2013

Kerry Lynn asked about supporting Slip-Radio on Econotag.

I look forward to getting this working with ingredients I have close at hand: namely the
Raspberry Pi with an Econotag radio.  If you already have this recipe handy
then please point me to it, otherwise I shall gain familiarity by first building
the 6lbr for an Ubuntu system and then move to Raspbian.
@ghost ghost assigned laurentderu Feb 19, 2013
@sdawans
Copy link
Collaborator Author

sdawans commented Feb 19, 2013

What I replied:

You can indeed use the RPi as 6LBR host platform, and the Econotag as a SLIP-radio. 
The application we use for slip-radio is the one in /examples/ipv6/slip-radio and you can build 
it for the econotag target.
Just a small detail - in slip-radio, the border router sends '!C' to the mode to set the 802.15.4 
channel number. Setting the channel number isn't part of the Contiki Radio API, and the 
slip-radio example uses cc2420_set_channel(). We modified the slip-radio example in the 
6LBR repository to support another platform, which has an RF230 radio.
In slip-radio.c, we select a command handler depending on the platform:
    #ifdef CONTIKI_TARGET_SKY
    int cmd_handler_cc2420(const uint8_t *data, int len);
    #elif CONTIKI_TARGET_NOOLIBERRY
    int cmd_handler_rf230(const uint8_t *data, int len);
    #endif /* CONTIKI_TARGET */
An the rest is implemented in target-specific files ( slip-radio-rf230.c and slip-radio-cc2420.c). 
I haven't tested building slip-radio for econotag, but it should be straightforward to build it, and 
fairly easy to add an extra #if and source file to implement econotag-specific channel switching.
My collegue Laurent who is reading this list couldn't stop himself from testing this modification 
as we speak, so half of my email is already outdated :)
We will let you know when it's ready.

@sdawans
Copy link
Collaborator Author

sdawans commented Feb 19, 2013

implemented by @laurentderu in 06458cc

@sdawans
Copy link
Collaborator Author

sdawans commented Feb 19, 2013

06458cc could be pulled into Contiki as is.
so can 5cca059 (slip radio for nooliberry)

@laurentderu do the top 2 commits on https://github.com/cetic/contiki/tree/slip-radio-platforms look sane to you?

Also, what about modifications in contiki-sky-main.c c67bf67 + 6af36bc ? Do we need this for other slip-radio platforms in 6lbr?

laurentderu pushed a commit that referenced this issue Apr 24, 2014
…ia Z1).

The following problems were present in the existing DCO calibration algorithm:

Problem #1. In function msp430_quick_synch_dco(), the "for(i=0; i < 1000; i++) { .. }" loop is optimized away by the compiler, as i is not volatile. Making i volatile would improve the results, but would not be sufficient: see the next point.

Problem #2. According to MSP430F2617 Device Erratasheet, bug BCL12 precludes a naive implementations of "fast" calibration altogether. The bug is present on all MCU revisions up to date.

The description of the bug:
"After switching RSELx bits (located in register BCSCTL1) from a value of >13 to a value of <12 OR from a value of <12 to a value of >13, the resulting clock delivered by the DCO can stop before the new clock frequency is applied. This dead time is approximately 20 us. In some instances, the DCO may completely stop, requiring a power cycle.

Furthermore, if all of the RSELx bits in the BSCTL1 register are set, modifying the DCOCTL register to change the DCOx or the MODx bits could also result in DCO dead time or DCO hang up."

In Contiki code for msp430f2xxx @ 8MHz, the RSEL search currently typically goes from 15 down to 11, thus violating the rules.

Step-by-step RSEL change is proposed as the best possible workaround:
"[..] more reliable method can be implemented by changing the RSEL bits step by step in order to guarantee safe function without any dead time of the DCO."

Problem #3. The old Contiki code started from the highest possible calibration values: RSEL=15, DCOx=7. According to MSP430F2617
datasheet, this means that the DCO frequency is set to 26 MHz. For one, Vcc under 3V is not supported for this frequency, so this means that battery-powered nodes have a big problem. The minimal operating voltages are:
- 1.8V for RSEL <= 13
- 2.2V for RSEL = 14
- 3.0V for RSEL = 15
So the correct way is to always start calibration from RSEL <= 13, unless explicityly pre-calibred values are present.

Problem #4. Timer B should be turned off after the calibration, following the "Principles for Low-Power Applications" in MSP430 user's Guide.

The patch fixes these issues by performing step-by-step calibration and turning off Timer B afterwards. As opposed to MSP430F1xxx calibration, this algorithm does not change the ACLK divider beforehand; attempts to make calibration more precise would lead to looping in some cases, as the calibration step granularity at larger frequencies is quite big.

Additionally, the patch improves DCOSYNCH_CONF_ENABLED behavior, allowing the resynchronization to correct for more than one step.
@jonwigwag
Copy link

How, do you burn slip-radio_econotag.bin to the econotag. I tried using the ./mcburn.sh that i normally use to flash the econotag. Now in the process when I need to reset ship to start program the econotag doesnt reset. Is there a different way i need to flash econotag?

bregell pushed a commit to bregell/6lbr that referenced this issue Mar 18, 2015
Updated with the latest cc2538dk uart configuration files
laurentderu pushed a commit that referenced this issue Sep 14, 2015
Remove doxygen explicit links to non-existing symbols
laurentderu pushed a commit that referenced this issue May 24, 2016
…ation

Remove duplicate block and define the argument of -a using $(shell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants