Trinket Pro + BLE

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
paulosophy
 
Posts: 90
Joined: Fri Apr 17, 2015 5:40 pm

Trinket Pro + BLE

Post by paulosophy »

I'd like to attach this BLE module to a Trinket Pro 3.3v
https://www.adafruit.com/products/1697

Looking at this further information [1] I note this:
"RDY is the interrupt out from the nRF8001, we'll connect to Digital 2 but be aware that if you want to change it, it must connect to an interrupt capable pin (see this Arduino page for which pins are interrupt-capable. Digital 2 is OK on Uno/Leonardo/Micro/Mega/etc.)"

On the Trinket Pro, digital pin #2 is not made available, since it's used for USB programming. [2]

The list[3] of interrupt-capable pins does not mention the Trinket. Normally I assume it's the same as the Uno, since they're both 328, but since I *know* pin 2 isn't available on the Trinket, I'm not sure how to proceed.

Someone apparently did it, but didn't post any further information:
http://forums.adafruit.com/viewtopic.ph ... et#p354414

My questions:
Since digital pin #2 is unavailable on the Trinket Pro, how could I use BLE, which needs digital pin #2?

I realize Adafruit recommends switching to the new nRF51822 chip[4], but that doesn't look like something I use with a microcontroller...



[1] https://learn.adafruit.com/getting-star ... rything-up
[2] https://learn.adafruit.com/introducing- ... et/pinouts
[3] https://www.arduino.cc/en/Reference/attachInterrupt
[4] https://www.adafruit.com/products/2267

User avatar
hiduino
 
Posts: 862
Joined: Sat Sep 01, 2012 7:05 pm

Re: Trinket Pro + BLE

Post by hiduino »

The other available interrupt pin on the ProTrinket is pin #3.

User avatar
hiduino
 
Posts: 862
Joined: Sat Sep 01, 2012 7:05 pm

Re: Trinket Pro + BLE

Post by hiduino »

Also to note the new Bluefruit LE nRF51822 are these ones,

https://www.adafruit.com/products/2479
https://www.adafruit.com/product/2633

User avatar
paulosophy
 
Posts: 90
Joined: Fri Apr 17, 2015 5:40 pm

Re: Trinket Pro + BLE

Post by paulosophy »

hiduino wrote:The other available interrupt pin on the ProTrinket is pin #3.
Oh! I appreciate the info, but how did you know that?
I examined the pinouts[1] but didn't see anything mentioned.

Also: THANK YOU for the links to the other BLE modules. But where does it say that those modules use the nRF51822 chip? EDIT: I found it. If you look at the schematic[6], the chip is listed. It's just not mentioned anywhere in the product description, nor is the schematic linked to in the product description.

The two that you linked above look like they don't need an external interrupt. Here's the pin descriptions (just taking notes for myself):
BLE UART Friend [2]:
MOD to Pin 12
CTS to Pin 11
TXO to Pin 10
RXI to Pin 9
VIN to 5V
RTS to Pin 8
GND to GND

BLE SPI Friend [3]:
SCK to 13
MISO to 12
MOSI to 11
CS to 8
IRQ to 7
RST (Optional) to 6
VIN to 5v
GND to gnd

It looks like I'll probably go with UART? I have no idea how to choose between SPI and UART. All I need is a very basic TX/RX functionality. The description for SPI mentions something about how if you "prefer serial communication" you should go with UART, but the examples seem to be identical when it comes to using the UART vs SPI modules. So I don't understand the difference. And for both UART and SPI, it looks like I'll need 3 pins[4][5], so it doesn't seem like I have any advantage in terms of saving pins:

Code: Select all

Software Serial
For UNO/Metro/Pro Trinket & other Atmega328's! Three pins are required: RX, TX, and CTS. They can connect to any pins on the Arduino but they must be wired up.
#define BLUEFRUIT_SWUART_RXD_PIN        9    // Required for software serial!
#define BLUEFRUIT_SWUART_TXD_PIN        10   // Required for software serial!
#define BLUEFRUIT_UART_CTS_PIN          11   // Required for software serial!


[1] https://learn.adafruit.com/introducing- ... et/pinouts
[2] https://learn.adafruit.com/introducing- ... end/wiring
[3] https://learn.adafruit.com/introducing- ... out/wiring
[4] https://learn.adafruit.com/introducing- ... nd/bleuart
[5] https://learn.adafruit.com/introducing- ... ut/bleuart
[6] for UART: https://learn.adafruit.com/assets/25147 for SPI: https://learn.adafruit.com/assets/26205

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”