.NET Watch

Hello,

I’ve been thinking these days about making a smart watch that connects to the phone over bluetooth and displays notifications and much more useful informations. Much like Pebble: http://getpebble.com.
I already have all the required things for the prototype (LCD, bluetooth module, etc.)

First idea was to use an AVR chip but it’s pretty hard (not impossible) to make dynamically loadable programs so I remembered of .NET and this would much simpler to implement and develop.

Currently I own 2 EMX modules and a Cerberus board. I think the Cerberus would be a great platform for the watch. In the final version I would use only the chip and maybe a sharp memory lcd (same as pebble - reduced power usage, high contrast) - currently I use a nokia BW LCD. Maybe we could even do batches of PCBs for anyone for build a watch, or already assembled boards with ARM, BT module, LCD, etc. (GHI could help us here).

The big concern I have is power usage. So, can the CPU frequency on cerberus be dynamically changed. At what frequency .NET mf starts to become unusable? I didn’t have a chance to look over the code, but would it be possible to implement dynamically switching of the frequency?
I also see there are no specs on power usage in different CPU states (idle/sleep/hibernate/etc.). Has anyone measured?
The performance requirements are not that high, since it will have a small resolution display and just stay in idle/sleep most of the time.

So, do you think it’s possible to run the .NET mf from batteries so that the batteries will last at least 2-3 days in this conditions?

Any other suggestions?
How would you like a .NET mf watch?

Thanks

I think the ideal would be to leave the speed of the chip the same, but to hibernate the CPU. This should drop the current usage into the 0.2mA or less range. But I don’t know if hibernation has been implemented on the Cerberus chips…

Funnily enough, I think this was where NETMF started, as the operating system of smart watches and other smart gadgets, switch started as SPOT, hence the Microsoft.SPOT name space that still lingers.

See: Smart Personal Objects Technology - Wikipedia

Assuming hibernation is implemented (hope I get some free time in the weekend to play), is the chip able to resume from hibernation on external events (USART data received, pin interrupt, etc.)?
In my opinion, 168Mhz is way too much for a watch. As I said, there is no real need for this kind of performance. I guess it would be easy to recompile the firmware with a much slower clock.
I think it would also be possible to lower the frequency from RLP (or using Register class) but I’m not sure how the framework will cope with that since it won’t know the time base anymore.

The thing with cpu speed is that it is a double edged sword.

Yes, you can make it slower, but then it must be running longer to do task “X”.

If you leave the speed high then it can accomplish the same task “X” in a shorter time and spend more time in hibernation.

If you mess with the clocks then you will have to keep clock dependent things like USB and Serial in mind.

Generally you cant resume on USART events as the first few chars are inevitably missed while the clocks start up. I do know that on the USBizi you could use an interrupt pin to wake the cpu up from hibernate, or the RTC if i recall correctly.

So if I send some junk data before, it should be fine.

On the double edged sword: you are right, but I can’t do things and just send it to sleep because the performance will be limited by the bluetooth communication speed.
Since I plan to use SPP, it will communicate at 115200 bps tops. Faster frequency means it will waste a lot more cycles (and power) just waiting for the bytes to get in/out. I think that 10-20MHz clock would be enough and this means a lot of power conservation. It’s a watch, I plan on using a 180 mAh Li-Ion battery, this means @ 2-3mA current draw for a 3 day battery life.

Any infos on the power demand of the chip in different states? Nobody measured?

I would check the datasheet, but NETMF isn’t particularly friendly when it comes to power conservation. I don’t think you’d be happy with the speed of managed code at 10 MHz.

I was interested, so I looked it up for you:

Run mode, external clock, all peripherals enabled:
168 MHz 93 mA
60 MHz 37 mA
25 MHz 16 mA

Run mode, external clock, all peripherals disabled:
168 MHz 46 mA
60 MHz 22 mA
25 MHz 10 mA

Sleep mode, external clock, all peripherals enabled:
168 MHz 59 mA
60 MHz 20 mA
25 MHz 8 mA

Sleep mode, external clock, all peripherals disabled:
168 MHz 12 mA
60 MHz 5 mA
25 MHz 2 mA

In stop mode, you’re down around .5 mA, but your clocks are stopped, so starting back up can take a (relatively) long time. In standby mode, you’re as low as 2.2 uA, depending on what you’ve got running.

