One interesting thing I stumbled upon:
https://github.com/insane-adding-machines/unicore-mx
UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X
Supports nRF51/52
One interesting thing I stumbled upon:
https://github.com/insane-adding-machines/unicore-mx
UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X
Supports nRF51/52
@neverdie There are three ways to manipulate registers directly from Micropython:
Use machine.mem16
Use the decorator @micropython_viper
The Viper code emitter implements integer types and pointers, allowing to access memory and registers directly.
Use the decorator @micropython.asm_thumb
Write your code in ARM assembler.
Problem: I don't know whether any of this is already implemented and works reliably in Micropython for nRF.
@neverdie Speaking of micropython: Adafruits fork of micropython (called circuitpython) now also supports the nRF52840. The also added the nRF52840 dongle as make target (pca10059). After compiling, you can use nRF Connect to flash the hex file to the dongle, via the stock USB DFU bootloader, so you don't need an extra programmer.
I like that dongle, it's cheap yet powerful, and it may be the smallest micropython-capable board with native USB. Native USB is nice, because in this case it has not only a serial REPL, but also a virtual drive with the code files, like the original pyboard.
@neverdie said in nRF5 action!:
It has 256K RAM and 1MB of flash. I'm having difficulty imagining which applications would require that much of either one.
Bluetooth 5
@neverdie No, device only.
But another thought: This thing has USB, NFC, an AES and SHA accelerator, secure storage, secure boot, random number generator, and Bluetooth.
So it would make a nice USB/NFC/Bluetooth FIDO/U2F security key!
@neverdie
In fact it can.
Adafruit has a build of their Circuitpython (Micropython fork) for the nrf52832, and there's already an early alpha for the nrf52840.
As the 52840 has native USB, they can use Micropython as it was originally intended to be, with a virtual USB drive that contains all the user code files.
@ahmedadelhosni
Sure, I'm using a similar one.
Why wouldn't it work? The nrf52 is an ARM Mx, like the ST chips. The programming interface is the same. You could also use one of the many other ARM programmers, like J-Link, or nearly any JTAG programmer supported by OpenOCD.
Just follow this guide: https://www.openhardware.io/view/376/MySensors-NRF5-Platform
And: https://github.com/sandeepmistry/arduino-nRF5/#installing
One must be aware, that the gain of an antenna doesn't come from a magic amplification, but from direction.
Meaning, the higher the gain of an antenna is, the more directional it is.
For a sensor, let's say a window switch, that may end up in every mounting position you might imagine, this is NOT what you want.
Neither do you want that for the gateway, that may be in the middle of the house, and should be able to receive transmissions from all directions.
@NeverDie For a development board, it could be interesting to drive LEDs with P0.20 and P0.24, because they'll show you exactly when the board sends or receives.
@NeverDie It isn't possible to crimp a thicker wire to a U.FL connector.
Therefore you have to use a thin cable, but keep it as short as possible.
There are thin cables with lower loss, but they tend to be very expensive.
@NeverDie
I bought it used on ebay, for little money.
But generally you can assume that everything that comes with an N connector is meant for (semi-) professional use.
Conversely, avoid everything that comes with a reverse-SMA connector and/or a thin cable.
It's usually crap.
@NeverDie The datasheet is here: http://www.freqchina.com/plus/view.php?aid=1083
(Click on the "Data" tab.)
@scalz For rtlsdr, I once bought one of those (outdoor) scanner antennas, that claim to be usable from 20MHz to 2GHz, only to find out, that a simple coat hanger antenna made from coax performs ways better.
I can even receive the NOAA satellites with it.
@NeverDie said in nRF5 Bluetooth action!:
It actually does extend range. Not as well as I had hoped, but better than this high gain antenna, which I also received today and which, in comparison, I would call little better than a placebo:
https://www.amazon.com/gp/product/B073SWWMRG/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
Those 2.4GHz pseudo stocked dipole antennas have always been crap.
Even if they had 9dBi, they'd lose most of it because of the thin lossy cables.
Never combine a high gain antenna with a long cheap cable, it's a waste of money.
Most better patch antennas work quite well, as do parabolic and backfire types.
I have a 16dBi patch antenna, that works amazingly well. I can, from inside the house, see WiFi APs that are kilometers away.
If you're on a budget, build a cantenna. If not, buy a not too cheap patch antenna.
@scalz Wideband means: Bulky, but nevertheless low gain.
With "low gain" as in: performs as well as a piece of wire of 1/4 wavelength.
@NeverDie
What antenna did you use?
It doesn't make so much sense to replace the internal 1-2dBi Antenna with an external 2-3dBi one.
Most small WiFi antennas are simply crap.
Also, 2.4GHz is a frequency so useless, that not even the radio amateurs wanted it. They have 2.3GHz.
At 2.4GHz, you may achieve a range of kilometers if you have a free sight, but not even penetrate a single wall with the same setup.
@NeverDie
Exactly. There are two pads labelled SWD and SWC, originally meant for pogo pins.
I patched them with wires to the pin header.
Programming with a Chinese STLink V2 clone works flawlessly.
I just received 2 of those little boards.
Ideal for small sensor nodes, I'd say, but not very breadboard friendly.
So I dug out the verowire, and did a little soldering.
@Mike_Lemo
This sounds more like an EMC issue.
The connected ST Link filters some disturbance at the i2c lines, and when it's not connected, the disturbance corrupts the signals.
Try connecting capacitors from the i2c lines to ground. I'd start with 100pF each.
May also be a power supply issue. Did you connect the st-link's 3.3V line to the board?
For the charger:
http://www.ebay.com/itm/MPPT-Solar-Controller-3S-12-6V-Lithium-Battery-Charging-18650-Charger-Module-zhn-/332313023330
For the battery:
http://www.ebay.com/itm/1-3S-11-1V-25A-W-Balance-Li-ion-Lithium-18650-Battery-BMS-PCB-Protection-Board-/272761561101
You need a balancer to charge Li-Ion batteries in series, hence the addon board.
It also protects against overcharging, over-discharging and overcurrent.
You could also buy a battery pack with integrated balancer/protection:
http://www.ebay.com/itm/Portable-DC-12V-20000mAh-Li-ion-Super-Rechargeable-Battery-Pack-US-Plug-Lot-MU-/162662798231
@NeverDie
What if you activate a pin change interrupt/wake at the pin the PPI toggles?
Or connect it to another pin with pin change wake?
@Toyman Indeed:
Nonetheless, larger AA or AAA type
batteries are still required to reliably achieve operation times
of a year or longer with high advertising rates.
As I thought.
And for more advanced modulations, like LoRa, the power consumption is even higher.
@NeverDie None, unfortunately. The manufacturer would have to take care of that, by implementing a low power mode in the receiver (maybe with reduced sensitivity), and an additional low power wakeup pattern detector.
There are transceiver that can do that, but the nRF52 can't.
Some of the simple 433MHz OOK receivers have a low current consumption, but they're pretty insensitive, high bandwidth and low speed, so of not much use except switching some battery powered lamp, or such.
Some time ago I searched for a transceiver with low current receive mode, to use it in a battery powered node, that could be woken up by rf, but found nothing.
All of the standard data transceivers are pretty power hungry.
Great that it works.
But I'm not so convinced about the usefulness of this method, anyways.
I know that a lot of receivers use simple RSSI measurement to implement a low power listening mode, but when you are in a noisy environment, the system will wake up quite often, draining the battery fast. And unless you live in a very remote area, 2.4 GHz IS a noisy environment.
In this example from Nordic, they're using the RTC's compare interrupt:
http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fapp_example%2Fsolar_beacon%2Fintroduction.html
Average current consumption is 19µA, including sensor reading, data transmission and Bluetooth advertizing.
Not too bad, I'd say.
So, you want to shut the CPU down, leaving only RTC and PPI running, and generate a wakeup event every 100ms, did I get that right?
I didn't dig that far into the datasheet, and also I don't have any board for testing (yet).
Also, I didn't check whether the debugger will survive a power down/up cycle.
Does it?
@NeverDie said in nRF5 Bluetooth action!:
EVENTS_TICK
From the datasheet:
15.6 Events
Events are used to notify peripherals and the CPU about events that have happened, for example, a state
change in a peripheral. A peripheral may generate multiple events with each event having a separate
register in that peripheral’s event register group.
An event is generated when the peripheral itself toggles the corresponding event signal, and the event
register is updated to reflect that the event has been generated. See Figure 10: Tasks, events, shortcuts,
and interrupts on page 68. An event register is only cleared when firmware writes a '0' to it.
Events can be generated by the peripheral even when the event register is set to '1'.
Maybe I don't get the problem here, but the way I see it, you have to actively write a '0' to the event register to clear it, but in fact it shouldn't matter, because the timer can nevertheless generate an event.
How does the NRF52832 fare, compared to a classical solution using Arduino Nano and nRF24?
Is it usable for a sleeping node with a (window) switch, or a remote environmental sensor, when it comes to range and power consumption?
Is the software already stable enough?
@Nca78 The Arduino Zero is also an M0, so this shouldn't be too complicated.
Peripherals are completely different, though.
I said boards, not chips. Chips I can get a dime a dozen.
And as there aren't any cheap STM32L0 boards now, most people will stay with the blue pill.
I already ordered this:
https://github.com/hallard/WeMos-Lora
Hi.
I want to use an ESP8266 as gateway, but not with NRF24, but with RFM95, respectively Ra-02 (same SX1278 chip).
The ESP8266 gateway example code has already an option to use an RFM95 as radio.
Anything else besides this that I have to configure?
How do I connect the RFM95 to the ESP8266? Are the connections exactly the same as for RFM69, or is there something different?
Thanks in advance
Uhrheber