This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to make nrf51822 central to transmit the status of a pin ?

I have: nrf51822 bluetooth module, STlink V2, Keil, segger studio, nrf51 sdk and softdevice files.

I have achieved making the led blink at a ble peripheral device by nordic connect app via this link https://www.youtube.com/watch?v=_-d2d6Vc3lg&list=WL&index=96.

I want to make a ble master from which I can connect to the peripheral  and send the status of a button to the peripheral. (Its like when I poweron, the master search for the peripheral and connects to it and send the status of one of its pin).

Can you please guide me how to do that.

Parents
  • Hello,

    Maybe you have seen it already, but we do have the Experimental: BLE Blinky Client Application Example that seems to do exactly what you are asking.

    Best regards,

    Vidar

  • Thanks a lot. I just read it. It seems this is the one I am looking for and will experiment this and let you know. 

    Two more things I'd like to know

    a) I am using nrf51822 softdevice and it seems in the SDK12, the project is by default for nrf51422. So just by changing target option device to nrf51822AA will be sufficient or do I need to change things in memory addresses.

    b) instead of J-link, if I use ST linkV2 will that be ok ??

    I started off with a youtube video and it did with arduino library for peripheral and ST link so I purchased those only.  But I didn't find any tutorial on how to make a ble central (so something like bluetooth remote.) It seems everyone is busy in making peripheral and controlling with phone.

    I'll run this and will update by tomorrow.

    Regards,

  • Hi,

    You should keep the default ROM and RAM settings. The softdevice is distributed as precompiled and linked binary, and thus not affected by the linker settings used in your project.

  • thank you.

    Load "..\\..\\..\\..\\..\\..\\components\\softdevice\\s130\\hex\\s130_nrf51_2.0.1_softdevice.hex"
    Internal command error
    Error: Flash Download failed  -  Target DLL has been cancelled
    Flash Load finished at 20:07:36

    I am able to load the hex file without softdevice. But not able to load the softdevice.hex.

    I tried saving the softdevice.hex  (which I downloaded separately) in the particular folder (read somewhere that it is bec sometimes the hex files becomes windows script file). I tried the settings in the  target.. but still can't resolve it.

    Also the same error if I try Erase under Flash tab.

  • Please check if the debugger settings are the same as the ones you use to program the application FW. Or are you not able to load the app FW either?

  • I am able to load he hex file of blinky project without any problem. but when I try to load the softdevice hex then it shows that error. (But if I am trying to flash softdevice using arduino then it is flashing but not with keil as I am getting the error above).

    Also what I did is, flashed the softdevice through Arduino IDE, and then flashed the softdevice and application using keil and its flashing. But if I try to flash the softdevice directly through keil, it is throwing the error mentioned above.

  • I am able to run the peripheral code, and I can see the peripheral in the nordic_connect app. When I start the central, the peripheral goes off the screen (I think bec master is connected to it now and that is why no its not coming in app scan.)

    But there is not led glowing when I press the button at either side.

    Is there any code change needed in the Central part ?? Or I need to connect some extra resistors at the button (in the code the button is already internal pulled_up)? Can I connect the button directly to ground and VCC (3.3V) or connect a resistor in between?

Reply
  • I am able to run the peripheral code, and I can see the peripheral in the nordic_connect app. When I start the central, the peripheral goes off the screen (I think bec master is connected to it now and that is why no its not coming in app scan.)

    But there is not led glowing when I press the button at either side.

    Is there any code change needed in the Central part ?? Or I need to connect some extra resistors at the button (in the code the button is already internal pulled_up)? Can I connect the button directly to ground and VCC (3.3V) or connect a resistor in between?

Children
Related