nRF5 action!
-
What I find even more interesting than that, though, is "extended range" Bluetooth, which might very well be the all-in-one tiny module that does it all: http://www.cypress.com/blog/psoc-creator-news-and-information/design-long-range-bluetooth-applications-new-ez-ble-psoc-xtxr
No need to add an NRF24L01 or an RFM69 module, because for home automation, the extended range version of bluetooth should have adequate range already. And it has a capable ARM MCU built in.
-
@NeverDie radio mcus are nice
-
@NeverDie I love the new 51840 (the one that does the long distance, the 832 is the High throughput chip) Please work with the 840.
I have the nRF52840 Preview DK, but have not fired it up yet. Still trying to understand how to code Bluetooth.
http://www.nordicsemi.com/eng/Products/nRF52840-Preview-DK.SiLabs has an interesting Gecko BT5 chip as well.
http://www.silabs.com/products/wireless/bluetooth/blue-gecko-bluetooth-smart-socs
-
1 megabyte of flash and 256K of RAM! And long range too! Wow, that NRF52840 takes things to a whole new level. When will we be seeing regular modules with it beyond just the developer kits?
Also, the inevitable question: is it programmable through the Arduino IDE? I sure hope the answer is yes.
-
840 is pretty new, and if i'm not wrong, final version is planned in few month for end of year (it's a bga package, and preview version), there are a very few modules actually, but expensive to order, for a beta though. So if there is a support for it in Arduino, it could be not complete yet. i'll tell you more when i'll get mine
-
OK, so if we wanted to make something today (or, at least before the end of the year), what module should we use now such that the nRF52840 will be an easy upgrade when it arrives later and sells for (hopefully) cheap on Aliexpress? Would it be the nRF51422 (which I don't believe does long range)? In fact, I'm not sure whether Nordic has anything long range before this nRF52840. That's kinda why I was looking at the cypress or silicon labs product lines, not knowing that Nordic had something in the wings already.
When it does become available, it looks as though it will be around $7 for quantity 1: http://www.mouser.com/ProductDetail/Nordic-Semiconductor/nRF52840-QIAA-R7/?qs=sGAEpiMZZMve4%2FbfQkoj%2bGh7uW9JJ8VYnj7XFjezTdQ%3D
Actually, it says 16 week lead time, so that's more or less consistent with what Scalz said.
-
This whole topic has been brewing in the back of my mind for a couple years now:
https://forum.mysensors.org/topic/1788/nrf51822-as-an-all-in-one
and
https://forum.mysensors.org/topic/3836/anyone-besides-me-looking-into-long-range-bluetooth-for-their-wireless-nodesWith the nRF52840, it looks as though the moment has finally arrived to tie it all together and give it a try.
I just have no idea where to even begin though. Just order the nRF52840 preview DK? Is it fairly quick to get something up and running, or is it a fairly steep learning curve?
-
@Terrence said in Minimalist SAMD21 TQFP32 Pro Mini:
@NeverDie I love the new 51840 (the one that does the long distance, the 832 is the High throughput chip) Please work with the 840.
I have the nRF52840 Preview DK, but have not fired it up yet. Still trying to understand how to code Bluetooth.
http://www.nordicsemi.com/eng/Products/nRF52840-Preview-DK.SiLabs has an interesting Gecko BT5 chip as well.
http://www.silabs.com/products/wireless/bluetooth/blue-gecko-bluetooth-smart-socsEven though you said 840 rather than 832, might the 832 yet still be a decent way to get started?
https://www.adafruit.com/product/3406
And then transition to the 840 when it becomes more available? At least the 832 is in the same nRF52 samily as the 840.My hunch is that bluetooth long range is going to win, because regular bluetooth is already baked into everything.
-
@NeverDie I think the 832 would be a good start until the 840 is available. I think all programming will be the same for when we switch over the 840. I am not 100% sure though.
I have been looking at the AdaFruit 832 since it came out, but have not pulled the trigger yet, as I have not yet opened my 840 dev kit.
We can definitely program the AdaFruit 832 with Arduino.
I agree with you that BT5 long range is the way to the future due to it's low energy, great built in security, long range and no additional chip required.... and >>because regular bluetooth is already baked into everything.
-
I agree with @Terrence
For end users, i think you won't see a big diff in Arduino when 840 will be released. but they are not really the same inside..
Also 840 is Nordic flagship, so it won't be as cheap as nrf51 series soon. And the same applies to 832 which is still affordable regarding specs. That's why they've released the 810, for lower cost, same RF perf as 832, but less memory.
-
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
same RF perf as 832, but less memory
but no long range right?
So scalz it is your understanding that the coding will be the same on the 832 and when we start getting the 840, but the distance will just increase?
-
I tried looking at the description on Mouser for the nRF52840 Preview Development Kit,
and it's not obvious as to whether it even comes with any of the modules. So, I guess I could get it to do mcu tricks, but I'm wondering now whether it can even communicate with anything wirelessly until 16 weeks from now?
Also, it's not clear to me yet whether the Nordic modules are truly "long range" rather than just better range. I get the impression they do some coding gain without actually increasing transmit power. That's fine, I suppose, although the datasheet (http://www.mouser.com/ds/2/297/nRF52840_OPS_v0.5-1074816.pdf) does describe the link budget (with coding gain?) as being only 104dB, which isn't exactly awesome.
-
@NeverDie
The nRF52840 PDK is a versatile single board development kit for Bluetooth 5, Bluetooth low energy, ANT, 802.15.4 and 2.4GHz proprietary applications using the nRF52840 SoC. This kit supports development for the nRF52840 SoC.http://www.nordicsemi.com/eng/Products/nRF52840-Preview-DK
https://devzone.nordicsemi.com/blogs/1093/Cool drone video of 840 long range.
Nordic Semiconductor ā Bluetooth 5 Long Range Test with nRF52840 ā 04:03
ā Nordic Semiconductor
-
That's pretty impressive..
-
A better test would have been to test the range while still maintaining a sufficiently low packet error rate. Their test criteria was just "still receiving packets," which could have meant a very high packet error rate, which isn't really useful information.
At the end of the day, it's the link budget that seems to matter most in comparing different radios. The higher the link budget, the better the range (in apples to apples comparison, where a particular packet error rate is what determines practical "range").
So, for comparison, a LoRa radio has a link budget as high as around 156dB (that's with the lowest bitrate and the highest coding gain). It's arguably far more than you need for home automation, but then again, I'd rather have overkill than underkill.
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
A better test would have been to test the range while still maintaining a sufficiently low packet error rate. Their test criteria was just "still receiving packets," which could have meant a very high packet error rate, which isn't really useful information.
I think at the moment the guy says he doesn't see a single drop, or something like that. I understood "all packets arrived".
-
I notice though that they show the link budet for the 840 is 111dB. Well, that's encouraging. The datasheet says "104 dB link budget for Bluetooth low energy," so I guess they're using a different mode.
-
I was really keen to try the nrf52832, in lieu of the nRF52840 until it became available, because of the OTA wireless update capability. Then I dug a bit further, and on the Adafruit website (https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/using-the-bootloader) it says "This option is not actively support nor recommended by Adafruit, and we are still working on making this as safe as possible for users via our Bluefruit LE Connect application. Use OTA DFU at your own risk knowing you can brick your device and may need a Segger J-Link or similar device to regain control of it!"
-
I have the Adafruit Feather M0 RFM69 nominally working doing Blink plus a little more. Adafruit appears to provide zero demo code for the LowPowerLab library, though it does for the RadioHead library. Therefore, I haven't yet figured out what I need to change in my code to make it talk to the Radio, but that's next.
So far I'm not at all liking the "two in one" usb connection: one for programming it and one for the serial console. The transition and sharing between them only rarely goes smoothly. Not sure if that will ever get ironed out over time or whether two physically different usb connections (as some of the other arduino boards provide) would be better.
-
OK, I've got the Adafruit Feather M0 RFM69 radio working now. To make it work with the LowPowerLab library, you need to delete the following from the RFM69.h file:
#elif defined(__arm__)//Use pin 10 or any pin you want #define RF69_IRQ_PIN 10 #define RF69_IRQ_NUM 10
and replace it with:
#elif defined(ARDUINO_SAMD_FEATHER_M0) // Feather M0 w/Radio #define RF69_SPI_CS 8 #define RF69_IRQ_PIN 3 #define RF69_IRQ_NUM 3 #define LED 13
That's all there is to it!
-
@NeverDie
all you have to do is set your defines for mysensors and this should work out of the box
about the usb, weird, i've no problem here. what problem do you have? here it works smoothly (with custom board, but i have also an adafruit m0 proto, worked well too)
-
@scalz
Well, first, for the benefit of others who may be reading this but who aren't familiar with the two USB paradigm, this is how it looks on the Arduino Due:
There are two physically distinct USB connections, but you can have both connected to your computer at the same time. The "Native USB Port" lets you read the console output, and the "Programming port" is for uploading new sketches. It works fine. I like it.So, with that as background, on both the Adafruit Feather M0 SamD21 and the Sparkfun M0 SamD21, there is the same concept, but only one physical USB port. So, let's say I just uploaded a sketch and then want to immediately switch to the "Native USB Port" so that I can read debugging information. Well, that doesn't happen automatically (as it should really). Instead, I get an error message which reads, "Couldn't find a Board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.
processing.app.SerialException: Error opening serial port 'COM45'."
Then, I have to go to the Tool menu and manually select Com44 and then open the serial console. Well, by then, the debug info would have already passed by, because it doesn't reboot upon opening the serial console. So, I've added a delay countdown to give me time to do this.And, by the way, every single time I upload a new sketch, it always reports, "An error occured while uploading the sketch," even though if I look at the details, it shows that it uploaded and even verified the upload, and even--sure enough--it really did upload. So, that part is really beginning to bother me, even though maybe it shouldn't. It's true for both the Adafruit and the Sparkfun Samd21 boards.
Anyhow, it looks like the Hackaday guy did a board with two physical USBs, and maybe that's a good idea?
Or maybe it's still just one USB connection and three different connector types? Not really sure.
-
Anyhow, I guess what I could do is simply write my serial debug output to a pair of Rx and Tx pins, and then I could side-step the whole mess without getting entangled in it. Not very elegant, but it would serve the purpose until I learn the ins-and-outs better.
-
You will always have the issue of USB connection, when using a native USB device, because it will re-enumerate on the USB bus whenever you reset the device.
That's also why you have to put the following code
while(Serial) {}
In the setup routine of sketches with native usb devices, if you expect to catch all debug messages from the start. This behavior does not change if you have both native and a programming port.
-
By the way (and it's just an as yet an unverified first impression), but it seems like the RSSI received on the Feather RFM69 is much better than on an atmega328p RFM69 combo. If that bears out, then all by itself it might be reason to switch. Anyone else get this impression, or not?
-
@tbowmo said in Minimalist SAMD21 TQFP32 Pro Mini:
while(Serial) {}
Cool. I just tried it. It turns out it's actually
while(!Serial) {}
but it works great. Thanks!
-
about rfm69 and better rssi, it could also be related to ground plane size of the board.
and for mcu, yep no need of the programming port. native is enough if there is the bootloader.
-
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
@NeverDie
all you have to do is set your defines for mysensors and this should work out of the boxI just now noticed that @Sweeman already did: https://forum.mysensors.org/topic/6908/adafruit-feather-m0-rfm69hcw-with-mysensors/6
-
I hadn't noticed it before, but it looks like even Arduino will have an NRF52 board: http://www.arduino.org/products/boards/arduino-primo
Of course, that's a very good thing! Unfortunately, they don't seem to be in stock anywhere, even though they were first released in March, 2016. What's up with that?
So, I've ordered a couple of these to try out:
https://www.amazon.com/Adafruit-Feather-nRF52-Bluefruit-nRF52832/dp/B06XXSVYLC/ref=sr_1_1?ie=UTF8&qid=1498743679&sr=8-1&keywords=nrf52The good news is that NRF52 modules don't seem to require many external parts, and for self-assembly that's a real advantage.
-
Looks like a fully integrated board can be had for <$9, including e-packet delivery:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=2114.01010208.3.17.YON8eD&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10130_10068_5210015_10136_10137_10060_10155_10062_437_10154_10056_10055_10054_10059_303_100031_10099_10103_10102_5290015_10096_5320015_10052_10053_10107_10050_10142_10051_5280015_10084_10083_5250016_10119_10080_10082_10081_10178_10110_519_10111_10112_10113_5240015_10114_5230016_10182_10078_10079_5260014_10073_10123_10120_10189_5270015_142-10120,searchweb201603_49,ppcSwitch_4&btsid=02e4720e-a974-4d92-a890-0cd0f6510022&algo_expid=87b18aca-7c4a-43a5-8995-4d45694a7044-2&algo_pvid=87b18aca-7c4a-43a5-8995-4d45694a7044
-
@NeverDie I was about to pull the trigger on some of those, but I can't seem to get my mind off of the potential long distance of the 840. I wonder when the world will be blessed with those modules?
Looking forward to your experience with the Adafruit BLE boards.
-
@Terrence said in Minimalist SAMD21 TQFP32 Pro Mini:
I wonder when the world will be blessed with those modules?
I wouldn't wait for them. Will probably take at least half a year or so (according to Nordic)
-
@Yveaux You are correct, use what is available, not what will be in the future.
-
@Terrence said in Minimalist SAMD21 TQFP32 Pro Mini:
@NeverDie I was about to pull the trigger on some of those, but I can't seem to get my mind off of the potential long distance of the 840.
Same here, but hopefully (?) most of what I learn with the 832 will be applicable to the 840. The 840 is clearly more desirable, and I probably wouldn't have pulled the trigger on the 832 if I didn't know the 840 was coming.
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
most of what I learn with the 832 will be applicable to the 840
Right. I have been trying to get my head around the BT communication pattern. It is a different beast indeed.
-
Looks as though the 52 Thingy might be a good starting point for some people:
http://www.mouser.com/new/nordicsemiconductor/nordic-thingy-52/
-
What I'm not sure about is whether the NRF52832 will have truly adequate indoor range. Max tx power is 4db, which is better than the 0db of the NRF24L01. Will that be enough? I can only guess. That's why I ordered two of the Adafruit NRF52832 feathers: to see for myself. If they disappoint, then I may shelve them until the 840 becomes more available, and then try again using the 840. On the other hand, if the 832 turns out to be "good enough", then the 840 may not matter so much.
I do like that it apparently is programmable from within the Arduino IDE. That will make trying it out a lot easier. If the OTA uploads are easy to do, then I'll be really happy.
-
@NeverDie
nrf52832 is definitely better than nrf24l01. if i'm not wrong, 4db can double range in theory.
For range, an important point is the antenna, as you already know.
Chip antenna can be ok, depending on the environment and usecase, but can't compete with a rfm69. These antennas are not for long range, so the adafruit board. How to miniaturize antennas without loosing performance..
-
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
These antennas are not for long range, so the adafruit board. How to miniaturize antennas without loosing performance..
Good point. Looks as though the aliexpress module I referenced above, though, does have some kind of antenna connector on it:
So, maybe plugging something (?) into that would give better range?Also, I just now read that these 832 modules can communicate with the older NRF24L01's. Is that true? That would be nice.
-
@NeverDie
yes these one looks better. looks like you can also tune ant (there are some footprints).
note the "meandered" antenna. it reduces antenna size, needs some tuning, a bit less efficient vs others type. but maybe better than chip antenna i think. and you have the ipex in case, cool!
Not so cheap (not fcc) but interesting i agree.Yes, indeed! it's compatible with nrf24 thx to @d00616
You should try, i'm using my nrf52 board (aeos) with my esp32 gw (halo)
And the cherry, with VS Micro, and multiple serial monitors in same ide
-
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
And the cherry, with VS Micro, and multiple serial monitors in same ide
Guys I have been developing with VS Code (free) for Arduino type coding. been very happy with it. It does not have multi serial monitors (not that I know of).
Anyone else using VS Code?
-
@Terrence said in Minimalist SAMD21 TQFP32 Pro Mini:
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
And the cherry, with VS Micro, and multiple serial monitors in same ide
Guys I have been developing with VS Code (free) for Arduino type coding. been very happy with it. It does not have multi serial monitors (not that I know of).
Anyone else using VS Code?What are its advantages that are the reason for your preferring it?
-
@NeverDie I prefer it over the Arduino platform, not VS Micro.
It is a super lightweight editor, but really powerful with added extensions.
In Windows Explorer, right click a folder and click on "Open with Code' and the folder and all code files are there.I have been using Visual Studio for work for a decade. It is a very heavy capable environment, but too heavy for simple ino projects.
I used VS Micro 3 years ago or so, but I can't compare the two.
https://code.visualstudio.com/
Here is a snip showing the Arduino extension.
-
I received the adafruit nrf52 feathers today, and I'm really quite shocked: adafruit doesn't supply any demo code (at least none that I can find) which would allow two nrf52 feathers to talk to one another. In fact, most of the demo code has nothing to do with bluetooth at all! This is very disappointing.
-
@NeverDie I guess they just rely on mySensors for the communication
-
@Yveaux said in Minimalist SAMD21 TQFP32 Pro Mini:
@NeverDie I guess they just rely on mySensors for the communication
Wait, does mysensors demo code already work using the nrf52832?
If not, does anyone know of some demo code somewhere that demos two 832's communicating (like there's plenty of demo code already for the NRF24L01)? I really don't want to figure this out from scratch using just the datasheet. Been there and done that already with the RFM69, and I don't want to have to do it again with the NRF52832. If there is not already a good "load and go" demo somewhere, then I'm going to return these modules to Amazon.
-
@NeverDie
Adafruit only provides examples for Bluetooth.regarding mysensors, i have answered here https://forum.mysensors.org/post/70297
-
sidenote i forgot to say:
your adafruit board should have a bootloader inside, so you can burn a sketch from arduino just by using ftdi (and allows some other features like ota etc). This is why i've also added dtr signal on my aeos in case.
But I've not tried this configuration yet, and if i'm not wrong adafruit added freertos to their core files.
So, i have no idea if burning a mysensors sketch by using adafruit boards in Arduino (so their core) will work out of the box.As, for the moment, i burn my mcus by using swd programmer (like for the atsam), and use the sandeep core files, in Arduino board manager, with custom board definition regarding my boards as i have not this adafruit board,I made mine before, else i would have ordered one :).
I hope my explanations are clear, don't hesitate in case
-
@scalz
I've been able to run Blink on the Adafruit NRF52 by compiling the Adafruit example Blink program within the Arduino IDE and then uploading it to the Adafruit NRF52 over the USB cable using the Arduino IDE, if that's what you mean. That part seems to work as intended, and it behaves just like any other Arduino in that respect. It's just that I had wrongly imagined that NRF52's would be communicating with each other using Bluetooth, and instead it sounds like (?) they'll actually be using a different, non-Bluetooth mode, for that--which is fine by me.If I understand you correctly, I should be able to just upload the mysensors demo code (one for a gateway and one for a node) to my two Adafruit NRF52's, and that's all it should take for them to then be communicating in a normal mysensors way. Is that right? If so, that would be very welcome news indeed.
-
@NeverDie
yes, you just need to do this
-
@scalz
Are you sure? I just tried compiling the SerialGateway example inside the Arduino IDE with the board set to "Adafruit Bluefruit NRF52 Feather, " and it won't even compile. Looking at mysensors.h file, I think I can see why:// Enable radio "feature" if one of the radio types was enabled #if defined(MY_RADIO_NRF24) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) #define MY_SENSOR_NETWORK #endif // HARDWARE #if defined(ARDUINO_ARCH_ESP8266) #include "core/MyHwESP8266.cpp" #elif defined(ARDUINO_ARCH_AVR) #include "drivers/AVR/DigitalWriteFast/digitalWriteFast.h" #include "core/MyHwAVR.cpp" #elif defined(ARDUINO_ARCH_SAMD) #include "core/MyHwSAMD.cpp" #elif defined(__linux__) #include "core/MyHwLinuxGeneric.cpp" #endif
The library seems to have no recognition capability for either the NRF52 nor for any board based on it.
What do I need to modify to get it to work? Anyone know?
-
@NeverDie what MySensors library are you using? Nrf52 is only supported in development.
-
Yveaux is right, you need to use development branch of Mysensors, and just need to enable this define:
#define MY_RADIO_NRF5_ESBYou can also get more details here:
https://www.openhardware.io/view/376/MySensors-NRF5-Platform
-
I had been using the publicly released Mysensors library, but after your suggestions I switched over to the developers release.
So, now a new obstacle: if I compile using the board set as an Adafruit Bluefruit nRF52 Feather, I get the following fatal compile error:
Build options changed, rebuilding all In file included from C:\Users\CoolerMaster\Documents\Arduino\mysensors sketches\GatewaySerial_v002\GatewaySerial_v002.ino:85:0: C:\Users\CoolerMaster\Documents\Arduino\libraries\MySensors/MySensors.h:352:2: error: #error No support for nRF5 radio on this platform #error No support for nRF5 radio on this platform ^ exit status 1 Error compiling for board Adafruit Bluefruit nRF52 Feather.
However, if I switch over to the "Generic nRF52" board from Nordic Semiconductor, it compiles just fine, but it hangs while uploading.
-
@NeverDie
yep that's what i was talking, regarding adafruit&core in board manager.
That would be easier to just use sandeep core only (as adafruit core is an extension using bootloader), and then use one of the boards available for nrf52.You could try that :
- select NRF52 generic or DK in board manager (so this uses sandeep core)
- Select Softdevice : no
- Programmer : J-link
- Connect SWD programmer
- upload sketch
this should work, you'll just loose the adafruit bootloader feature i think.
-
I tried using the ST-LINK V2 programmer that I got from Amazon, but I think maybe (?) it's junk: almost nothing seems to recognize it after I've plugged it in. I've installed the USB driver for it from the ST website, and I've tried connecting to it using the ST-LINK utility program. It did recognize it long enough to identify its firmware and to actually (or so it said) upgrade its firmware to the current version. However, even that program can't seem to "connect" with it for anything else other than upgrading the firmware. Arduino doesn't see it at all.
So, maybe I need a better programmer? Is the DK for the 52832 from Nordic the one to get, or should I get something else (preferably something which might also work with the 52840 when that becomes available)?
An actual J-Link from Segger is priced at >$400. Are the cheap Aliexpress knock-offs just as good?
https://www.aliexpress.com/item/V9-the-LINK-J-LINK-ARM-emulator-support-A9A8-V9-4-high-speed-download-speed/32806221560.html?spm=2114.01010208.3.1.JlcJUT&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10082_10081_10110_10178_10136_10137_519_10111_10060_10112_10113_10155_10114_437_10154_10056_10055_10054_10182_10059_303_100031_10099_10078_10079_10103_10073_10102_10120_10052_10053_10142_10107_142_10050_10051,searchweb201603_49,ppcSwitch_4&btsid=55ccaf9e-4381-4041-87de-32344016ca8e&algo_expid=281f8f71-cf63-4236-b1e7-4fbf7703f3dc-0&algo_pvid=281f8f71-cf63-4236-b1e7-4fbf7703f3dc
-
So, I went ahead and ordered this:
https://www.aliexpress.com/store/product/1PC-JLI-V9-J-LINK-ARM-emulator-support-A9A8-V9-3-high-speed-download/1710342_32790881245.html?spm=2114.12010615.0.0.5qtBo0since it has e-packet delivery. Hopefully it's not a complete waste of money. Unfortunately, I guess there's not much more I can do until it arrives....
Anything else I should get to go with it? Like maybe:
https://www.amazon.com/ARM-JTAG-20-10-ARM-Micro-JTAG-adapter/dp/B009UEO9ZY/ref=pd_sim_21_1?_encoding=UTF8&pd_rd_i=B009UEO9ZY&pd_rd_r=C8G4T1QSJT3YVC6CQADF&pd_rd_w=CsX9i&pd_rd_wg=OIb04&psc=1&refRID=C8G4T1QSJT3YVC6CQADF
and/or
https://www.amazon.com/Gikfun-J-link-Emulator-Adapter-Converter/dp/B00RBHOSTY/ref=pd_sim_21_3?_encoding=UTF8&pd_rd_i=B00RBHOSTY&pd_rd_r=C8G4T1QSJT3YVC6CQADF&pd_rd_w=CsX9i&pd_rd_wg=OIb04&psc=1&refRID=C8G4T1QSJT3YVC6CQADF
and/or something else?Is there by any chance some kind of bit-bang equivalent that someone has already developed? With arduino's being so cheap, I'd think there'd be a way to use one as a programmer, or at least as some kind of uploader, to an ARM mcu. I mean, how hard can it be?
-
Since it seems I'll be forced to use a programmer, the adafruit advantages completely go out the window. Therefore, I ordered a couple of these, which will probably (?) be just as good in the end, but a whole lot cheaper:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=2114.01010208.3.17.YON8eD&ws_ab_test=searchweb0_0&aff_platform=aaf&cpt=1499046377472&sk=e2Vzr3v&aff_trace_key=0cb03246d5ed4112b865663460b55419-1499046377472-08913-e2Vzr3vI like that they have through-holes and not just castellated connectors. That will make them much easier to wire up.
-
I also ordered this as my final insurance in case the J-Link Segger knock-off turns out not to work:
https://www.aliexpress.com/item/2PCS-LOT-Link-OB-ARM-emulator-debugger-j-link-programmierer-downloader-link-statt-V8-SWD-Best/32813752595.html?spm=2114.13010608.0.0.RyKjDrIf none of that extra hardware works, then I'll probably switch to Linux to see if I have more luck using that instead of Windows.
-
@NeverDie
I think this is because you need to install Zadig, open it, choose your swd programmer in list and change the driver. Then it should work.
-
Thanks! I'll give that a try.
BTW, I noticed this nRF52830 module, which is interesting because it includes a trace antenna and is allegedly just 15.4mmx15.4mm in size: https://www.aliexpress.com/item/PTR5618-Nordic-nRF52832-Module-BLE-4-0-Module-Free-shipping/32758284869.html?spm=2114.10010108.100009.2.98oryP&traffic_analysisId=recommend_2037_null_null_null&scm=1007.13482.37805.0&pvid=c8de9a80-7258-4a83-a683-1ef7c7104607&tpp=1
Granted, it doesn't expose as many pins though.
-
@NeverDie
oki cool.
Raytac has also modules with pcb antenna, and interestingly, from their datasheet, perform worse than their chip antenna version.
I prefer to clarify it a bit! We can't say pcb antenna are always better than chip antenna.
But it's sure that you can't get the best performance with an antenna which is not adapted to the usecase.
Also, when doing very tiny pcb, the gnd plane can be too small regarding the wavelength etc, decreasing even more the antenna efficiency.
The more tiny, the less range..that's not a problem for a wearable, that you wear, close to your phone.
-
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
@NeverDie
I think this is because you need to install Zadig, open it, choose your swd programmer in list and change the driver. Then it should work.Ok, I tried this just now. The good news is that Zadig recognizes the ST-LINK V2 usb dongle when I plug it in (it shows up at "STM32 STLink"). The bad news is that I'm not sure which of those drivers I should install. Following the SandeepMistry directions on github, there is nothing called "Interface 2" that I can see. So, I tried all four USB drivers, each in turn, that Zadig offers up, but with none of them does the Arduino IDE subsequently recognize the St-LINK V2 dongle.
So, it does seem like I'm getting closer, thanks to your suggestions, but I'm still not there yet. Any more suggestions?
-
Also, Sandeep's preceding directions call for:
Download mbed Windows Serial driverMaybe this is where it all falls apart. I'm able to download the driver, but I can't install it. When I try to, the installation quickly terminations and I get the following error message: "the driver could not be installed. No mbed microcontrollers were found."
-
@scalz said in Minimalist SAMD21 TQFP32 Pro Mini:
Also, when doing very tiny pcb, the gnd plane can be too small regarding the wavelength etc, decreasing even more the antenna efficiency.
The more tiny, the less range..that's not a problem for a wearable, that you wear, close to your phone.As long as it's within range of a gateway, then it's good enough. Fortunately, it's really cheap to make gateways using ESP8266's, so you can have lots of gateways sprinkled around if needed. Of course, that's yet another trade-off, as it's not free, and it's arguably not even desirable either. Still, for tiny antenna's (like maybe for a soil moisture sensor in an indoor flower pot), being inconspicuous may make it worth the price.
-
Anyone here ever gotten the st-link v2 to work with the arduino and nRF52832? Seems like most published instructions pertain to the J-Link instead.
-
I'm cutting my losses. The googling I've done on this issue is not giving me much reason for optimism about the use of an ST-LINK V2 for this configuration. In fact, just the opposite.
I may get the DK to tide me over until the Segger J-Link and the other hardware arrives.
-
Just noticed that the ESP32S integrates both Wi-Fi and Bluetooth BLE. I guess it's not exactly on-point with what we're discussing here, as I doubt (?) it includes Nordic's proprietary radio modes that mysensors will be using (instead of Bluetooth BLE per se) in the nRF52832, but, golly gee, for just $5, that sounds like quite a package!
http://www.ebay.com/itm/ESP-32S-ESP32-WLAN-BLE-IoT-Modul-Dual-Core-CPU-Ethernet-Port-MCU-ESP8266-/182490173587?hash=item2a7d431093:g:7YIAAOSw4YdYyQW8If Mysensors ever did use BLE, I'd imagine it might make an excellent gateway (and cheap enough that you could easily afford quite a number of them to, say, guarantee solid radio communications throughout your house).
Why is it that mysensors is opting for the Nordic proprietary mode instead of the BLE standard? Is it just too cumbersome or something?
-
@NeverDie
Mysensors isn't opting especially for "nordic mode".
You're mixing a bit things.. So far Mysensors was using nrf24, and the nrf52 is compatible. That's all! Pretty cool to have the feature available i think.
Then, regarding, BLE etc, i can only say, there might be some nice feature in future, but that will need some patience BLE is another protocol like Mysensors is.Yep, esp32 is very nice, and i like my "Halo" esp32 gw. But I wouldn't use it without a strong battery, the radio modes are too much power hungry..
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Anyone here ever gotten the st-link v2 to work with the arduino and nRF52832? Seems like most published instructions pertain to the J-Link instead.
Yes, but I use Linux. I have all three supported programmers working. After adding an udev rule to fix permissions for any type of adapter they working very well. If you haven't luck, the CMSIS-DAP is an alternative to ST-Link or J-Link.
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Why is it that mysensors is opting for the Nordic proprietary mode instead of the BLE standard? Is it just too cumbersome or something?
There are some reasons I haven't implemented Nordics proprietary standard and I have no intension to use BLE as MySensors transport.
Like @scalz I think MySensors is a protocol and BLE is another protocol. MySensors is optimized to build a network of up to 255 nodes can communicate with low latency and BLE is a complex protocol for a limited number of nodes. There are a lot of use cases for both.
In my opinion, Nordic's BLE code and SDK is not Open Source friendly. I think you can't create LGPL code based on Nordics BLE SDK examples. To Compile code, you have to agree Nordics License or you have to choose.
For MySensors, I think the Apache implementation NimBLE should a good BLE implementation to start with. This Implementations looks more efficient than Nordics implementation and I like the OTA update/bootloader concept. At https://www.kickstarter.com/projects/redbearinc/bluetooth-5-ready-ble-module-nano-2-and-blend-2 is a demo video of a 32 node BLE network. It looks like there is a high latency in communication.
To support Nordics SoftDevice or another BLE implementation, the MySensors nRF5 code must be extended to use the hardware abstraction for e.g. random number generation, accessing flash memory or interrupt handling. When it's done a MY_RADIO_NRF5_BLE can be implemented.
Another option could be to use BLE packages without the BLE protocol, then its possible to communicate with any BLE MCU which allows direct access to the radio. Actually you can use the ESB protocol with BLE modulation, but I think this is incompatible to other BLE MCU.
BTW: The nRF52840 cannot communicate with 250kbit nRF24. This rate is depreciated since nRF52822 release.
-
@d00616 said in Minimalist SAMD21 TQFP32 Pro Mini:
Thanks for your post!I have all three supported programmers working.
It's great that you have that perspective to share. Which of the three do you most prefer, and why? Also, if picking one for use under a Windows environment, which would you recommend most?
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
It's great that you have that perspective to share. Which of the three do you most prefer, and why? Also, if picking one for use under a Windows environment, which would you recommend most?
The J-LINK is integrated into my nRF51 Dev Boards. Arduino-nrf5 uses openocd but I have also used the original software. The CMSIS-DAP is part of some RedBear boards I use.
For any other board without an integrated programmer I use the cheap ST-Link clones and an extra USB to 3.3V serial converter. Be careful I have two versions looking identical but with completely different pin assignments.
The arduino-nrf5 cannot address different devices. This is the reason I like to use different programmers. I can connect two devices and address them by choosing another programmer.
-
Just received my nRF52832 DK, and it included 5 additional nrf52832 chips in it. Wasn't even expecting that.
-
First impression after a quick looking it over: other than having a built-in J-Link, it looks like the DK will be of no extra benefit with respect to the mysensors nRF52832 implementation.
-
@NeverDie why won't it be helpful?
-
@Terrence
Since it has a built-in J-Link, it should be helpful in programming the nrf52832 that's already soldered onto the DK. However, will it be helpful in programming an off-board nrf52832 like the adafruit board or, say, the sparkfun board? I don't know.Maybe I haven't found the right starting point. I went to the url given on a small card in the DK, but it's mostly links to datasheets, white papers, app notes, a couple phone demo apps, software that can be downloaded, etc. I'm not finding a tutorial. Contrast that to what, for example, cypress semiconductor has for their bluetooth evaluation board, which is a whole video series of something like 50 video tutorials that walks you through from A to Z on how to use it.
-
I'm finally able to get some primitive sketches (such as Blink and printing to Serial) to run on the NRF52 DK using these settings:
Somewhat strangely, setting the LED pin LOW turns the LED to "ON", and setting it HIGH turns it OFF. Go figure.
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Contrast that to what, for example, cypress semiconductor has
Wow, cypress is knocking it out of the park on helping us. You would think Nordic would pick up the pace.
Thanks. I will check those videos out.
-
OK, using the mysensors example scripts, I have the nRF52832 serving as a serial gateway, and it is receiving messages from an nRF24L01 light sensor that's running on an arduino UNO.
So, apparently, it works.
Anyone know whether the nRF52 DK can be used to program other nRF52832's? If not, I guess I'll have to wait for the J-Link programmer I ordered to test out that part of it and get nRF52832 to nRF52832 communication working.
-
Here's the really good news. I tried a very quick range test with the above configuration, and it seems to be noticeably better than with two nRF24L01's. I check the datasheets, and, indeed:
nRF24L01: -85dBm sensitivity at 1Mbps
nRF52832: -93 dBm sensitivity, 1Msps nRF modeSo, for an nRF52832, that's an 8dBm improvement in link budget just from improved sensitivity alone. i.e. more than twice the range. Nice.
-
Looks as though the nRF52840 will have the same nRF mode receive sensitivity. However, it will have a receive sensitivity of -103dBm in 125ksps BLE mode. which is huge.
-
It's somewhat strange that the F-antenna never caught on with the nRF24L01, which typically used some kind of meandering antenna.
However, as proven by the ESP8266's evolution, the F-antenna is superior.
So, its presence in at least some of the nRF52832 implementations (such as that pictured below) should help as well.
-
I found it on some modules from Sunfounder on red PCB but they have fake nrf24 chip and still performed bad but a little better than the other chinese clones (range 7 meters indoor instead of 5)
-
Presently the parts cost is higher for an nRF52832 (and surely for an nRF52840) than for an RFM69 plus an atmega328p. So, I'm struggling to justify it.
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Presently the parts cost is higher for an nRF52832 (and surely for an nRF52840) than for an RFM69 plus an atmega328p. So, I'm struggling to justify it.
With only 5$ for the EBytes modules there's not much difference I think ? And for that you have a smaller size, easier soldering (compared to SMD atmega), incredibly more capable hardware that's really future proof for both MCU and radio module, lower power consumption for TX and even more for RX, ...
-
@Nca78
You're right. Especially after outfitting the atmega328p with an RTC, the cost is more of a wash. I think the RFM still wins on range, but maybe the 832 will be "good enough"...
-
I'm guessing that if I were to desolder the rFM52832 from the DK, then I could use the DK to program other chips using the SW pins by using the J-link that's part of the board.
-
@gohan said in Minimalist SAMD21 TQFP32 Pro Mini:
I found it on some modules from Sunfounder on red PCB but they have fake nrf24 chip and still performed bad but a little better than the other chinese clones (range 7 meters indoor instead of 5)
Interestingly, the antenna on the DK is sort-of hockey stick shaped. I guess they didn't need to compress it, since the board is so large anyway.
-
am reading your findings with great interest. Thanks for the updates.
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
You're right. Especially after outfitting the atmega328p with an RTC, the cost is more of a wash. I think the RFM still wins on range, but maybe the 832 will be "good enough"...
The question is, when 832 modules are available. After announcing the nRF52832 with its preview DK, I have waited from 06/2015 to 08/2016 until modules are available for an acceptable price at aliexpress or ebay.
I think the atmega is a slow 8-bit MCU with less RAM. The limited RAM requires to transmit additional nonce packages, when signing is enabled. SoftSigning hashing is 76 times faster. A faster CPU allows to shorten the active time:
- atmega328 14000Āµs
- nRF51 1739ĀµS
- ESP8266 380ĀµS
- nRF52 183ĀµS
The NRF24 has problems with clones, range and the limitation of packages to 32 bytes. The nRF52 allows to change the packet format to support >32 bytes packages.
At the moment sleep modes are only implemented for 328 and nRF5.
OTA updates are available for 328 and ESP8266. For nRF5 it requires to implement a boot loader. The internal flash should have enough capacity to store a simple bootloader and a firmware update.
If you plan to do a lot of writes into EEPROM the 328 has a real EEPROM. The SAMD requires an external EEPROM, the nRF5/Teensy/STM32F emulating the eeprom in Flash. The nRF5 is using the NVM driver, which allows much more writes to the emulated EEPROM. The price for NVM is some time for log cleaning after some hundreds writes.
IMHO the best MCU for creating new battery powered sensors is the nRF5 stating with a ~3ā¬ board, if required in combination with RFM modules.
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
I'm guessing that if I were to desolder the rFM52832 from the DK, then I could use the DK to program other chips using the SW pins by using the J-link that's part of the board.
I think it's simpler to use one of the ST-LINK v2 clones. The DK board should be good for development, debugging and current measurement.
-
@d00616 said in Minimalist SAMD21 TQFP32 Pro Mini:
I think it's simpler to use one of the ST-LINK v2 clones. The DK board should be good for development, debugging and current measurement.
What exactly do I need to do to get it work? I tried it from Windows, and failed. I seem to recall you said you got it to work from Linux after changing a definition. Would you mind showing the steps, or providing a link on how to do that?
-
@d00616 said in Minimalist SAMD21 TQFP32 Pro Mini:
IMHO the best MCU for creating new battery powered sensors is the nRF5 stating with a ~3ā¬ board, if required in combination with RFM modules.
The board you linked to is an nRF51. Which do you prefer? nRF51 or nRF52?
-
Looks as though the nRF52832 beats the nRF51832 on Rx sensitivity at 1mbps. The nRF51832 is:
ā¢ -90 dBm at 1 Mbps
versus -93dBm at 1Mbps for the nRF52832.On the other hand, the nRF51832 has -96dBm receive sensitivity at 250kbps, and the nRF52832 appears to lack that mode altogether. So, in a way, that make sthe nRF51832 seem a bit more attractive on range, even if one has to pay a price on bitrate.
-
@d00616 Now that you mention it, that board you linked to ( https://www.aliexpress.com/item/BLE4-0-Bluetooth-2-4GHz-Wireless-Module-NRF51822-Board-Core51822-B/32633417101.html?spm=2114.search0104.3.18.Q9naea&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10082_10081_10110_10178_10136_10137_10111_10060_10112_10113_10155_10114_5360016_10154_438_10056_10055_10054_10182_10059_100031_10099_10078_10079_10103_10073_10102_10120_10189_10052_10053_10142_10107_10050_10051,searchweb201603_5,ppcSwitch_4&btsid=f45d662b-6a09-4449-9bee-1ea58d9beab8&algo_expid=53f99b5d-bb10-4b34-a548-2a3e4c0cd96e-2&algo_pvid=53f99b5d-bb10-4b34-a548-2a3e4c0cd96e ) would be an interesting way to control an RFM69, especially if it could do an OTA sketch uploade. Can it?
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
The board you linked to is an nRF51. Which do you prefer? nRF51 or nRF52?
I prefer to use nRF52 controllers when the price doesn't matter.
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
Now that you mention it, that board you linked to would be an interesting way to control an RFM69, especially if it could do an OTA sketch uploade. Can it?
OTA sketch upload is on my todo list, but not at the first position
-
@NeverDie said in Minimalist SAMD21 TQFP32 Pro Mini:
On the other hand, the nRF51832 has -96dBm receive sensitivity at 250kbps, and the nRF52832 appears to lack that mode altogether.
The 250kbps mode is working with the nRF5232 but this was the last chip supporting this mode.
-
This module is interesting because it looks as though it would be relatively easy to attach to most simple sensor projects:
https://www.aliexpress.com/store/product/NRF52832-Bluetooth-4-2-module-Bluetooth-5-program-PCBA-serial-transmission-cost-effective/1383441_32818791344.html
-
I found some useful connectors:
1.27mm pitch seems to be what's most common with nRF52 stuff.
-
what would you use those connectors for?
-
@gohan said in Minimalist SAMD21 TQFP32 Pro Mini:
what would you use those connectors for?
The J-Tag ones for connecting a J-tag programmer to an nRF5 board (e.g. the adafruit one has holes for such a 2x5 connector already on its PCB).
The 1.27mm headers I think I might use for connecting some of the small nRF5 boards which have 1.27mm pitch through-holes onto some prototypes rather than just soldering them down. That way I can easily move them to the next version of the prototype without creating a lot of desoldering work.
I've ordered all of the above earlier today. I'm just providing the links in case others may want to do the same.