The datasheet is here: http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/DM00037051.pdf and the info you want starts on page 77.

Note that because of the nature of NETMF and the firmware setup, just because you’re not using a peripheral doesn’t mean it’s not enabled.

Also note that this is only the uC, the other parts of the system will consume power as well. You also won’t hit the lowest numbers here, because, by its nature, a watch requires the RTC (Real Time Clock) and the associated LSE (Low Speed External) oscillator to remain operating.

Thanks for the info. I had looked over the datasheet of the chip.
I guess 16-25MHz should be enough.
All I need is the RTC (for time keeping), 1 UART (for bluetooth) and 1 SPI (for the nokia LCD, for the sharp LCD I think it’s a similar interface). Not sure what .NET MF uses, but all the other can/will be powered off.

The next big consumer would be the bluetooth module. I haven’t yet decided on what I’m going to use when I make the PCB (for the prototype I’ll use a generic BC4 module).

I’ll do some tests when I get the chance. I’ll also look over the .NET source code and see how low I can get the clock and still be usable.

If not, I guess I’ll go only native on this one, but .NET would be nicer.

Something like an MSP430 would put you under $5 per chip, even in ones, has internal oscillators, and consumes less than 10 mA even going full bore with everything on, if I read the datasheet correctly.

You’d be in native code only, there.

Yes, but I would really like using .NET and the possibility of loading mini applications on the watch via bluetooth. I don’t think it’s possible to do that on the MSP430.
My first thought was to use an xmega. It can be done, but it’s pretty complex and not that elegant.

If you were willing to build a custom firmware, you could strip NETMF down to the bare minimum and run it on a smaller chip, such as a Cortex-M3 or similar. Oberon’s original STM32 port was for the STM32F103 chip, which may have lower power requirements.

Watch can be slow most of the time. Maybe run it slow, like 1Mhz!

@ Gus: do you have an idea how .NET MF would cope with changing the clock dynamically (using RLP or Register class)?
Or should I add this functionality and rebuild the firmware?

You can cheat and use RegisterClass. Your delays and timing will be off but you can compensate for it.

Or you can rebuild the firmware

Can I build the firmware with Keil ARM MDK 4.22?

LE: Never mind, I got it going. Time for tests…

I can’t build the .NET mf.

I got the latest porting kit for 4.2, overwritten it with the code from GHI OS from codeplex and ran the commands.
Enter cmd, go to c:\PortingKit, run setenv_mdk with version and path and finally navigate to Solutions\FezCerberus\TinyClr where I enter the following command:

msbuild /t:build /p:flavor=release;memory=flash /verbosity:d /fl1 /m:4

After @ 3 mins, I get 28 warnings and 116 errors.
I am using MDK 4.2
Here is the complete build log: https://docs.google.com/open?id=0B7rh2sj9hntfX2RYQU5kVkdtdjg

Any ideas?

There is something wrong with your setup, maybe with setenv_mdk.

The cpp compiler isn’t set and so compilation fails.

See the bottom of your log file. There it repeats all the errors. All of them complain about something like this:

There is no actual exe mentioned, it just tries to execute the parameters that was supposed to be passed to the exe.

Please post under “native” section on forum.

Nevermind, I got it. There is no 4.22 target in “Microsoft.Spot.system.mdk.targets” file. So I just used setenv_mdk with 4.13 version and it worked like a charm.
Thanks all!

Now, for stripping down and customizing…

What would the size of this watch be?

No bigger than the LCD size. Not sure about the depth.

I think I’ll use a plain microcontroller for this one because of the power demands. More exactly the xmega192a3u. It draws 1.1-1.4 mA when active at 2MHz and this can be even lower (0.6-0.7 mA) if powered from 1.8V and idle power is (0.15-0.35mA - 1.8V and 0.29-0.6mA -3.3V). I’ll make a topic in the “Off topic” section when I have a prototype built.
The cerberus chip is not actually meant for a watch (it has ethernet!) and I don’t really know any other alternative (other than trying myself to port .NET to a more suitable chip).

Anyway, it would be real cool if there would be a .NET enabled watch with bluetooth and if it could last at least 3-4 days on a charge.