Discussion:
Anelok: CC2543 vs. nRF51822
Werner Almesberger
2016-01-23 03:24:30 UTC
Permalink
A while ago I discussed the Anelok design with Bluetooth hacker Mike
Ryan, and he strongly recommended using the Nordic nRF51822 instead
of the the TI CC2543.

The idea for the TI CC2543 is to write the lower layers of an open
BTLE stack from scratch, and at some point mix this with the upper
layers from BlueZ.

The main benefit of this approach is that it's 100% open. The main
drawback is that it's a lot of work, especially given that the
hardware doesn't quite support the BTLE frame format, and thus would
require some creative software tweaks.

After looking (again [1]) at the nRF51822 documentation, I'm now
reasonably confident that one could write an all-Free stack also for
this chip. But it has the added benefit that Nordic provide a
(closed) stack as well, which should help to keep the development
time for a first working prototype down.

Another feature that may become important given recent regulatory
trends is that the nRF51822 (like the Kinetis MCUs) can be protected
against unauthorized Flash modification. I.e., one could write a
boot loader that only accepts signed binaries. The CC2543, on the
other hand, can always be fully erased and then accepts any new
firmware.

Further advantages of the nRF51822 include that it's a Cortex M0
(so we don't need SDCC for the ancient 8051 core of the CC2543) and
that it has enough Flash and RAM for the entire BTLE stack. That may
end up weakening the role of the cMCU, but I think any possible
optimizations there can wait until later.

I haven't put too much work into the CC2543 so far, so the time lost
by switching RF chips again wouldn't be excessive. Of course, such a
change will still obsolete all the RF sections of the 2014/Mk2/CR2032
boards made so far.

[1] http://lists.en.qi-hardware.com/pipermail/discussion/2014-April/010574.html

Opinions ?

- Werner
Cristian Paul Peñaranda Rojas
2016-01-23 05:21:52 UTC
Permalink
I would be good consider more options before making a choice that breaks board compatibility again in the future.

Cristian Paul
Post by Werner Almesberger
A while ago I discussed the Anelok design with Bluetooth hacker Mike
Ryan, and he strongly recommended using the Nordic nRF51822 instead
of the the TI CC2543.
The idea for the TI CC2543 is to write the lower layers of an open
BTLE stack from scratch, and at some point mix this with the upper
layers from BlueZ.
The main benefit of this approach is that it's 100% open. The main
drawback is that it's a lot of work, especially given that the
hardware doesn't quite support the BTLE frame format, and thus would
require some creative software tweaks.
After looking (again [1]) at the nRF51822 documentation, I'm now
reasonably confident that one could write an all-Free stack also for
this chip. But it has the added benefit that Nordic provide a
(closed) stack as well, which should help to keep the development
time for a first working prototype down.
Another feature that may become important given recent regulatory
trends is that the nRF51822 (like the Kinetis MCUs) can be protected
against unauthorized Flash modification. I.e., one could write a
boot loader that only accepts signed binaries. The CC2543, on the
other hand, can always be fully erased and then accepts any new
firmware.
Further advantages of the nRF51822 include that it's a Cortex M0
(so we don't need SDCC for the ancient 8051 core of the CC2543) and
that it has enough Flash and RAM for the entire BTLE stack. That may
end up weakening the role of the cMCU, but I think any possible
optimizations there can wait until later.
I haven't put too much work into the CC2543 so far, so the time lost
by switching RF chips again wouldn't be excessive. Of course, such a
change will still obsolete all the RF sections of the 2014/Mk2/CR2032
boards made so far.
[1] http://lists.en.qi-hardware.com/pipermail/discussion/2014-April/010574.html
Opinions ?
- Werner
_______________________________________________
Qi Hardware Discussion List
Subscribe or Unsubscribe: http://lists.en.qi-hardware.com/mailman/listinfo/discussion
_______________________________________________
Qi Hardware Discussion List
Mail to list (members only): ***@lists.en.qi-hardware.com
Subscribe or Unsubscribe: http://lists.en.qi
Werner Almesberger
2016-01-25 05:14:18 UTC
Permalink
Post by Cristian Paul Peñaranda Rojas
I would be good consider more options
Do you have any specific chips in mind ?
Post by Cristian Paul Peñaranda Rojas
before making a choice that
breaks board compatibility again in the future.
Well, this would hopefully be the last major change for a while.

As far as I know, the nRF51822 is "as good as it gets" in terms
of supporting BTLE.

The openness angle still has to be explored (i.e., it seems that
nobody has done this before), but the documentation looks good
and they even got rid of the silly registration requirement that
had annoyed me in 2014.

The motivation for using AT86RF23x (802.15.4) in 2013/Mk1 was
that I knew of no BT(LE) solution that wasn't entirely closed.
The obvious drawback of that choice was that 802.15.4 isn't
compatible with anything else, so you need a dongle on the "PC"
side - which kinda sucks, particularly if using a smartphone or
tablet.

Then I found the CC2543. I knew at that time of Nordic, but they
seemed to be rather closed (much like the other chip or module
makers). After that, I was hoping that the design was ready for
the next phase and thus didn't want to revise the RF chip
decision, but that changed when the battery problem made it clear
that major changes would be needed anyway.


Now is a good time for making this kind of change: the next design
is already reasonably different from its predecessor (different
battery management, dual MCU, different geometry), so a new board
version will be needed anyway, and any change that has to be
introduced later will be significantly more costly than making
changes now.

We also have some ~6 boards with a CC2543. So even if the nRF51
should prove to be a total disaster, it would be relatively easy
to limp back.


Furthermore, Anelok has to find funding very soon or I won't be
able to continue working towards actually making this a product.
After plan A (crowd-investment), and plan B (OTF) have failed
miserably, plan C would be crowdfunding. This means that there
will be a tight schedule with very little room for changes once
the campaign succeeds.

Plus, I think it gives a better impression if there aren't lots of
loose ends at the time of starting a campaign. I know that one can
just not mention that endless to do list and all the basic
research still waiting to be done, but perhaps the world doesn't
need another myIDkey or Zano :)

- Werner

_______________________________________________
Qi Hardware Discussion List
Mail to list (members only): ***@lists.en.qi-hardware.com
Subscribe or Unsubscribe: http://lists.en.qi-ha
Paul Boddie
2016-02-03 15:08:30 UTC
Permalink
Post by Werner Almesberger
As far as I know, the nRF51822 is "as good as it gets" in terms
of supporting BTLE.
I guess this Nordic Semiconductor stuff must have some momentum if Sparkfun
are selling a product with it:

https://www.sparkfun.com/products/13729

Seen via a distributor I've bought stuff from before (outside the US and its
"export restrictions"):

