nRF5 action!
-
@Mike_Lemo could you be slightly more specific than "doesn't work"?
@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo could you be slightly more specific than "doesn't work"?
apparently it doesn't recognize it says tone wasn't declared in this scope
That's how the line looks tone(BUZZER_PIN, BUZZER_TONE);
BUZZER_PIN = 26
BUZZER_TONE = 3000 -
@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo could you be slightly more specific than "doesn't work"?
apparently it doesn't recognize it says tone wasn't declared in this scope
That's how the line looks tone(BUZZER_PIN, BUZZER_TONE);
BUZZER_PIN = 26
BUZZER_TONE = 3000@Mike_Lemo if you mean the stuff described at https://www.arduino.cc/en/Reference/Tone it's because it only supports the following mcus:
ATmega8
ATmega168/328
ATmega1280 -
@Mike_Lemo if you mean the stuff described at https://www.arduino.cc/en/Reference/Tone it's because it only supports the following mcus:
ATmega8
ATmega168/328
ATmega1280@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo if you mean the stuff described at https://www.arduino.cc/en/Reference/Tone it's because it only supports the following mcus:
ATmega8
ATmega168/328
ATmega1280How is it possible to make it copatible with the NRF52?
-
@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo if you mean the stuff described at https://www.arduino.cc/en/Reference/Tone it's because it only supports the following mcus:
ATmega8
ATmega168/328
ATmega1280How is it possible to make it copatible with the NRF52?
-
@Mike_Lemo it (the tone library) would need to be ported
@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo it would need to be ported
No idea what you are talking about.
-
@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo it would need to be ported
No idea what you are talking about.
-
I think I have a better hypothesis as to what's going on in my situation: the ebyte module is getting hung-up trying to establish communication with the serial gateway. Looking at the output of the serial gateway, it looks as though it is receiving packets from the Ebyte module. However, looking at the Ebyte output, it thinks it is failing. So, the Ebyte never quite gets out of the "establish communication link" mode.
This doesn't occur, though, if I use an nRF52 DK, instead of an Ebyte module.
So, what might explain this is maybe the MISO pin on the Ebyte module isn't mapped right.
@d00616 Would you please share the pin mappings and board type that you are using for your ebyte module? Since you are having success, I think that will fix the problem.
@NeverDie said in nRF5 Bluetooth action!:
I think I have a better hypothesis as to what's going on in my situation: the ebyte module is getting hung-up trying to establish communication with the serial gateway. Looking at the output of the serial gateway, it looks as though it is receiving packets from the Ebyte module. However, looking at the Ebyte output, it thinks it is failing. So, the Ebyte never quite gets out of the "establish communication link" mode.
This doesn't occur, though, if I use an nRF52 DK, instead of an Ebyte module.
So, what might explain this is maybe the MISO pin on the Ebyte module isn't mapped right.
@d00616 Would you please share the pin mappings and board type that you are using for your ebyte module? Since you are having success, I think that will fix the problem.
Some further evidence in support of this hypothesis (from: https://github.com/mysensors/ArduinoHwNRF5):
Most components, like UART, SPI, Wire Bus, of the nRF5 series chips don't have a fixed pin mapping.
-
@mfalkvidd said in nRF5 Bluetooth action!:
@Mike_Lemo look it up? https://en.wikipedia.org/wiki/Software_portability#Effort_to_port_source_code
Well apperantly this function uses a PWM pin at 50% duty but the frequency varies according to the functiong user parameter now I just know how to active a PWM pin at 50% duty but not how to acces the NRF52 registers to change the frequency of the PWM.
I don't realy know how to access the registers you see at the product's PDF and the other process.
-
@NeverDie said in nRF5 Bluetooth action!:
I think I have a better hypothesis as to what's going on in my situation: the ebyte module is getting hung-up trying to establish communication with the serial gateway. Looking at the output of the serial gateway, it looks as though it is receiving packets from the Ebyte module. However, looking at the Ebyte output, it thinks it is failing. So, the Ebyte never quite gets out of the "establish communication link" mode.
This doesn't occur, though, if I use an nRF52 DK, instead of an Ebyte module.
So, what might explain this is maybe the MISO pin on the Ebyte module isn't mapped right.
@d00616 Would you please share the pin mappings and board type that you are using for your ebyte module? Since you are having success, I think that will fix the problem.
Some further evidence in support of this hypothesis (from: https://github.com/mysensors/ArduinoHwNRF5):
Most components, like UART, SPI, Wire Bus, of the nRF5 series chips don't have a fixed pin mapping.
Does the nRF52 mcu communicate with its radio using SPI, or some other bus? Or are all the radio registers simply memory mapped?
@NeverDie said in nRF5 Bluetooth action!:
Some further evidence in support of this hypothesis (from: https://github.com/mysensors/ArduinoHwNRF5):
Most components, like UART, SPI, Wire Bus, of the nRF5 series chips don't have a fixed pin mapping.
Well, if the mcu uses SPI to communicate with the radio, then I simply need to define which SPI "pins" those are. Attached is the pin mapping file that I used to successfully map the pins for Rx and Tx.
0_1501606355303_MyNRF5Board.cpp -
@NeverDie if I'm not wrong you managed to connect the Ebyte module to your MySensors network, no ?
I did it anyway and it received data.
Radio is internally connected inside the nrf52 chip so I don't see how a module could have a different mapping ? -
@NeverDie if I'm not wrong you managed to connect the Ebyte module to your MySensors network, no ?
I did it anyway and it received data.
Radio is internally connected inside the nrf52 chip so I don't see how a module could have a different mapping ?@Nca78 said in nRF5 Bluetooth action!:
Radio is internally connected inside the nrf52 chip so I don't see how a module could have a different mapping ?
Yeah, that's what I thought originally, and it probably is true. I'm just grasping at straws to understand why the "board" type seems to be affecting the radio communications. I'm also completely new to the mysensors way of handling radio, so that's getting in my way. I'm might have to try something more barebones before I can make sense of this.
-
Some Nordic guidance might help.
Building Bluetooth-Connected IoT Wireless Sensor Prototypes with Minimal Effort
-
I've confirmed it now. Even if I comment out all apparent radio message sends, the mere act of including:
#include <MySensors.h>results in a loss of control by the sketch itself to something within MySensors that wants to establish communication between the node and the gateway. Not even sure how that is happening. In any case, it is just overcomplicating the debugging, and I really don't want that right now because it is effectively hanging what I'm trying to do. :angry:
For now, all I want is a simple send packet--like either the mirf or the twh20 libraries have for the nRF24L01--with no complicating factors. Is that too much to ask? I can probably find that somewhere within the library, but how do I turn-off this loop that it's in where it's repetitively trying to establish the initial communication with the serial gateway?
-
@d00616 said in nRF5 Bluetooth action!:
I have tried the hwCPUVoltage() function with an Ebyte and an RedBear module. Both modules are reporting the voltage.
That's good news. There must be something wrong with how I'm doing it. Which board type are you using for the Ebyte module?
@NeverDie said in nRF5 Bluetooth action!:
That's good news. There must be something wrong with how I'm doing it. Which board type are you using for the Ebyte module?
I have the equal module like yours.
@NeverDie said in nRF5 Bluetooth action!:
@d00616 Would you please share the pin mappings and board type that you are using for your ebyte module? Since you are having success, I think that will fix the problem.
The module is connected to SWDIO/CLK, VCC and the GND near the radio. I don't remember which pin I used for Serial TX.
@NeverDie said in nRF5 Bluetooth action!:
Does the nRF52 mcu communicate with its radio using SPI, or some other bus? Or are all the radio registers simply memory mapped?
The registers are memory mapped, the data transferred with "EasyDMA" into the memory.
@NeverDie said in nRF5 Bluetooth action!:
I've confirmed it now. Even if I comment out all apparent radio message sends, the mere act of including: '#include <MySensors.h>' results in a loss of control by the sketch itself to something within MySensors that wants to establish communication between the node and the gateway.
The SecurityPersonalizer defines '#define MY_CORE_ONLY' before including 'MySensors.h'. In theory, you can use the radio functions defined in 'hal/transport/MyTransportHAL.h' directly. I had no luck with this, but I haven't invested time to debug this.
-
From what I understand the NRF52832 has some kind of enforcer that allows different serial hardwares to be assigned to different pins
Now using the arduino IDE I want to use the I2C pins that are assigned hardwarely to different pins here is the situation
I have one PCB that has SCL connected to pin 20 and SDA to 21
and another PCB that has SCL connected to pin 11 and SDA to pin 12
I want to define the enforcer for the pins within their dedicated sketches without running around to the internal arduino files and change the pin assignment for each upload to each board.
How'd I do that? I assume you'd have to do some thing like that in the upper side of the personal code.
#define SDL...(Something else I don't know ) 11
#define SDA...(Something else I don't know ) 12@Mike_Lemo said in nRF5 Bluetooth action!:
I want to define the enforcer for the pins within their dedicated sketches without running around to the internal arduino files and change the pin assignment for each upload to each board.
How'd I do that? I assume you'd have to do some thing like that in the upper side of the personal code.
#define SDL...(Something else I don't know ) 11
#define SDA...(Something else I don't know ) 12You have to install the "MySensors nRF5 Boards" package. In the examples section for this package, you can find two files (MyNRF5Board.h + MyNRF5Board.cpp). Add these files to your sketch and compile it using "MyNRF5Board nRF52822" as you board.
@Mike_Lemo said in nRF5 Bluetooth action!:
Well apperantly this function uses a PWM pin at 50% duty but the frequency varies according to the functiong user parameter now I just know how to active a PWM pin at 50% duty but not how to acces the NRF52 registers to change the frequency of the PWM.
The registers are documented in the Infocenter and the bitfields.
I don't realy know how to access the registers you see at the product's PDF and the other process.
To access the registers, you have to add '#include <nrf.h>' to your code. Mostly the hardware is accesses by NRF_HWNAME->REGISTER
Doing PWM is a little bit complex. The code is different for nRF51 and nRF52. Look into wiring_analog_nRF51.c and (wiring_analog_nRF51.c)[https://github.com/sandeepmistry/arduino-nRF5/blob/c98a190eb34c0247eb8e0764a6367c7f9e51d2fc/cores/nRF5/wiring_analog_nRF52.c#L214]
If you clone this code, for nRF52 you have to use another timer, like TIMER2, because you can't define the interrupt routine twice.
-
So I'm trying to program the S4AT modules and I have the ugly message
** Programming Started ** auto erase enabled Info : nRF51822-QFAA(build code: H0) 256kB Flash Error: Cannot erase protected sector at 0x0 Error: failed erasing sectors 0 to 13 embedded:startup.tcl:454: Error: ** Programming Failed **I tried to use JLink programs but it says it cannot connect to the module, so I cannot unlock (ends with timeout message) and I cannot erase (fails with -1 return value)...
Does that mean I have to go the long hard way with a bluepill as programmer and openocd ? Anyone has other ideas to unlock and erase the device ? -
So I'm trying to program the S4AT modules and I have the ugly message
** Programming Started ** auto erase enabled Info : nRF51822-QFAA(build code: H0) 256kB Flash Error: Cannot erase protected sector at 0x0 Error: failed erasing sectors 0 to 13 embedded:startup.tcl:454: Error: ** Programming Failed **I tried to use JLink programs but it says it cannot connect to the module, so I cannot unlock (ends with timeout message) and I cannot erase (fails with -1 return value)...
Does that mean I have to go the long hard way with a bluepill as programmer and openocd ? Anyone has other ideas to unlock and erase the device ?@Nca78 said in nRF5 Bluetooth action!:
Does that mean I have to go the long hard way with a bluepill as programmer and openocd ? Anyone has other ideas to unlock and erase the device ?
Select in to Tools menu "None" Softdevice and then "Burn Bootloader". This raises an error but the device is erased completely.
-
@Nca78 said in nRF5 Bluetooth action!:
Does that mean I have to go the long hard way with a bluepill as programmer and openocd ? Anyone has other ideas to unlock and erase the device ?
Select in to Tools menu "None" Softdevice and then "Burn Bootloader". This raises an error but the device is erased completely.
@d00616 said in nRF5 Bluetooth action!:
Select in to Tools menu "None" Softdevice and then "Burn Bootloader". This raises an error but the device is erased completely.
Thank you it works ! :heart: :heart: :heart:
That's probably when trying to use this function that I managed to unlock&erase the EByte module "by mistake" :)The only problem now is the range seems to be very bad :(
Less than 10m with just a brick wall and it fails to completely send the presentation messages.
EBytes nrf52832 module works well in the same conditions, same for their nrf24 modules.[Edit] in fact not that bad, it works ok when changing the orientation of the module. Could be due to the funky wiring but my bet is it on the tiny antenna design. My gateway is an old through hole nrf24 clone so range should not be a problem in an appartment with a PA/LNA gateway.