Arduino connection

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Arduino connection

Post by walterkorner »

Hardware Bluefruit LE SPI Friend (4119)?
FW 06.2
OS W10
Arduino Uno R3/ Mega 2560

Problems:
Trying to set up the controller sketch (from BluefruitLE nRF51) I use the recommended (below) pinouts for Arduino Uno, and it works fine, so no hardware or software problem.
But, since I need more pins than the Uno provides, I try to transfer this to the Mega, which only gives
me the "Couldn't factory reset". So, what would be the preferred settings w/ the Mega in this case?

I only need the BT to perform controller commands.

/*PINS
4 RST
7 IRQ
8 CS
11 MOSI
12 MISO
13 SCK
*/

Rgds
Walter Körner

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino connection

Post by adafruit_support_bill »

On a Mega, the SPI pins are in different locations:
MISO = 50
MOSI = 51
SCK = 52

And IRQ should connect to one of the available interrupt pins on the Mega:
https://arduinogetstarted.com/reference/attachinterrupt

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

Screenshot_20230115_150915_Bluefruit Connect.jpg
Screenshot_20230115_150915_Bluefruit Connect.jpg (381.67 KiB) Viewed 145 times

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

Thanks - consider including it in your tutorial.
But, why is it connected to pin7 in your Uno sketch then?
It´s not a standard pin and I don´t see a different attach command?

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino connection

Post by adafruit_support_bill »

Please post a link to the example sketch you are using. It is possible that the sketch does not utilize the interrupt.

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »


User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

Disconnecting the interrupt doesn´t help

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino connection

Post by adafruit_support_bill »

The link you posted requires a login.

Our tutorial for the board does cover pin configuration here:
https://learn.adafruit.com/introducing- ... ed-2177150

And SPI specifically further down the page: https://learn.adafruit.com/introducing- ... ns-2177160

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

Hi - I was, of course, referring to settings for the Mega
20230115_174928.jpg
20230115_174928.jpg (438.03 KiB) Viewed 136 times

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

I mean the "controller" sketch, as said before.
The IRQ is requred in the Uno sketch

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino connection

Post by adafruit_support_bill »

The IRQ pin does get used. But it appears that it is polled for SPI communication, so it does not need to be a hardware interrupt pin.

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

And what does that mean, exactly, for the sketch and wiring?
PLS tell

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino connection

Post by adafruit_support_bill »

It means that the IRQ pin specified for the IRQ in your sketch should match the one actually connected.

The pin is polled to determine if there is any data to read. Left unconnected, the pin will 'float' and the value at any given time is unpredictable. Random noise on the pin may give the appearance of working normally.

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

So we´re back tp my original question - the problem is that, since it doesn´t work w/ pin 4, can I use any other pin then? As long as the setting is correct? Or which pins are preferred?

User avatar
walterkorner
 
Posts: 28
Joined: Sun Jul 05, 2020 9:17 am

Re: Arduino connection

Post by walterkorner »

Sorry pin 7 in previous post

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

Return to “Wireless: WiFi and Bluetooth”