https://proto-pic.co.uk/redbearlab-ble-nano-nrf51822/

Interestingly, the nRF51822 is also used on the BBC Micro Bit (the device
they'll eventually give to lots of schoolchildren):

https://downloads.egenix.com/python/FOSDEM-2016-PythonDevRoom-MicroPython-on-
the-BBC-Microbit-Lightning-Talk.pdf

So I guess everyone is getting in on the action! Not that this has much to say
about openness or viability, but you could probably feel "validated" by
choosing it if all these other products influence you in some way.

Paul
Werner Almesberger
2016-02-07 15:44:05 UTC
Permalink
Post by Paul Boddie
but you could probably feel "validated" by
choosing it if all these other products influence you in some way.
Yes, the Nordic chips are rather popular. This also means that
nicely matched baluns are readily available :) Alas, not two with
the same package, so the RF balun will become a part without second
source.

I've now updated the schematics:
http://downloads.qi-hardware.com/people/werner/anelok/tmp/anelok-20160207.pdf

There may still be loose ends (e.g., if nRF51 and cMCU end up on the
same side of the PCB, I may want t swap RF_CRRT and RF_CTRR), but
this would by and large be the design.

There are a number of options in the RF part (sheet 10):

- on the left side, we have components for a DC-DC converter to
provide the internal 1.8 V supply from the system's 3.3 V.

This should reduce power consumption by maybe up to 30% while
the radio interface is active (i.e., listening or sending). Not
sure if this is actually worth the effort, but it can't hurt to
have the option for now.

If the DC-DC converter turns out to be overkill, we can use the
same layout for the LDO setup, by removing C24, L2, and L3, and
(optionally) reducing C25 to 100 nF.

- for "wall-clock" (RTC) timekeeping, there are a few options, too:

