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

Need help with writing to Charateristics to turn motor on and off

I have a 32u4 Feather but don't get the right support from Adafruit to create my own Profile. I have downloaded Nordic's android app and can see all the characteristics on the board. But I have no clue how to interact with it. All I want is the chip to accept input from a smartphone such as listining to a character for instance "o". If the "o" comes in it should then open up a port to power the motor driver which then powers a small motor. I would need help how to do this. This board has preconfigured stuff on it I never even heard off and don't need. However, I can see from your app that it is possible to write to empty characteristics. Is this what I need to do for my project. Or how do I do this on this BLE device. Or would it be easier to purchase a new BLE device from a differnet vendor? If so, can you recommend one for me? It was real easy previously with the classic bluetooth. Now with BLE its gotten real difficult. Can't do it on my own. Need assistanc please. Thanks, Nick

Parents
  • Hi Jorgen, Thx for the reply. Is this the board you have? Yes, that's the board. And yes it uses the Nordic service and chip. However, I'm not getting any support from them how to write to the chip such as a profile, service or characteristic. That's why I'm trying to get help from Nordic. The link "this page" shows the code format for the board nRF52 DK. It makes sense to me. However, that board nRF52 DK is way too big for my project. But the code is very similar to the one from Arduino. I just thought since the 32u4 has the Nordic chip on it that Nordic would be able help me to write to the server chip since Adafruit doesn't help. I just can't use such a big board. I need a small footprint but no programming on it such as Heartrate, gyro, accellerometer and so forth. Then it has the app with all those features available. I don't need all that. I want something small, that I can put that small code on it for to turn a "PIN on and off". Then I need to be able to write my own app(UI) for it. Just 2 buttons on it. One for "open" and one for "close". That's all I want. There is got to be a way to find help from you guys with that or finding such a small board. Thanks, Nick

Reply
  • Hi Jorgen, Thx for the reply. Is this the board you have? Yes, that's the board. And yes it uses the Nordic service and chip. However, I'm not getting any support from them how to write to the chip such as a profile, service or characteristic. That's why I'm trying to get help from Nordic. The link "this page" shows the code format for the board nRF52 DK. It makes sense to me. However, that board nRF52 DK is way too big for my project. But the code is very similar to the one from Arduino. I just thought since the 32u4 has the Nordic chip on it that Nordic would be able help me to write to the server chip since Adafruit doesn't help. I just can't use such a big board. I need a small footprint but no programming on it such as Heartrate, gyro, accellerometer and so forth. Then it has the app with all those features available. I don't need all that. I want something small, that I can put that small code on it for to turn a "PIN on and off". Then I need to be able to write my own app(UI) for it. Just 2 buttons on it. One for "open" and one for "close". That's all I want. There is got to be a way to find help from you guys with that or finding such a small board. Thanks, Nick

Children
  • The link I gave you in the comment above has small board 17x23mm and breakout board and examples code doing exactly what you wanted, even iOS code for that.

  • The "problem" you have with your board is that you are not supposed to write Nordic code and flash to the BLE device. The nRF51 chip inside the BLE module is flashed with some custom firmware, that talks to the ATmega chip via SPI interface, making the nRF51 chip more of a connectivity IC than a system-on-chip. Looking at the schematics, the SWD interface of the nRF chips is exposed on the board, allowing you to change the firmware of the BLE module. However, not many pins of the nRF51 chip is exposed on the boards, so you will be limited in GPIOs. By connecting an external debugger to the SWD interface, you should be able to flash applications created by using the nRF5x SDK to the chip.

    If you fint the nRF52 DK too large for your project, we have a long list of 3rd party module parteners, and there are also others creating development and breakout boards with our nRF5x chips.

  • I've looked at the other dev boards. I found this one nRF52832 System on Chip and Amber SPP-over-BLE profile. The one from Nguyen Hoan Hoang I can't find in Germany. But my question to all this is this: How do I program the chip? Previous chips I was able to use the Arduino IDE which uses .h and .ino files. The code itself I think is in "C" if I'm not mistaken. Can I use the same Arduino IDE to program the Nordic chips? Or do I have to learn something new again? Furthermore: this chip, nRF52832 System on Chip and Amber SPP-over-BLE profile: can I use it for my project? Program it to open up 2 logic PIN's to power a motor driver? What's a good driver for this board? Currently I'm using this one DRV 8835 from Pololu. Would that work for this board as well? Or is this board also come with preprogramming for Characteristics/Services? And its own UI? Remember, I want my own UI. This is what I want: click on the app icon-it should open the app and autoscan for peripheral-when found only connect if the ble mac address is the correct one-once connected it should have only 2 buttons on the UI to open 2 logic pins that's it for now. Questions: Can I program this chip like mentioned above? Can I use the Arduino IDE to program it? if not what do I need? Can I use the Pololu driver? Or do you have another one for me? Or should I rather use this board: nRF51 Dongle for my project? On this website: [http://www.allaboutcircuits.com/projects/how-to-communicate-with-a-custom-ble-using-an-android-app/] you can see the UI on the device and the code for it. Please have a look and tell me if I can use this code for to program those to devices: nRF51 Dongle, nRF52832 Oh, and how do I program this chip: nRF52832? I don't see a usb connection on it to connect it to the PC? While on the dongle I think I can connect it to the PC to program it, right? Thank you so much for helping, Nick

  • In general, you can flash all nRF51 and nRF52 devices through the SWD interface, as I linked above. You need a programmer/debugger supporting the SWD interface to program the chip. We support Segger J-Link Debuggers. On the datasheet of the module you linked above, the SWDCLK and SWDIO pins is found on pin 3 and 4. We have very limited support for Arduino, but you can use any of our supported IDEs (Keil, GCC or IAR), as described in the getting started section of our SDK documentation.

    The Amber module seems to support two options, their own custom firmware, or firmware created by our SDK.

    As far as I can see, the driver you use are using PWM to control the motors. You should be able to setup this using the information I linked in my original answer. You can create your app like described in your link. You just need to use the UUID of the Nordic UART service (NUS), as described on this page.

  • You can also use the nRF51 dongle. This includes a debugger, and you can plug it directly into your computer for programming.

Related