From: E. G. <en...@ge...> - 2008-09-18 11:14:13
|
Hi, I had asked Adam to help but imagine that he is overloaded with emails and perhaps this is the most proper place to get help. So, let's go: I'm Brazilian student of Information Systems graduation at Unisinos<http://www.unisinos.br/>University, in São Leopoldo. I've received a "mission" from my teacher of Operating Systems discipline: make an article about Contiki OS. The article must contains, at least, the following subjects: - Structure (how is the structure, architecture, applications (why Contiki exists?) ...) - Processes (scheduling, supported thread types, how are processes synchronization) - Memory (how it is managed, swapping, virtual memory) I've collected some information searching over the internet, but your help about this would be greatly appreciated, as it would be safe and worth a good scores in my article. Can you give to me some information? If you have other important information, be sure to write. Any help will be greatly appreciated. Sorry for my bad English. I promise that I will try more. Regards, Enéas Gesing |
From: Oliver S. <ol...@we...> - 2008-09-19 00:00:58
|
Hi Enéas, > Sorry for my bad English. I promise that I will try more. In case you shouldn't receive any substantial responses rest assured that this isn't due to any deficiencies in your language - which is just fine. Rather it's because entry level questions tend to get no attention on this list. Maybe because the regular readers think that questioners should first invest more of their own time before asking others to invest time for them. Just my two cents, Oliver |
From: Jonathan L. <jo...@cs...> - 2008-09-25 13:07:55
|
Hi guys, To set the scene, I am part of a team implementing a high-level component-based language called Insense for use on resource constrained devices such as the Tmote Sky nodes. http://www-systems.cs.st-andrews.ac.uk/wiki/Dias/InsenseLanguage Thanks to Contiki our work has been fairly straight forward in not having to deal with very low-level issues, well done ... ;-) Recently I've been playing about with a Scheduler component that we want to provide as part of our language and we would ideally like to incorporate some power-management features. So I started playing around with low-power modes under Contiki. As far as I can tell, sending the processor to sleep when nothing is to be done using the _BIS_SR(GIE | SCG0 | SCG1 | CPUOFF); (not sure why Contiki leaves out the SCG1 flag, seems to work fine when it is added, but that is not my main concern here, although I am intrigued) statement in the contiki-sky-main.c scheduler loop saves roughly 1mA when there is nothing to do. I get a pretty constant usage of around 2.5-2.6mA without the sleep statement and roughly 1.5-1.6mA with the sleep statement in place (excluding current spikes due to radio listen as set in xmac.c). Even sending the processor into LPM4 doesn't make a huge difference, maybe takes off another 0.05mA. To clarify how I measure current: I am using an oscilloscope to measure the voltage drop over a small resistor that is in series with the battery supply to the device. I have experimented with 10 and 100 Ohm resistors, both show the same 1.5-1.6mA results. 1) My main query is why we don't seem to get anything near the low μA usage as outlined in the tmote datasheet (values shown below). Maybe I'm reading the figures in the datasheet wrong or the figures in the datasheet are somewhat optimistic, maybe some other parts of the tmote can be switched off but aren't, maybe ... ? I was wondering if anyone had had similar experiences and/or has an explanation. 2) It is also odd that I can hardly detect the wake-sleep cycles. I can just about see small blips (of less that 100μA) roughly every 15ms (64 times a second) within the fairly constant 1.5mA (1.6mA for tmote with sensors) trace. I am no electronics expert, but my initial thought for this one is that I'm running into some sort of resolution issue in that the scope isn't picking up the change in voltage drop over the resistor for very small times (when the processor wakes up for some micro-seconds and goes back to sleep as nothing needs doing). 3) Has anyone experimented with waking the tmote up from LPM4? If anyone has any info here that would be great. 4) Apart from setting XMAC_CONF_OFF_TIME at compile time, is there any way (without hacking Contiki or duplicating code) of altering the CC2420 power cycle at runtime? If anyone can shed any light on the above, that would be great. The values taken from the tmote datasheet are below. Cheers Jon ----------------------------------------------------------------- According to the tmote datasheet we should be able to expect around the following for the device as a whole (I think) NOM MAX UNIT Current Consumption: MCU on, Radio RX 21.8 23 mA Current Consumption: MCU on, Radio TX 19.5 21 mA Current Consumption: MCU on, Radio off 1800 2400 μA Current Consumption: MCU idle, Radio off 54.5 1200 μA Current Consumption: MCU standby 5.1 21.0 μA ----------------------------------------------------------------- And for the MSP430 with Vcc = 3V NOM MAX UNIT Active current at 1MHz 500 600 μA Sleep current in LPM3, 32.768kHz active 2.6 3.0 μA ----------------------------------------------------------------- No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.7.0/1680 - Release Date: 19/09/2008 08:25 |
From: Berta C. <Ber...@ci...> - 2008-09-25 13:31:47
|
Hello, 4) Apart from setting XMAC_CONF_OFF_TIME at compile time, is there any way (without hacking Contiki or duplicating code) of altering the CC2420 power cycle at runtime? You could modify the value xmac_config.off_time at run time. |
From: Jonathan L. <jo...@cs...> - 2008-09-25 13:57:33
|
> 4) Apart from setting XMAC_CONF_OFF_TIME at compile time, is > there any way (without hacking Contiki or duplicating code) > of altering the CC2420 power cycle at runtime? > > You could modify the value xmac_config.off_time at run time. Hehe, of course, that was rather silly of me ;-) Last minute addition to the questions without looking at the code properly, ooops ... Cheers Jon No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.7.0/1680 - Release Date: 19/09/2008 08:25 |
From: Joakim E. <jo...@si...> - 2008-09-26 14:13:10
|
Hello Jonathan, The reason that we did not use the SCG1 flag before was that it cause the processor into a mode that turns all clocks off making UART communication over the USB impossible. The latest version of Contiki has a fix for that on the Sky platform and will go down in LPM3 when it is "sleeping". The reason for the high energy consumption is probably: 1 - the ADC systems is configured to sample several sensors frequently (I have not measured what effect this actually has, but it will consume some power for sure). and 2 - other external components such as the flash memory are on, the analog sensors (light), possibly the "digital" sensors (SHT11). The small blips 64 times a second is likely when the timer system updates the clock (if you have CLOCK_CONF_SECOND set to 64 in contiki-conf.h). This is going from LPM1 (or 3) and into active mode during the interrupt. I have never tried LPM4 wakeup but the button-sensor should wake the application up from LPM4, and possibly sending in data on the USB might also work with the latest fix. Best regards, -- Joakim Eriksson, SICS Jonathan Lewis wrote: > Hi guys, > > To set the scene, I am part of a team implementing a high-level > component-based language called Insense for use on resource constrained > devices such as the Tmote Sky nodes. > > http://www-systems.cs.st-andrews.ac.uk/wiki/Dias/InsenseLanguage > > Thanks to Contiki our work has been fairly straight forward in not having to > deal with very low-level issues, well done ... ;-) > > > Recently I've been playing about with a Scheduler component that we want to > provide as part of our language and we would ideally like to incorporate > some power-management features. So I started playing around with low-power > modes under Contiki. > > As far as I can tell, sending the processor to sleep when nothing is to be > done using the > > _BIS_SR(GIE | SCG0 | SCG1 | CPUOFF); > > (not sure why Contiki leaves out the SCG1 flag, > seems to work fine when it is added, but that is > not my main concern here, although I am intrigued) > > statement in the contiki-sky-main.c scheduler loop saves roughly 1mA when > there is nothing to do. I get a pretty constant usage of around 2.5-2.6mA > without the sleep statement and roughly 1.5-1.6mA with the sleep statement > in place (excluding current spikes due to radio listen as set in xmac.c). > Even sending the processor into LPM4 doesn't make a huge difference, maybe > takes off another 0.05mA. > > To clarify how I measure current: I am using an oscilloscope to measure the > voltage drop over a small resistor that is in series with the battery supply > to the device. I have experimented with 10 and 100 Ohm resistors, both show > the same 1.5-1.6mA results. > > > 1) My main query is why we don't seem to get anything near the low μA usage > as outlined in the tmote datasheet (values shown below). Maybe I'm reading > the figures in the datasheet wrong or the figures in the datasheet are > somewhat optimistic, maybe some other parts of the tmote can be switched off > but aren't, maybe ... ? I was wondering if anyone had had similar > experiences and/or has an explanation. > > 2) It is also odd that I can hardly detect the wake-sleep cycles. I can just > about see small blips (of less that 100μA) roughly every 15ms (64 times a > second) within the fairly constant 1.5mA (1.6mA for tmote with sensors) > trace. I am no electronics expert, but my initial thought for this one is > that I'm running into some sort of resolution issue in that the scope isn't > picking up the change in voltage drop over the resistor for very small times > (when the processor wakes up for some micro-seconds and goes back to sleep > as nothing needs doing). > > 3) Has anyone experimented with waking the tmote up from LPM4? If anyone has > any info here that would be great. > > 4) Apart from setting XMAC_CONF_OFF_TIME at compile time, is there any way > (without hacking Contiki or duplicating code) of altering the CC2420 power > cycle at runtime? > > > If anyone can shed any light on the above, that would be great. The values > taken from the tmote datasheet are below. > > Cheers > > Jon > > ----------------------------------------------------------------- > > According to the tmote datasheet we should be able to expect around the > following for the device as a whole (I think) > > NOM MAX UNIT > Current Consumption: MCU on, Radio RX 21.8 23 mA > Current Consumption: MCU on, Radio TX 19.5 21 mA > Current Consumption: MCU on, Radio off 1800 2400 μA > Current Consumption: MCU idle, Radio off 54.5 1200 μA > Current Consumption: MCU standby 5.1 21.0 μA > > ----------------------------------------------------------------- > > And for the MSP430 with Vcc = 3V > NOM MAX UNIT > Active current at 1MHz 500 600 μA > Sleep current in LPM3, 32.768kHz active 2.6 3.0 μA > > ----------------------------------------------------------------- > > No virus found in this outgoing message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.7.0/1680 - Release Date: 19/09/2008 > 08:25 > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Contiki-developers mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/contiki-developers |
From: Jonathan L. <jo...@cs...> - 2008-09-29 09:49:44
|
Dear Joakim, Thanks very much for your reply, 1) Did wonder about the missing flag. I must have almost the latest version, where adding the flag causes no troubles, but the code still has it commented out. Will do cvs update and see what happens ... ;-) 2) Thought there must still be things running on the board to account for the usage. Thanks for pointing me in the right direction. Presumably one could temporarily switch some devices off if one really wanted to bring consumption down into the low μA range while nothing is to be done. Do you think it is simply a matter off turning off the SHT11 (with sht11_off()) and re-enabling the power when needed (with sht11_init()), and likewise for ADC and external flash? On brief inspection there don't appear to be xmem_off, adc_off, sensors_light_off functions. Presumably I would have to come up with my own if I wanted to temporarily switch all these off. Taking xmem as an example, the following P4OUT |= BV(FLASH_PWR); /* P4.3 Output, turn on power! */ in xmem_init (xmem.c), and assuming it turns the power on there must be a similar way to switch it off, and likewise for the ADC and light sensors. I'll give it a shot ... but if you have any insight here, would be good to know ... 3) I agree that the small blips 64 times a second are most likely due to waking from LPM3 and going back to sleep again, as CLOCK_CONF_SECOND is indeed set to 64. I was merely surprised that the blips were so small, I had expected a larger change in current usage when going between LPM3 and active mode. 4) I may have a go with LPM4 as well, just for fun, although it is probably not as useful as LPM3. Thanks again Jon > -----Original Message----- > From: Joakim Eriksson [mailto:jo...@si...] > Sent: 26 September 2008 15:07 > To: Contiki developer mailing list > Subject: Re: [Contiki-developers] Tmote sky low-power modes > > Hello Jonathan, > > The reason that we did not use the SCG1 flag before was that > it cause the processor into a mode that turns all clocks off > making UART communication over the USB impossible. The latest > version of Contiki has a fix for that on the Sky platform and > will go down in LPM3 when it is "sleeping". > > The reason for the high energy consumption is probably: > 1 - the ADC systems is configured to sample several sensors > frequently (I have not measured what effect this actually > has, but it will consume some power for sure). > > and > > 2 - other external components such as the flash memory are > on, the analog sensors (light), possibly the "digital" > sensors (SHT11). > > > The small blips 64 times a second is likely when the timer system > updates the clock (if you have CLOCK_CONF_SECOND set to 64 in > contiki-conf.h). This is going from LPM1 (or 3) and into active mode > during the interrupt. > > > I have never tried LPM4 wakeup but the button-sensor should wake the > application up from LPM4, and possibly sending in data on the > USB might > also work with the latest fix. > > Best regards, > -- Joakim Eriksson, SICS > > Jonathan Lewis wrote: > > Hi guys, > > > > To set the scene, I am part of a team implementing a high-level > > component-based language called Insense for use on resource > constrained > > devices such as the Tmote Sky nodes. > > > > http://www-systems.cs.st-andrews.ac.uk/wiki/Dias/InsenseLanguage > > > > Thanks to Contiki our work has been fairly straight forward > in not having to > > deal with very low-level issues, well done ... ;-) > > > > > > Recently I've been playing about with a Scheduler component > that we want to > > provide as part of our language and we would ideally like > to incorporate > > some power-management features. So I started playing around > with low-power > > modes under Contiki. > > > > As far as I can tell, sending the processor to sleep when > nothing is to be > > done using the > > > > _BIS_SR(GIE | SCG0 | SCG1 | CPUOFF); > > > > (not sure why Contiki leaves out the SCG1 flag, > > seems to work fine when it is added, but that is > > not my main concern here, although I am intrigued) > > > > statement in the contiki-sky-main.c scheduler loop saves > roughly 1mA when > > there is nothing to do. I get a pretty constant usage of > around 2.5-2.6mA > > without the sleep statement and roughly 1.5-1.6mA with the > sleep statement > > in place (excluding current spikes due to radio listen as > set in xmac.c). > > Even sending the processor into LPM4 doesn't make a huge > difference, maybe > > takes off another 0.05mA. > > > > To clarify how I measure current: I am using an > oscilloscope to measure the > > voltage drop over a small resistor that is in series with > the battery supply > > to the device. I have experimented with 10 and 100 Ohm > resistors, both show > > the same 1.5-1.6mA results. > > > > > > 1) My main query is why we don't seem to get anything near > the low μA usage > > as outlined in the tmote datasheet (values shown below). > Maybe I'm reading > > the figures in the datasheet wrong or the figures in the > datasheet are > > somewhat optimistic, maybe some other parts of the tmote > can be switched off > > but aren't, maybe ... ? I was wondering if anyone had had similar > > experiences and/or has an explanation. > > > > 2) It is also odd that I can hardly detect the wake-sleep > cycles. I can just > > about see small blips (of less that 100μA) roughly every > 15ms (64 times a > > second) within the fairly constant 1.5mA (1.6mA for tmote > with sensors) > > trace. I am no electronics expert, but my initial thought > for this one is > > that I'm running into some sort of resolution issue in that > the scope isn't > > picking up the change in voltage drop over the resistor for > very small times > > (when the processor wakes up for some micro-seconds and > goes back to sleep > > as nothing needs doing). > > > > 3) Has anyone experimented with waking the tmote up from > LPM4? If anyone has > > any info here that would be great. > > > > 4) Apart from setting XMAC_CONF_OFF_TIME at compile time, > is there any way > > (without hacking Contiki or duplicating code) of altering > the CC2420 power > > cycle at runtime? > > > > > > If anyone can shed any light on the above, that would be > great. The values > > taken from the tmote datasheet are below. > > > > Cheers > > > > Jon > > > > ----------------------------------------------------------------- > > > > According to the tmote datasheet we should be able to > expect around the > > following for the device as a whole (I think) > > > > NOM MAX UNIT > > Current Consumption: MCU on, Radio RX 21.8 > 23 mA > > Current Consumption: MCU on, Radio TX 19.5 21 mA > > Current Consumption: MCU on, Radio off 1800 > 2400 μA > > Current Consumption: MCU idle, Radio off 54.5 1200 μA > > Current Consumption: MCU standby 5.1 21.0 μA > > > > ----------------------------------------------------------------- > > > > And for the MSP430 with Vcc = 3V > > NOM MAX UNIT > > Active current at 1MHz 500 > 600 μA > > Sleep current in LPM3, 32.768kHz active 2.6 > 3.0 μA > > > > ----------------------------------------------------------------- > > > > No virus found in this outgoing message. > > Checked by AVG. > > Version: 7.5.524 / Virus Database: 270.7.0/1680 - Release > Date: 19/09/2008 > > 08:25 > > > > > > > > > -------------------------------------------------------------- > ----------- > > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > > Build the coolest Linux based applications with Moblin SDK > & win great prizes > > Grand prize is a trip for two to an Open Source event > anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Contiki-developers mailing list > > Con...@li... > > https://lists.sourceforge.net/lists/listinfo/contiki-developers > > > -------------------------------------------------------------- > ----------- > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > Build the coolest Linux based applications with Moblin SDK & > win great prizes > Grand prize is a trip for two to an Open Source event > anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Contiki-developers mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/contiki-developers > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.7.3/1691 - Release > Date: 25/09/2008 19:23 > > No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.7.3/1691 - Release Date: 25/09/2008 19:23 |
From: Bjorn G. <bg...@si...> - 2008-10-03 09:50:16
|
On Mon, 29 Sep 2008 10:49:13 +0100 "Jonathan Lewis" <jo...@cs...> wrote: > On brief inspection there don't appear to be xmem_off, adc_off, > sensors_light_off functions. Presumably I would have to come up with my own > if I wanted to temporarily switch all these off. Taking xmem as an example, > the following > > P4OUT |= BV(FLASH_PWR); /* P4.3 Output, turn on power! */ > > in xmem_init (xmem.c), and assuming it turns the power on there must be a > similar way to switch it off, and likewise for the ADC and light sensors. If memory serves me right the wireing on the Telos B made it possible to power off the M25P80 chip. On the confusingly similar Tmote Sky this was no longer possible, what one can do instead is to put the M25P80 ship into "Deep Power-down (DP)" mode. Cheers, /b -- _ _ ,_______________. Bjorn Gronvall (Björn Grönvall) /_______________/| Swedish Institute of Computer Science | || PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || Email: bg...@si..., Phone +46 -8 633 15 25 | Cat |/ Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------' |
From: Jonathan L. <jo...@cs...> - 2008-10-03 14:40:11
|
Hi Bjorn, Thanks for the tip about putting the M25P80 chip into "Deep Power-down (DP)" mode. I'll investigate. However, if anyone knows off the top of their head how to do this I would much appreciate them posting it here. Cheers Jon > -----Original Message----- > From: Bjorn Gronvall [mailto:bg...@si...] > Sent: 03 October 2008 10:49 > To: Contiki developer mailing list; jo...@cs... > Cc: bg...@si... > Subject: Re: [Contiki-developers] Tmote sky low-power modes > > On Mon, 29 Sep 2008 10:49:13 +0100 > "Jonathan Lewis" <jo...@cs...> wrote: > > > On brief inspection there don't appear to be xmem_off, adc_off, > > sensors_light_off functions. Presumably I would have to > come up with > > my own if I wanted to temporarily switch all these off. > Taking xmem as > > an example, the following > > > > P4OUT |= BV(FLASH_PWR); /* P4.3 Output, turn on power! */ > > > > in xmem_init (xmem.c), and assuming it turns the power on > there must > > be a similar way to switch it off, and likewise for the ADC > and light sensors. > > If memory serves me right the wireing on the Telos B made it > possible to power off the M25P80 chip. On the confusingly > similar Tmote Sky this was no longer possible, what one can > do instead is to put the M25P80 ship into "Deep Power-down (DP)" mode. > > Cheers, > /b > > > -- > _ _ ,_______________. > Bjorn Gronvall (Björn Grönvall) /_______________/| > Swedish Institute of Computer Science | || > PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || > Email: bg...@si..., Phone +46 -8 633 15 25 | Cat |/ > Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------' > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.7.5/1704 - Release > Date: 02/10/2008 21:35 > > No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.7.5/1704 - Release Date: 02/10/2008 21:35 |
From: Bjorn G. <bg...@si...> - 2008-10-03 15:12:04
|
On Fri, 3 Oct 2008 15:40:07 +0100 "Jonathan Lewis" <jo...@cs...> wrote: Moi, > Thanks for the tip about putting the M25P80 chip into "Deep Power-down (DP)" > mode. I'll investigate. However, if anyone knows off the top of their head > how to do this I would much appreciate them posting it here. This is untested code that may serve as a starting point: int xmem_deep_power_down(void) { spl_t s; wait_ready(); s = splhigh(); SPI_FLASH_ENABLE(); spi_tx(SPI_FLASH_INS_DP); SPI_FLASH_DISABLE(); splx(s); return xxx; } #define M25P80_SIGNATURE 0x13 int xmem_release_from_deep_power_down(void) { unsigned char signature; spl_t s; s = splhigh(); SPI_FLASH_ENABLE(); spi_tx(SPI_FLASH_INS_RES); spi_tx(0); /* Three dummy bytes */ spi_tx(0); /* Three dummy bytes */ spi_tx(0); /* Three dummy bytes */ FASTSPI_CLEAR_RX(); FASTSPI_RX(signature); SPI_FLASH_DISABLE(); splx(s); if (signature == M25P80_SIGNATURE) return 0; /* Success */ else return -1; /* Fail */ } Cheers, /b -- _ _ ,_______________. Bjorn Gronvall (Björn Grönvall) /_______________/| Swedish Institute of Computer Science | || PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || Email: bg...@si..., Phone +46 -8 633 15 25 | Cat |/ Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------' |
From: Jonathan L. <jo...@cs...> - 2008-10-10 14:35:03
|
Hi Bjorn, Thanks again for your emails re low-power modes on the M25P80. I tried out the code you sent me for putting the M25P80 in and out of deep sleep mode and have measured the current being used, with and without deep sleep being invoked. Hooking the mote up to my scope reveals that it only appears to save in the μA range, if at all (it's hard to detect such small changes with my current scope-probe-resistor combination). I still get around 1.6mA being consumed even though there isn't anything to do. After looking at the M25P80 manual I suspect your code is doing what it is supposed to and the change in current use is merely very small. As far as I can tell from the manual, with the chip-select driven high (happens at xmem_init and after spi_flash_disable) the chip will go into stand-by mode when there is nothing to do. Assuming the M25P80 is going into stand-by mode then the change in current use between standby mode and deep sleep mode is only around 40μA, which is roughly what I am seeing. So probably everything is working and thank you very much again. Unfortunately there is still something else running on the board that is using up 1.6 mA when there ain't sod all for the board to do. My hunt for the guilty power drainer will continue and I'll let you know if I manage to achieve low μA current use for the TMoteSky board. Purely, out of interest, if it were possible to turn the chip off completely, would the line look something like P4OUT &= ~BV(FLASH_PWR); ? I merely ask, as I may want to do this for other chips on the board. Cheers Jon > -----Original Message----- > From: Bjorn Gronvall [mailto:bg...@si...] > Sent: 06 October 2008 17:07 > To: Jonathan Lewis > Cc: bg...@si... > Subject: Re: [Contiki-developers] Tmote sky low-power modes > > On Fri, 3 Oct 2008 16:56:19 +0100 > "Jonathan Lewis" <jo...@cs...> wrote: > > Please let me know if you make any progress with putting the > chip into deep power down mode and waking it up. > > There is a manual > www.numonyx.com/Documents/Datasheets/M25P80.pdf > and on pages 33-35 there is some info on this. > > Cheers, > /b > > -- > _ _ ,_______________. > Bjorn Gronvall (Björn Grönvall) /_______________/| > Swedish Institute of Computer Science | || > PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || > Email: bg...@si..., Phone +46 -8 633 15 25 | Cat |/ > Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------' > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.7.5/1704 - Release > Date: 02/10/2008 21:35 > > No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.8.0/1717 - Release Date: 09/10/2008 16:56 |
From: Bjorn G. <bg...@si...> - 2008-10-10 15:18:11
|
On Fri, 10 Oct 2008 15:34:33 +0100 "Jonathan Lewis" <jo...@cs...> wrote: Moi, > After looking at the M25P80 manual I suspect your code is doing what > it is supposed to and the change in current use is merely very > small. As far as I can tell from the manual, with the chip-select > driven high (happens at xmem_init and after spi_flash_disable) the > chip will go into stand-by mode when there is nothing to > do. Assuming the M25P80 is going into stand-by mode then the change > in current use between standby mode and deep sleep mode is only > around 40__A, which is roughly what I am seeing. A pity that the saving is so small, anyways thanks for testing the code. > So probably everything is working and thank you very much again. One more thing, did you check if the signature returned matches M25P80_SIGNATURE? > My hunt for the guilty power drainer will continue and I'll let you > know if I manage to achieve low __A current use for the TMoteSky > board. Did you try to disable the sht11 and the light sensors? > Purely, out of interest, if it were possible to turn the chip off > completely, would the line look something like P4OUT &= > ~BV(FLASH_PWR); ? I merely ask, as I may want to do this for other > chips on the board. Yes, that should do the trick. Have a nice weekend, /b -- _ _ ,_______________. Bjorn Gronvall (Björn Grönvall) /_______________/| Swedish Institute of Computer Science | || PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || Email: bg...@si..., Phone +46 -8 633 15 25 | Cat |/ Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------' |
From: Jonathan L. <jo...@cs...> - 2008-10-10 16:01:30
|
Hi Bjorn, > A pity that the saving is so small, anyways thanks for > testing the code. Yes, I thought the power drain could have been due to the flash, but hadn't realised that it hardly uses anything (~50 micro-amps) in stand-by and that it should be going into stand-by. > > One more thing, did you check if the signature returned > matches M25P80_SIGNATURE? > Yes I checked the signature matched, well, your code did that, I checked that the return value of xmem_release_from_deep_power_down() was 0, and it was. > > Did you try to disable the sht11 and the light sensors? > I also disabled the sht11, hardly makes any difference. I will probably try turning off the light sensors as well, but somehow I doubt they can account for 1.5 mA. We have some tmote-sky boards without SHT11 or S1087/S1087-1 light sensors (for routing and processing only) and their current use is maybe 0.1mA below that of the normal tmote sky boards that do have these sensors. Anyway, thanks again, if I come up with the goods I'll post my solution, in case anyone is interested. Cheers Jon > -----Original Message----- > From: Bjorn Gronvall [mailto:bg...@si...] > Sent: 10 October 2008 16:17 > To: Jonathan Lewis > Cc: 'Contiki developer mailing list'; bg...@si... > Subject: Re: [Contiki-developers] Tmote sky low-power modes > > On Fri, 10 Oct 2008 15:34:33 +0100 > "Jonathan Lewis" <jo...@cs...> wrote: > > Moi, > > > > After looking at the M25P80 manual I suspect your code is > doing what > > it is supposed to and the change in current use is merely > very small. > > As far as I can tell from the manual, with the chip-select > driven high > > (happens at xmem_init and after spi_flash_disable) the chip will go > > into stand-by mode when there is nothing to do. Assuming > the M25P80 is > > going into stand-by mode then the change in current use between > > standby mode and deep sleep mode is only around 40__A, which is > > roughly what I am seeing. > > A pity that the saving is so small, anyways thanks for > testing the code. > > > So probably everything is working and thank you very much again. > > One more thing, did you check if the signature returned > matches M25P80_SIGNATURE? > > > My hunt for the guilty power drainer will continue and I'll let you > > know if I manage to achieve low __A current use for the TMoteSky > > board. > > Did you try to disable the sht11 and the light sensors? > > > Purely, out of interest, if it were possible to turn the chip off > > completely, would the line look something like P4OUT &= > > ~BV(FLASH_PWR); ? I merely ask, as I may want to do this for other > > chips on the board. > > Yes, that should do the trick. > > Have a nice weekend, > /b > > -- > _ _ ,_______________. > Bjorn Gronvall (Björn Grönvall) /_______________/| > Swedish Institute of Computer Science | || > PO Box 1263, S-164 29 Kista, Sweden | Schroedingers || > Email: bg...@si..., Phone +46 -8 633 15 25 | Cat |/ > Cellular +46 -70 768 06 35, Fax +46 -8 751 72 30 '---------------' > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.8.0/1717 - Release > Date: 09/10/2008 16:56 > > No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.8.0/1717 - Release Date: 09/10/2008 16:56 |
From: Joakim E. <jo...@si...> - 2008-10-14 17:52:19
|
Hi, Jonathan Lewis wrote: > Hi Bjorn, > [...] > >> Did you try to disable the sht11 and the light sensors? >> > > I also disabled the sht11, hardly makes any difference. I will probably try > turning off the light sensors as well, but somehow I doubt they can account > for 1.5 mA. We have some tmote-sky boards without SHT11 or S1087/S1087-1 > light sensors (for routing and processing only) and their current use is > maybe 0.1mA below that of the normal tmote sky boards that do have these > sensors. Besides the sensors consuming power the ADC12 subsystem itself will consume some power when generating the 2.5 volt reference and sampling the sensors. If the light-sensors init is not called, the ADC12 system is not set-up to run (maybe the battery sensor will do some setup too). Best regards, -- Joakim > > Anyway, thanks again, if I come up with the goods I'll post my solution, in > case anyone is interested. > > Cheers > > Jon > |
From: Jonathan L. <jo...@cs...> - 2008-10-15 15:28:54
|
Thanks Joakim, I'll give those a try once I've fixed some issues I've recently managed to introduce into our Insense-language compiler. I'll let you know what the outcome is re disabling the ADC. As mentioned before, my main fun is developing a component-based language (we call it Insense) that runs on Contiki. The language is working pretty well, but we decided last week to re-write the heart of it (inter-component communication channels) in order to save some space. I'm debugging the re-write at present ... ;-) Anyway, will let you know Cheers again Jon > -----Original Message----- > From: Joakim Eriksson [mailto:jo...@si...] > Sent: 14 October 2008 18:52 > To: Contiki developer mailing list > Subject: Re: [Contiki-developers] Tmote sky low-power modes > > Hi, > > Jonathan Lewis wrote: > > Hi Bjorn, > > > [...] > > > >> Did you try to disable the sht11 and the light sensors? > >> > > > > I also disabled the sht11, hardly makes any difference. I will > > probably try turning off the light sensors as well, but somehow I > > doubt they can account for 1.5 mA. We have some tmote-sky boards > > without SHT11 or S1087/S1087-1 light sensors (for routing and > > processing only) and their current use is maybe 0.1mA below that of > > the normal tmote sky boards that do have these sensors. > > Besides the sensors consuming power the ADC12 subsystem > itself will consume some power when generating the 2.5 volt > reference and sampling the sensors. > If the light-sensors init is not called, the ADC12 system is > not set-up to run (maybe the battery sensor will do some setup too). > > > Best regards, > -- Joakim > > > > > > Anyway, thanks again, if I come up with the goods I'll post my > > solution, in case anyone is interested. > > > > Cheers > > > > Jon > > > > -------------------------------------------------------------- > ----------- > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge Build the coolest Linux based > applications with Moblin SDK & win great prizes Grand prize > is a trip for two to an Open Source event anywhere in the > world http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Contiki-developers mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/contiki-developers > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 270.8.0/1717 - Release > Date: 09/10/2008 16:56 > > No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.8.0/1717 - Release Date: 09/10/2008 16:56 |
From: Chris W. <ch...@ox...> - 2008-09-20 15:07:37
|
I'll add what I can about Contiki... - Structure (how is the structure, architecture, applications (why Contiki exists?) ...) In my opinion, Contiki is a kernel that is optimized for memory constrained systems. It has the minimum functions of an OS, without the overhead of a full-blown pre-emptive OS. In my opinion, it really shines for protocol stack design that will be run on systems that have low resources (ie: little RAM and flash). At least this is what I am using it for. The normal OS candidates (Linux, eCOS, VxWorks, etc...) are large and require a lot of resources to run. For Linux, you would usually need around 10-20 MB of flash and at least 1 MB of RAM to run properly. If you are thinking about using a normal 8-bit processor, they usually have around 32-128 kB of flash and 2-8 kB of RAM. On these systems, you would not be able to run one of these OSes, however Contiki can easily handle systems with these kinds of resources. As an aside, Contiki also can run well on a 32-bit processor such as an ARM7. Most of the ARM7 processors come with 8-32 kB of RAM and 32-512 kB of flash. At the high end, you can start using the lighter OSes like eCOS, but Contiki can easily run on the low end with 8kB RAM/32kB flash. From a manufacturer's standpoint, the less resources you need to use, the cheaper your product will be. This means that most electronics will gradually spiral down to the minimum resources they can use in order to perform the required function. Also, Contiki is a stackless OS. When a normal OS changes threads or processes (context switch), it will push the contents of the registers and the stack into memory and then load the regs with the info from the new process. This is how it can remember the context of a different process and pick up where it left off. On the other hand, Contiki uses pseudothreads, which are just pointers to where the thread left off previously. A context switch just consists of jumping to the next pointer in the queue. There are some things you need to be careful with this architecture such as loss of automatic variable data, however there is a really great benefit which is that you can run the OS inside of another OS. This is unheard of in a standard pre-emptive OS, but running Contiki inside of Windows/Linux saved my ass more than a couple of times because its so much easier to debug in a PC environment, rather than in hardware. - Processes (scheduling, supported thread types, how are processes synchronization) As mentioned, Contiki uses protothreads to emulate processes and threads. The scheduling is standard FIFO type event scheduling, where events get posted to the event queue, and they get called in a first-come fashion. There are various synchronization mechanisms such as semaphores that are supported, however I haven't really used them much. Contiki is a non-preemptive OS which means that each process runs to completion or to a blocking event before another event can be called. If you're in a situation where you are using a pre-emptive OS that uses priority for processes or threads, then Contiki wouldn't be ideal, but for applications with loose or no real-time requirements, then Contiki should be fine. - Memory (how it is managed, swapping, virtual memory) The memory in Contiki is statically allocated, and is based on memory pools. I don't think there is any swapping or virtual memory. I'm not an expert on the Contiki memory handling so it's probably best to ask one of the developers about this. That's about it for me. If anyone finds fault with anything I said, please correct me. Chris Wang (aka Akiba) FreakLabs Open Source Zigbee Development http://www.freaklabs.org |
From: Chris W. <ch...@ox...> - 2008-09-20 15:22:00
|
I should also add that in the realm of lightweight OSes, you should also research TinyOS. I'm not so familiar with this OS, but its popular in many academic circles. One of the main reasons I chose Contiki over TinyOS is that TinyOS uses a variation of the C-language called NesC. This decreases its appeal for mainstream and commercial applications since there is a learning curve associated with the language. However it's also designed for memory and power constrained systems and is widely used in wireless sensor networks. Chris Wang (aka Akiba) FreakLabs Open Source Zigbee Development http://www.freaklabs.org |