1) use a low-power 32768 Hz crystal (0.4 uA),
2) use the voracious 16 MHz crystal (15 uA, which is high, but
still surprisingly low given that the 16 MHz oscillator draws
hundreds of uA in other modes),
3) use an external oscillator, or
4) maybe use an external trigger ?

For 4), we already have an RTC in the sMCU, so that one could
provide an occasional trigger, provided that

a) some jitter is allowed (this would have to go from sMCU to
cMCU and then to RF),
b) it's okay to sometimes lose a trigger (e.g., if some other
communication is in progress at the time),

This option needs further study.

For 3), we could use a clock output from the sMCU. Drawbacks of
this approach would include having a permanently active "long"
trace on the PCB, the need to coordinate rfkill with the sMCU
(to avoid driving the hypothetical clock signal while VRF is
shorted to ground), and the need to free up one GPIO.

Avoiding the crystal would mean a potential BOM cost saving of
about 40 US-cents at 1000 units, 30 at 10k. For further study.

- I also increased the capacitance of some decoupling capacitors
(C30, C32), to match similar parts used elsewhere. This is to
keep the number of different parts down.

- the nRF51822 itself comes with various memory configurations,
with 128 or 256 kB Flash and 16 or 32 kB RAM. I've specified the
biggest (and most expensive), to be sure to have enough room.
This can be optimized later.

Speaking of cost, the component cost (without PCB, case, battery
contacts, etc.) is currently at USD 25.40 @ 100 units,
USD 22.51 @ 500 units. Some published quantity discounts don't go
beyond 100 units, so prices for 500 units and beyond may go down
a little.

This is a bit on the high side of the acceptable range. The
relatively high cost is caused less by fancy chips but by the
price of the OLED jumping up from USD 4.85 @ 100 (2014-2015) to
USD 8.26 @ 100 in 2016.

http://downloads.qi-hardware.com/people/werner/anelok/tmp/anelok-pie-usd-500-20160207.pdf

Maybe it's time to look for second sources, e.g.,

- Shineworld Innovations GLO13-D-M2001
http://www.alibaba.com/product-detail/1-3-Graphic-Blue-Color-128x64_60018968100.html?spm=a2700.7724857.29.1.kwI3WO&s=p

It says "blue" but looks white-ish. In any case, it seem to exist
in white:
http://p.globalsources.com/IMAGES/PDT/SPEC/239/K1077987239.pdf

Note: different controller, apparently not entirely compatible:
https://forum.arduino.cc/index.php?topic=259186.0

- Formike KWH0130UL01
http://www.formike.com.cn/product/60244849708-219498402/Formike_1_3_inch_flexible_OLED128x64_KWH0130UL01.html

In any case, this type of OLED is very common, so if there's a
problem with Eastrising, it shouldn't be hard to find a drop-in
replacement.

- Werner
p***@kristianpaul.org
2016-02-04 04:15:59 UTC
Permalink
Post by Werner Almesberger
Do you have any specific chips in mind ?
Just don't laugh, Intel curie, but they are not selling then yet tho..
Werner Almesberger
2016-02-07 15:59:45 UTC
Permalink
Post by p***@kristianpaul.org
Just don't laugh, Intel curie, but they are not selling then yet tho..
Heh, now that would be the mother of all drastic design changes :)

Speaking of new chips, NXP aka Freescale have released full
documentation for the KL8x I mentioned a while ago:
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/l-series/kinetis-kl8x-72-mhz-low-power-secure-microcontrollers-mcus:KL8x

Some observations:

- not available in QFN (only BGA or, if you have the space, LQFP).
So that puts it beyond the technology range of Anelok Mk 3.

- it has sort of an FPU for Elliptic Curves. While they don't mention
it explicitly, it seems that it should be able to support also
Curve25519. This FPU is fully documented.

Note: the optimized Curve25519 implementation from uNaCl is already
pretty fast, but hardware acceleration could be interesting in cases
where more than a very small number of keys has to be used/tried.

- has a memory protection unit. I'd still have to examine the details,
but this might allow merging cMCU and sMCU functionality on the same
chip with the security of the resulting solution between the old
single-MCU design and the current two-MCU design.

So, might be interesting chip for a future design variant.

- Werner

Loading...