nRF5 action!
-
@Mike_Lemo said in nRF5 Bluetooth action!:
Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.
The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.
The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.
@NeverDie said in nRF5 Bluetooth action!:
It hasn't been easy, I'll grant you that. I get the impression d00616 probably does most of his work in Linux, and so some of the disconnect with the Windows IDE probably stems from that.
I can't change the way of Windows driver handling, but when there are Windows specific issues then they bust be fixed.
@d00616 said in nRF5 Bluetooth action!:
@Mike_Lemo said in nRF5 Bluetooth action!:
Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.
The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.
The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.
.
You mean way more complete every thing is accesable there and there is an example for everything and I didn't use my sensors anyways
-
@d00616 said in nRF5 Bluetooth action!:
@Mike_Lemo said in nRF5 Bluetooth action!:
Dunno that whole arduino BRF52832 programming thing seems too complicated just started to learn how to use the nordic SDK with eclipse until a proper solution is found.
The Nordic SDK is more complete than Arduino-nrf5 at the moment, but there is no compatibility with MySensors.
The good news, with SDK 13 the 'Nordic Semiconductor ASA' License was changed. The old ASA was the reason for me to rewrite the complete ESB protocol. Now the license is much less restrictive. I think now the way is open to integrate SDK code into arduino-nrf5 or provide SDK based arduino-libraries.
.
You mean way more complete every thing is accesable there and there is an example for everything and I didn't use my sensors anyways
@Mike_Lemo said in nRF5 Bluetooth action!:
You mean way more complete every thing is accesable there and there is an example for everything and I didn't use my sensors anyways
No. I mean if you want to use the Nordic MCU with BLE and you want to access the whole hardware without developing drivers, then the Nordic SDK is an option. For special requirements like tone() you have to develop your own routine for Arduino or SDK.
If you want write code which is compatible with other Vendors or want use MySensors then the SDK isn't the best choice.
The arduino-nrf5 targets to provide the Arduino language. I think this is mostly complete. MySensors brings additional support for enhanced pin output modes and the random number generator (no SoftDevice support here).
Accessing the internal MCU hardware must be added via Arduino libraries. With the new SDK license I think it's possible to put parts of the SDK into libraries supporting Hardware which is not specified in the Arduino reference.
If you want to develop BLE applications with portable code, there are open source implementations like http://mynewt.apache.org/ which are designed to be portable.
-
Good news! The hwCPUVoltage() function measures the Vcc voltage on the Ebyte module in millivolts. I'm able to send that as a barometer reading using the mocksensors sketch, and it arrives all the way into Domoticz, where it is logged and graphed. So, obviously I need to streamline that a bit, but the proof of concept works. :)
-
Good news! The hwCPUVoltage() function measures the Vcc voltage on the Ebyte module in millivolts. I'm able to send that as a barometer reading using the mocksensors sketch, and it arrives all the way into Domoticz, where it is logged and graphed. So, obviously I need to streamline that a bit, but the proof of concept works. :)
Quantization error on the hwCpuVoltage() function appears to about 14 millivolts, which is a nice little improvement over the atmega328p. Measurement accuracy appears to be well within those bounds.
Next step is to measure voltage on an analog pin using an AnalogRead. Not sure if the reference voltage is Vcc (as it typically is with the atmega328p) or something else for those measurements.
-
Given new Arduino Primo contains a buzzer connected to nrf52, we might expect tone() function to be compatible with nrf52 very soon
https://www.arduino.cc/en/uploads/Main/ARDUINO_PRIMO-V022_SCH.pdf
-
Quantization error on the hwCpuVoltage() function appears to about 14 millivolts, which is a nice little improvement over the atmega328p. Measurement accuracy appears to be well within those bounds.
Next step is to measure voltage on an analog pin using an AnalogRead. Not sure if the reference voltage is Vcc (as it typically is with the atmega328p) or something else for those measurements.
@NeverDie said in nRF5 Bluetooth action!:
Quantization error on the hwCpuVoltage() function appears to about 14 millivolts, which is a nice little improvement over the atmega328p. Measurement accuracy appears to be well within those bounds.
Next step is to measure voltage on an analog pin using an AnalogRead. Not sure if the reference voltage is Vcc (as it typically is with the atmega328p) or something else for those measurements.
Strangely, if I do, say, analogRead(A4) on the nRF52832, all I get back is a 10-bit number, not a 12-bit number. i.e. the number never exceeds 1023. That can't be right. Should I be using a different function call to get the full 12 bits on the nRF52832?
-
@NeverDie said in nRF5 Bluetooth action!:
Quantization error on the hwCpuVoltage() function appears to about 14 millivolts, which is a nice little improvement over the atmega328p. Measurement accuracy appears to be well within those bounds.
Next step is to measure voltage on an analog pin using an AnalogRead. Not sure if the reference voltage is Vcc (as it typically is with the atmega328p) or something else for those measurements.
Strangely, if I do, say, analogRead(A4) on the nRF52832, all I get back is a 10-bit number, not a 12-bit number. i.e. the number never exceeds 1023. That can't be right. Should I be using a different function call to get the full 12 bits on the nRF52832?
-
@NeverDie looks like you need to call analogReadResolution first https://github.com/sandeepmistry/arduino-nRF5/blob/425e719af8d85b543def01e49a6ef4048525dc59/cores/nRF5/wiring_analog.h#L74
@mfalkvidd said in nRF5 Bluetooth action!:
@NeverDie looks like you need to call analogReadResolution first https://github.com/sandeepmistry/arduino-nRF5/blob/425e719af8d85b543def01e49a6ef4048525dc59/cores/nRF5/wiring_analog.h#L74
Thanks! That did the trick. Calling analogReadResolution(12) once in Setup() routine, I now get back a 12-bit number (i.e. up to 4095) thereafter when I do an analogRead(...). :)
-
So, just did the experiment, and here are the results. Supplying 3.3v to the Ebyte Module, a voltage of 3.0 volts on A4 yields an analogRead(A4) of 4095. Less voltage on A4 yields a lower number.
So, generalizing, I suspect that the reference voltage for analogRead() is Vcc-0.3.
So, you either know Vcc, because of a voltage regulator or something, or else you must call hwCpuVoltage() to get what it is. Then, subtract 0.3v from that, and that's the reference voltage which corresponds to an analogRead() return value of 4095.
:)
-
I just did a quick and dirty measurement on the current consumption of the nRF52832 Ebyte module during sleep, and it measured 10 milliamps. I measured it using a uCurrent Gold. That's very high current for most battery powered applications. Can someone else here please measure it also and either confirm or refute?
I invoked sleep with this from the mocksensors sketch:
wait(SLEEP_TIME); //sleep a bitPerhaps there's a way to invoke a deeper sleep than that where less current is drawn?
-
I just did a quick and dirty measurement on the current consumption of the nRF52832 Ebyte module during sleep, and it measured 10 milliamps. I measured it using a uCurrent Gold. That's very high current for most battery powered applications. Can someone else here please measure it also and either confirm or refute?
I invoked sleep with this from the mocksensors sketch:
wait(SLEEP_TIME); //sleep a bitPerhaps there's a way to invoke a deeper sleep than that where less current is drawn?
-
@rmtucker said in nRF5 Bluetooth action!:
sleep(60000); // Sleeps for a minute in deep sleep
Thanks! That's a big improvement. I'm now reading 51uA. I did the measurements on the Ebyte nRF52832 module, powering it at 3.3v.
However, to be frank, that's still rather high compared to, say, an atmega328p with a RFM69 radio, which can have a combined sleep current of less than 1uA.
Is there anything more that can be done to lower the sleep current further?
-
@rmtucker said in nRF5 Bluetooth action!:
sleep(60000); // Sleeps for a minute in deep sleep
Thanks! That's a big improvement. I'm now reading 51uA. I did the measurements on the Ebyte nRF52832 module, powering it at 3.3v.
However, to be frank, that's still rather high compared to, say, an atmega328p with a RFM69 radio, which can have a combined sleep current of less than 1uA.
Is there anything more that can be done to lower the sleep current further?
-
@rmtucker said in nRF5 Bluetooth action!:
Is that a bare board with nothing connected (Not even serial)?
Yes. It's the bare Ebyte nRF52832 module. The only connections are Vcc and GND.
-
@rmtucker said in nRF5 Bluetooth action!:
Is that a bare board with nothing connected (Not even serial)?
Yes. It's the bare Ebyte nRF52832 module. The only connections are Vcc and GND.
-
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
-
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
@NeverDie said in nRF5 Bluetooth action!:
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
Did you use the same board definition in the IDE and the same script ?
-
@NeverDie said in nRF5 Bluetooth action!:
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
Did you use the same board definition in the IDE and the same script ?
@Nca78 said in nRF5 Bluetooth action!:
Did you use the same board definition in the IDE and the same script ?
Yes.
-
@Nca78 said in nRF5 Bluetooth action!:
Did you use the same board definition in the IDE and the same script ?
Yes.
-
@NeverDie
Have you tried sleep and wait for an external interrupt instead of sleep and wake on timer?
Just in case it is the lfxtl that is causing the problem.@rmtucker said in nRF5 Bluetooth action!:
@NeverDie
Have you tried sleep and wait for an external interrupt instead of sleep and wake on timer?
Just in case it is the lfxtl that is causing the problem.Haven't tried that yet. Is there a library functional call for that, or do I need to start addressing the registers directly? With this new mpu, I feel like I'm learning to walk all over again.