nRF51822 ? #5297
Replies: 1 comment
-
Posted at 2014-06-05 by @gfwilliams At one point I had been chatting to the RFduino guys, and I think mbed has a board that uses it too. Basically: yes, I'd be pretty sure it will work. Actually getting Espruino running should be pretty easy, and while you're a bit limited with 16kB, you can still do an awful lot. However the issue is support for I2c/SPI/PWM/Serial/Timers - that's something that's taken me a huge amount of time with Espruino/STM32, and is basically something that will need re-writing if you move away from STM32. A few things to watch out for, from what I've gathered about it:
Posted at 2014-06-05 by Alex Hi guys, I'm actually planning on integrating a NRF51422 with the espruino. The NRF chips can be programmed to be communicated with using serial. From this I'd imagine every UART should be able to talk to these chips. The downside is that you'd have to program your NRF51x22 to handle your serial commands and do something with them. All the heavylifting can be done on the NRF chip, you create your own API and send it instructions with your espruino. This should be equally possible for both the NRF51822 and NRF51422 since they're basically the same except for and ANT license. Regards, Alex EDIT: sorry I completely misread your topic. Nevermind :). Posted at 2014-06-17 by tom.gidden @alex: yeah, slight digression, but I've considered putting an NRF51822 on an Espruino too. Thing is, the HM-10 Bluetooth Low Energy thing is a pig to deal with: it's all through undocumented (or rapidly shifting documents, at best) AT commands and can't do custom characteristics worth a damn. So, basically it's an iBeacon, and that's about it. On the other hand, the NRF51822 is a lovely little chip, but needs to be programmed in C. Even a fairly simple thing is a chore to do. It also has I/O limitations that aren't surprising considering the size/cost. So, I was thinking of using the Espruino as the master, and an NRF51822 flashed with a fairly simple program so it can act as a more-capable BLE dongle. The project I'm toying with right now requires a board with a much smaller footprint than the Espruino, but I'd far prefer to be uploading .js files rather than .hex. Posted at 2014-06-20 by Alex I just received 10 HM-10's for a different project to use with espruinos... Are they that bad? Damn.. I figured they'd be up and running rather quickly. Did you manage to flash the 51822 with the espruino firmware and still use the BLE? Regards, Alex Posted at 2014-06-20 by tom.gidden It might just be that I'm missing something. I've got about five HM-10's still in their bags for the same reason. If you do manage to get the HM-10 doing more than basic iBeacon-type advertising, please do write it up. I'm sure it's possible to get it acting somewhat like an HC-05 as far as the serial port's concerned, but I didn't have much luck there either. I was specifically wanting proper service/characteristic BLE functionality (for constructing, say, a heart-rate monitor), which neither the HM-10 or the RFduino seem to do very well. The 51822 is far more capable, but it's a much bigger job as you're writing a proper application with no Arduino/Espruino-like abstractions. Getting the NRF51822 to run Espruino code directly is well outside my capabilities, to be honest. Instead, I'm looking at using the 51822 as a peripheral for just doing the BLE work, while the Espruino board does the proper intelligent stuff. Posted at 2014-07-03 by Alex Hi Tom, I've been playing with the HM-10's and they're kind of working. Is there anything in particular you'd like a write-up on? I'm not exactly sure what you mean by "proper service/characteristic BLE functionality", if you could expand upon this maybe I could help out. Regards, Alex Posted at 2014-07-03 by tom.gidden Hi Alex, Well, both HM-10 (and RFduino, incidentally) seem to be well set-up to do iBeacon functionality. However, if you actually want to use BLE for something more useful (such as a sensor, like a heart rate monitor, temperature reporting, etc.) then you need to be able to construct services, characteristics, and so forth. I can't see any documented way of doing this with HM-10, at least consistently. The furthest the datasheet goes is about major and minor numbers, which are part of the iBeacon functionality. ...unless I'm missing something. Put simply, with an HM-10, how would you configure it to advertise a sensor service and equip a smartphone app to connect and collect that sensor data? I can't see any way to do that with the HM-10, and it seems to be the primary use-case for BLE (not, as many think, the iBeacon capability) Any insights you have would be appreciated. (I'm still knee-deep in the NRF51822 SDK, which is a major chore: rather than being undocumented and possibly impossible like the HM-10, it's definitely possible, but even a basic sensor app is hundreds of lines of code for all the advertising, asynchronous connection/disconnection handling, service delivery, etc.) Tom Posted at 2014-07-03 by Alex Hi Tom, You can use the AT commands to configure them as you like I believe. I was lucky enough that the manufacturers site was online yesterday and I got the latest datasheet. Since that site is offline now, I've reposted it on one of my websites http://avalondesigns.nl/dropbox/files/bluetooth40_en.pdf You can have them as central or advertiser and you can set the advertising interval. Is that helpful? Here is some code I used to set it up:
I have pin 23 on constant 3.3v with the 470k resistor and pin 24 rewired to A14 to use the LED2 of the espruino. Regards, Alex Posted at 2014-07-03 by tom.gidden Hi Alex, I think that's just in relation to Bluetooth Classic, isn't it? For BLE operation, I think the HM-10 only offers a single preset service and characteristic, along with preset support for internal temperature and possibly battery. I spent a few hours going through that datasheet and having a go, but other than rudimentary read and write of the single characteristic, I couldn't build anything more complicated (such as a set of multi-value characteristics within a single service, each with their own authorisation thingies) I'm not surprised, to be honest, as the actual API for doing BLE on either the Nordic or TI chips is complex... I can't see how it would be sensibly mapped to a simplistic serial profile like the AT command set. Tom Posted at 2014-07-04 by @gfwilliams I saw some example code yesterday for BLE on the 51822 using mbed. It looked pretty nice - maybe they've managed to simplify the API a bit. It could be worth a try? Posted at 2014-07-31 by user47006 Hello Gordon, I'm also very interested if espruino could run on the nrf51822 even with a simplify API. thx Posted at 2014-08-01 by @gfwilliams Thanks - yes, it'd be cool. Espruino is all open source, and is about as easy as possible to port to new platforms - so anyone is welcome to pick it up and try to port it. Unfortunately real life gets in the way for me - I don't have much free time, and it'd be suicide to spend time porting to a platform that would then effectively cut off my only source of income :( Posted at 2014-08-01 by user47006 Gordon you did a terrific job with espruino. Now it's up to somebody to do roll the sleeves and work. I imagine when you started thinking about Espruino and decided to do it, you evaluated in some way if smt32 would be able to do the job done (like flash size, speed, RAM etc) and once you evaluated and concluded that the chances of being successful with the given resources then you started your work. I would like to try to port it but I have some questions #2) RAM: You rightly mention about the 16Kb limiting and possible less as they have their library for the BLE (they call it softdevice). what do you think it's the minimum ram needed for a simplify API? #3) Stages: I was thinking that to start this I would go port first the basic things and later I2c/SPI/PWM/Serial/Timers. Do you think any gotchas doing in that way? Thx again for your time. Posted at 2014-08-01 by @gfwilliams
Posted at 2016-04-15 by vshymanskyy I see now that Micro:bit is available, maybe we can also flash it to another boards like RedBearLab BLE, or Seeed BLE micro. Posted at 2016-04-18 by @gfwilliams Yes, it would work - you'll have to build it yourself with your own Posted at 2016-04-19 by vshymanskyy Thanks, RedBearLab BLE Nano works after minor modifications of the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-05 by tom.gidden
Hey,
What's the chance of getting Espruino running on nRF51822? It's a tiny ARM Cortex-M0 with 256kB flash, 16kB RAM, and most importantly, built-in Bluetooth LE. Found in Estimote, RFduino, most iBeacon things, and also a lot of fingernail-sized boards on eBay for £5'ish.
I'm a newbie when it comes to hardware-level stuff, so I have no idea how practical this would be, but I expect it would fall on this spectrum:
My guess is probably Point (1).
Anyway, I figured it was worth asking, as it's a nice little thing but I'd far prefer to be programming it with Espruino than messing about with gcc-arm-none-eabi and a Segger!
Tom
Beta Was this translation helpful? Give feedback.
All reactions