Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 38

Thread: BLE suggestions on Custom Teensy Board

  1. #1

    BLE suggestions on Custom Teensy Board

    Hi!

    I'm coming to the end of my design that's a custom teensy 3.2 reference design with a bunch of other stuff for a specific project, one sub-system i've yet to add is BLE.

    I know there are a bunch of ready to use breakout / all in one boards, but i prefer to have a professional looking board with everything assembled; so i was hoping to get suggestions for 'the' go-to IC that is the easiest to work with (and low power), i have about a cm^2 of area left on my board for the IC and it's required passives (area shown in the pic).

    Any suggestions? I'd imagine i could use the bottom layer for the ant since i have quite a fair bit of free space there.

    Thanks

    Click image for larger version. 

Name:	before ble.jpg 
Views:	407 
Size:	119.1 KB 
ID:	10839
    Last edited by orbitronics; 06-19-2017 at 12:11 AM.

  2. #2
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    256
    I've looked at the Adafruit BlueFruit board that uses a ble chip from Nordic Semiconductor
    Note, there's space needed for the antenna
    I would not mind staying in touch with this thread. I'd like to build a board the does MIDI over BLE.
    There's a specific MIDI standard for it.

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    i am excited about your project and hope you make the boards available.

    I have been using the nordic nrf51822 connected to the Teensy through Serial1 (with hardware handshaking! Very important). I show my hookup. Certain teensy pins can be changed.
    I am using the Adafruit BlueFruit board UART board mentioned above.

    I also have an nrf51 and nrf52 development kit from nordic.
    It works great - however, I did not have success with the SPI version due to software.

    That brings up software. I find BLE to be very complicated with a steep learning curve. I have been able to create custom GATT profiles so I am coming along nicely.

    This nrf51 has an embedded processor that contains what is called the ble stack (which consists of layers of software). The nrf51 also has some programmable pins (not brought out on the Adafruit BlueFruit board UART board.

    Also note that the BBC microbit board contains an nrf51. (http://microbit.org/hardware/) - which means good support.
    Nordic's developer's board is good.

    The name of the game here, as far as I am concerned, is selecting a chip that is WELL SUPPORTED WITH SOFTWARE (like the Teensy itself).

    You might also consider its big brother (nrf52). I find it a bit preliminary in its support.

    Good luck,

    Richard
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	ble friend.jpg 
Views:	188 
Size:	131.1 KB 
ID:	10869  

  4. #4
    Thanks for your tips! I did want an fcc bt ic, but also primarily for this project i need it to output mouse packets; i essentially want a bluetooth version of what's already supported via the mouse library. So i'm dropping the hm11 that i previous picked and will go on a new search.

    i'm eyeing up the bluefruit LE, which is unlikely to be a coincidence to be what the two of you are using. I'm glad you two have posted that!

    You're right about going for something well supported, that's why despite looking unprofessional, i do often look at what's on offer in terms of what's already been used to build modules, at sparkfun and adafruit (brilliant places).

    This is my most up to date board, it's getting busy! The right side will change though as i will as i mentioned update the bt module:

    Click image for larger version. 

Name:	Screenshot 2017-06-23 19.00.31.jpg 
Views:	304 
Size:	148.6 KB 
ID:	10870

    The board will have 2x LEDs, 2x buttons, a bt module hopefully with hid, a DRV2605 driven vibration motor for haptic feedback, RTC, atm some FSLP headers but they're very specific so unlikely useful for others, and basically everything pulled out including all bootloader ICs, all usb pins including usb V bus BEFORE the poly fuse. And a load more filter caps. i may also add an LC circuit on the Vbus (infact i will).

    I'm considering taking the bluefruit design and just adding it to my board, space permitted, but pulling all pins out - what do you guys think of that? I need to know if it will work in my intended project first, if it does then it'll be a great little reference board.

    Thanks for your pic, any reason you must use hardware flow control?

  5. #5
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    I do not know what you are doing with the teensy pins. I see many brought out on the edge yet many are missing.
    I don't know if these are dedicated to your peripherals on this board.
    There are certain pins that are important on the teensy that you should be mindful of - for example, pin 19 (not brought out) is an i2c clock. Some of us use both Teensy i2c clocks (16 and 19).
    Also, there are a number of pins on the bottom of the teensy (24-33). Are you using these?

    It is impossible to find the ideal board. I, for one, am not a big fan of buttons and leds on the board.

    I have bought around 50 Teensy and used them in about 20 different projects.

    I (and that's just me) would have rather seen a bit larger board with some mounting holes. Perhaps the ends of the board could contain two knock off's with mounting holes.

    There are adapter boards, but this just adds to the price and height.

    Also, Teensy 3.2 is excellent and something that you could consider is adding on to the end of the Teensy 3.2 form factor, so that your board could be plugged into one of the existing boards that accept a Teensy 3.2 (pjrc audio, prjc octo, smartmatrix)

    Also, driving light strings is popular and you might consider taking two pins (e.g., 12, 13) and providing optional drivers to kick up the 3.3v to 5v.

    Check out the Nordic website for reference designs. That may help you (as well as the Adafruit design).

    I look forward to seeing your progress.

    Richard

  6. #6
    All pins that are pulled out on the reference board are there, just maybe shuffled to move out the jst headers way. pin 19 is scl0, i use this only for i2c components such as the motor controller. where i could not fit the silkscreen on the top, such as pin 19, i put the silk label on the bottom, as you can see for pin 19 which fyi is the pin just above the positive motor pin!

    All pins even if used are pulled out, basically every single pin that is being used on ALL ics are pulled out, but you can see it's a very dense board and everything's on the top layer, so i may have had to shuffle things around.

    Maybe seeing the bottom will clear this up:

    Click image for larger version. 

Name:	Screenshot 2017-06-23 19.51.31.jpg 
Views:	200 
Size:	104.0 KB 
ID:	10871

    Regarding mounting holes, believe me i tried but there's NO space. It costs a lot just to increase a tiny bit more but, i may just do it if anything, just for 2 mounting holes on the same edge. The buttons and led's obviously don't need to be soldered, and the pins they attach to are still pulled out, so no loss there for you for e.g.

    Those FSLP JST headers take up a lot of space, i may do some reshuffling and add mounting holes to my non project specific board, you may have noticed i'm building this board for a personal project but i primarily want to make this a decent reference board for most used things like motors/bt/buttons when i need to quickly prototype.

    i'm weary about using 12 and 13 for example since they're the spi pins, but i'm not sure if many people use spi. i may just find a different pair of pins and knock it up to 5V.

    Great suggestions btw, i really appreciate the feedback.

    I don't know how i could make this teensy 3.2 compatible in terms of size, if that's what you meant, because the width is wrong (between the two rows) and the pins don't correlate between 3.2 and the 3.2 ref board, though i can reshuffle the pins to match, the spacing is still wrong. What did you mean exactly there?

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Got it. I understand about the extra width.
    I like your ideas.

    SPI is very important and I was thinking along the lines of a solder jumper that would bring 12 and 13 out as is, or through the 3v-5v booster.

    Even one mounting hold is better than having to rely on double stick.

    Also, be careful about the surface mount micro usb's. I have had trouble with some products that have attempted to mount micro usb's that were over oxidized and easy to pull off.

  8. #8
    Was there a particular reason you wanted 12 and 13 to be 5v, because they are on the spi bus, so i would probably add a booster to a different GPIO. Space permitting, i will add a 74AHCT244D to two gpio's based on your suggestion!

    I have added two 2mm (1.2mm annular ring) mounting holes on one edge.

    I had a four hour chat with a phd researcher friend about the best BT HID method to go. There will be a new architecture on this board:

    There'll be a nRF52832 on the board along with the rest of what you saw, it will have it's own ttl/uart ic and usb port, and you can have both teensy side and nrf (programmable via arduino) plugged in and working in parallel at the same time, but only the teensy side will provide power. I will connect the two chips together via UART, Serial1 or 2 on teensy to a SoftwareSerial to the nrf, since it's uart is already connected to the usb side, it might be troublesome hence softwareserial on two seperate GPIOs. I will also connect them via i2c through jumpers. I will also have four nrf Analogue in / GPIOs pulled out. I'll also have the nrfs SPI bus pulled out to TPs on the bottom of the board. This *should* give the teensy built in BLE 4.2 w/ HID packets support. plus like i said, if you want you can do some fancy parallel processing.

  9. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Which pins of teensy to brf?

  10. #10
    Quote Originally Posted by RichardFerraro View Post
    Which pins of teensy to brf?
    what do you mean by BRF?

  11. #11
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Sorry, I was on my cell phone. I mean ble. I was confused when you stated "to a SoftwareSerial to the nrf".

    Richard

  12. #12
    Quote Originally Posted by RichardFerraro View Post
    Sorry, I was on my cell phone. I mean ble. I was confused when you stated "to a SoftwareSerial to the nrf".

    Richard
    No problem!

    Between the teensy and ble module (which is basically the same as a bluefruit feather), the teensy hardware serial port will connect to nrf via uart, but the nrf uart is being occupied by the usb side, so to avoid clashes i've brought the 2nd uart to 2 gpio's, which i'll set up as software serial. i2c through jumpers also connect the two.

  13. #13
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Very interesting. I have only been programming the nrf51 through the development kit board (not the ble friend) and programming the teensy to interact with the nrf51 on the Ble friend. I am about to figure out how to migrate the code to the nrf51 on the Adafruit Ble friend from the nrf51 dk. Are you providing the the uart pins to the usb micro input so that the nrf51 can be programmed? can't you just program it over the air? "Built in over-the-air bootloading capability so we can keep you updated with the hottest new firmware." [Adafruit]

  14. #14
    I've just sent this off, i do intend to get the adafruit bootloader + firmware on the nRF52, one 'risk' is that currently the nRF51 is better supported, but apparently they are trying to get them on a level playing field.

    Click image for larger version. 

Name:	Screenshot 2017-06-26 15.28.03.jpg 
Views:	195 
Size:	165.9 KB 
ID:	10883Click image for larger version. 

Name:	Screenshot 2017-06-26 14.54.44.jpg 
Views:	164 
Size:	123.1 KB 
ID:	10884

  15. #15
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Great. Congrats. As I understand it, Nordic has the nrf52 preview dk kit. I just ordered the actual nrf52 dk. This is very useful as it has an embedded jlink hardware debugger allowing for real debugging.
    There is a connector that you can connect to a nrf52 board (like yours) in order to download code into the external nrf52 board and trouble shoot using the nrf52 dk's jlink hardware debugger. I haven't tried this yet.

    Richard

  16. #16
    Quote Originally Posted by RichardFerraro View Post
    Great. Congrats. As I understand it, Nordic has the nrf52 preview dk kit. I just ordered the actual nrf52 dk. This is very useful as it has an embedded jlink hardware debugger allowing for real debugging.
    There is a connector that you can connect to a nrf52 board (like yours) in order to download code into the external nrf52 board and trouble shoot using the nrf52 dk's jlink hardware debugger. I haven't tried this yet.

    Richard
    Thanks for the feedback, I bought out a small 6 pin jst header on the bottom right (inside another jst header!) for the jtag breakout, as i ran out of space. I will use a segger jlink programmer to upload the bootloader and firmware, providing everything goes well! Let me know how you get on with your nRF52

  17. #17
    Just wondering, how did you get RTS and CTS to work on the teensy?

    I've never used hardware flow control on a teensy, did you just use Serial1.attachRts(pin) Serial1.attachCts(pin)
    Last edited by orbitronics; 06-27-2017 at 02:41 PM.

  18. #18
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Yes, that is all that is required. Care must be taken with respect to the pins you select for CTS on the Teensy 3.2.
    RTS (any pin)
    CTS (18 or 20)

    Also, I have a jlink as well so that will work out great. My jlink has 2 rows of 10-pins each.
    I take it you did not go the route of using the 6-pin needle adapter?
    You indicated that it is inside a jlink header. Can you direct me to a cable that would interface the jlink 2x10 to the 6-pin jst header on your board?

  19. #19
    It's odd, I have the nRF51 (uart friend) connected to a teensy in HID mode, and attaching rts TO PIN 19 stalls the code, no hardware flow control works perfectly fine for me and fast.

    I have one of these for the 10 header

    I have made a breakout too for the tiny jst header

    Click image for larger version. 

Name:	Screenshot 2017-06-29 21.00.23.jpg 
Views:	153 
Size:	76.7 KB 
ID:	10906Click image for larger version. 

Name:	Screenshot 2017-06-29 20.59.13.jpg 
Views:	101 
Size:	69.7 KB 
ID:	10907

  20. #20
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    I purchase the 10 header for the JLink.

    My drawing above shows the friend-rts to teensy cts pin 18
    and the friend-cts to teensy rts pin 19.

    Are you doing this along with the Serial1.attachRts(pin) Serial1.attachCts(pin)?

  21. #21
    Yeah i did that, it didn't work until i removed attachRts

  22. #22
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Checking in.
    Did the board get built?
    Does it work?
    Can I buy some?

    thanks,

    Richard Ferraro

  23. #23
    Quote Originally Posted by RichardFerraro View Post
    Checking in.
    Did the board get built?
    Does it work?
    Can I buy some?

    thanks,

    Richard Ferraro
    Hi,

    Yes, OSHPark messed it up a couple of times so there was a large delay. SoftwareSerial between the NRF52 and main MCU works but currently limited to 9600bps. I made a pull request with adafruits motor driver because i improved it greatly, it now works much nicer and more powerful.

    The NRF52 itself works really well, bootloader works nicely, no need to touch the hardware when you're uploading via serial, and the bluetooth programs for HID works well on everything i've tested so far.

    I have a couple of boards (i think) that i could pass on. Do you have a preference on how you'd want it, i.e., board with BOM, or board with parts, or assembled board?

    Also can i ask, in your opinion, is it worth making a separate post about this incase others might be interested?

    Click image for larger version. 

Name:	2017-10-25 17.46.03.jpg 
Views:	115 
Size:	197.1 KB 
ID:	11889

  24. #24
    Senior Member
    Join Date
    Jan 2014
    Posts
    160
    Looks great.
    Can you address the 9600 baud current state.
    Sending 20 byte ble packets means that several packets may come in close proximity which could be missed due to the 9600 baud.
    In addition, the nrf52 has a powerful dual core processor which could be used in conjunction with the Teensy. This would require a high speed connection between
    the teensy and the nrf52.

    Richard

  25. #25
    I don't think i'll be able to address the 9600 bps limit via SoftwareSerial, but the workaround i currently use is simply connecting a hardware serial bus from the teensy freescale MCU to the hardware serial bus on the nRF52, making sure to disconnect the usb bridge (easily done with a jumper).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •