nRF5 action!
-
First nrf51822 module arrived already.
It's really small, here between an nrf24 SMD and the cdebyte 52832.
Soldering quality looks better than the pictures on AliExpress.

-
So, I guess the way the code would read is:
- First check if the reset registers are already properly set.
- If so, then just move on to whatever is next.
If not, then properly set the reset registers and invoke the system reset.
Apparently a system reset doesn't change the values in the reset registers.
Of course, none of this would be needed if the reset enable from the tools menu worked, so I'd still prefer to do it that way if at all possible.
As I indicated earlier, the pin mapping on Rx and Tx did work using @d00616 new technique, so hurray for that. That much was an important victory in itself that's worth celebrating. :)
@NeverDie said in nRF5 Bluetooth action!:
Apparently a system reset doesn't change the values in the reset registers.
The "Reset" menu was from my first approach creating user manageable boards for arduino-nrf5. I haven' tested it. With the reset menu I set the "-DCONFIG_GPIO_AS_PINRESET" option. This option should be processed in "cores/nRF5/SDK/components/toolchain/system_nrf52.c". If not the SystemInit() function is not processed in the startup code. This is a problem handling the chip errata. I have not time to check this at the moment.
Here is a PR which want to enable reset as default: https://github.com/sandeepmistry/arduino-nRF5/pull/91
-
Maybe the reset pin problem is hardware related? I say that because if I program the Ebyte module as a Nordic nRF52832 DK board, it still has the same issue. In contrast, the reset button on the actual nRF52832 DK board does work as expected.
-
I've confirmed that connecting P0.21 to GND and then removing it again on the Nordic nRF52832 DK does act as a reset. So, at the moment I have no idea why doing so on the Ebyte nRF52832 that's been programmed to think it's an Nordic nRF52832 DK doesn't do the same. There must be some hardware difference, right?
-
I've confirmed that on both the Ebyte Module and on the Nordic nRF52832 DK, there is continuity between the P0.21 pin on the chip and the P0.21 pin on the board pinout. So, there must be some other factor that accounts for the difference.
-
Making no headway on the reset topic, so for now I'm going to punt and move on to other things.
-
Success! I received some of these modules:
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.search0104.3.10.osbQHP&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10307_10082_10081_10110_10178_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10310_10312_10059_100031_10099_10078_10079_10103_10073_10102_10120_10052_10053_10142_10107_10050_10051-10120,searchweb201603_2,ppcSwitch_5&btsid=b9a0c3cb-cc2a-4254-b24f-94136c73def6&algo_expid=2a71f70b-4929-43a5-887a-2f7263250568-1&algo_pvid=2a71f70b-4929-43a5-887a-2f7263250568
which I immediately programmed using the nRF52832 DK. This time, there was no need to first mass erase. Furthermore, this time P0.21 does indeed reset the module after it is pulled to ground and then released.So, from this I conclude there must be something peculiar to the Ebyte modules which prevents their resetting using P0.21.
It's nice to have different modules to compare amongst. :)
-
Success! I received some of these modules:
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.search0104.3.10.osbQHP&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_10130_10084_10083_10119_10080_10307_10082_10081_10110_10178_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10310_10312_10059_100031_10099_10078_10079_10103_10073_10102_10120_10052_10053_10142_10107_10050_10051-10120,searchweb201603_2,ppcSwitch_5&btsid=b9a0c3cb-cc2a-4254-b24f-94136c73def6&algo_expid=2a71f70b-4929-43a5-887a-2f7263250568-1&algo_pvid=2a71f70b-4929-43a5-887a-2f7263250568
which I immediately programmed using the nRF52832 DK. This time, there was no need to first mass erase. Furthermore, this time P0.21 does indeed reset the module after it is pulled to ground and then released.So, from this I conclude there must be something peculiar to the Ebyte modules which prevents their resetting using P0.21.
It's nice to have different modules to compare amongst. :)
-
First nrf51822 module arrived already.
It's really small, here between an nrf24 SMD and the cdebyte 52832.
Soldering quality looks better than the pictures on AliExpress.

Note sure how this fits into the comparative size of things, but it looks interesting:
https://www.aliexpress.com/item/NRF52832-Module-Core-Board-Wireless-Bluetooth-Transceiver-Module-Transparent-Transmission-Code-NRF51822-Migration-Guide/32797905798.html?spm=a2g0s.13010208.99999999.280.9VhQow -
Anyone have a good sketch for measuring the battery supplied voltage on an nRF52? Some of the concepts from the old atmega328p may apply, but the specifics are going to be different, I'm sure.
-
Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.
@Mike_Lemo said in nRF5 Bluetooth action!:
Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.
I'm not finding it. Do you have a link?
-
@Mike_Lemo said in nRF5 Bluetooth action!:
Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.
I'm not finding it. Do you have a link?
-
@Mike_Lemo said in nRF5 Bluetooth action!:
Check on adafruits feather reference they use two resistors as a voltage divider for that simple and effective.
I'm not finding it. Do you have a link?
-
If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
But I've only looked at the theory yet.Rules are Vdd+0.3V max at the pin, and max 2.4V as input of ADC (after prescaling)
-
Well, as you all know, on the atmega328p you can read the 1.1v gap voltage using the battery voltage as the reference voltage, by doing analogRead(A0), and from just that one measurement then calculate the battery voltage by doing a little bit of math. So, I'm just wondering what the code is to do the equivalent of that (using 1.2v instead of 1.1v) on the nRF52832.
-
If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
But I've only looked at the theory yet.Rules are Vdd+0.3V max at the pin, and max 2.4V as input of ADC (after prescaling)
@Nca78 said in nRF5 Bluetooth action!:
If supplied with less than 3.6V you can do it with ADC, 1.2V voltage reference and 1/3 prescaling.
But I've only looked at the theory yet.For this, you can use the implemented hwCPUVoltage() function. Reading the voltage costs nRF51: 260µA/20µs | nRF52: 700µA/3µs
-
@d00616 said in nRF5 Bluetooth action!:
hwCPUVoltage()
I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.
-
@d00616 said in nRF5 Bluetooth action!:
hwCPUVoltage()
I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.
LOL. Well, Visual Micro found it alright, but just in the wrong place. It found it in MyHwAVR.cpp
-
@d00616 said in nRF5 Bluetooth action!:
hwCPUVoltage()
I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.
@NeverDie said in nRF5 Bluetooth action!:
@d00616 said in nRF5 Bluetooth action!:
hwCPUVoltage()
I'm finally installing Visual Micro, because I hope it will help me quickly find where all these functions are defined. With all these new layers, the Arduino IDE is just no longer cutting it.
good choice :+1:
for nrf5, the function is located in MyHwNRF5.cpp