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

Re: Arduino connection

Post by walterkorner »

Now, I attached the IRQ to 48 and CS to 49, RST left at 4. Of course the sketch is changed accordingly.
And no go.
Do you KNOW where the problem is or how to connect??

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

Re: Arduino connection

Post by walterkorner »

You wrote earlier that IRQ should be attached to one of Megas available interrupt pins, w/o saying which they are.
And now you said practically any pin, and it doesn´t work....
Just give me a useful hint, at least

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

Re: Arduino connection

Post by adafruit_support_bill »

A hardware interrupt pin is necessary if your sketch is using hardware interrupts. The sketch you are using seems to be polling instead, so any pin should work.

The factory reset function is an AT command, it does not appear to be related to the hardware reset pin. If you post some photos showing all of your connections, we can try to spot the problem.

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

Re: Arduino connection

Post by walterkorner »

You already know the sketch. A picture wouldn´t clarify anything.
AT command or not, everything works fine in the Uno - what I need is a translation to Mega.

The pins are set in the config.h

#define BLUEFRUIT_SPI_CS 8//??
#define BLUEFRUIT_SPI_IRQ 7//?? does this need attach.Interrupt ??
#define BLUEFRUIT_SPI_RST 4//??Optional but recommended

#define BLUEFRUIT_SPI_SCK 52//Adafruit
#define BLUEFRUIT_SPI_MISO 50//Adafruit
#define BLUEFRUIT_SPI_MOSI 51//Adafruit

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

Re: Arduino connection

Post by walterkorner »

FYI Mega interrupt pins.

Tried #20 to no avail

Mega, Mega2560, MegaADK 2, 3, 18, 19, 20, 21
(pins 20 & 21 are not available to use for interrupts while they are used for I2C communication)

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

Re: Arduino connection

Post by adafruit_support_bill »

You already know the sketch. A picture wouldn´t clarify anything.
Pictures very often do clarify things. They help us spot problems such as marginal solder connections or ground-loop issues that are not detectable in a simple list of pin to pin connections.

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

Re: Arduino connection

Post by walterkorner »

This is not good - I keep telling you the sketch and the BT work, only when moving the pins to a different Arduino it doesn´t. And the Mega works just fine w/ the sketch where I intend to imply the BT later. I even changed between the two a couple of times w/ the same result. So NO hardware OR software problem!!!!
But I´ll comply, given you provide a helpful answer. And don´t just try to find errors and ask about the connections - they´re OK.
Give me an answer w/ a programming solution. If you can´t then don´t.
Pins are as said earlier
Attachments
20230116_151604.jpg
20230116_151604.jpg (461.97 KiB) Viewed 136 times
20230116_151629.jpg
20230116_151629.jpg (255.49 KiB) Viewed 136 times

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

Re: Arduino connection

Post by adafruit_support_bill »

So NO hardware OR software problem!!!!
It is not clear why you are insisting on a programming solution then.

Keep in mind that the Mega is but one of hundreds of Arduino compatible processor boards. And it is not one that we manufacture, sell or use internally at Adafruit. It is not realistic to expect that we have a documented off-the-shelf solution for every possible combination of hardware components.

Also keep in mind that system integration and debugging - even at this miniscule scale - is by nature an iterative process of questioning, theorizing and testing. When all the common issues are ruled out, you need to start taking a wider view.

I will refer this to someone more familiar with this particular Bluefruit board. But you should be prepared for them to ask more questions.

In the mean-time, please review the "Be Excellent" policy in our terms of service.
https://www.adafruit.com/terms_of_service

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino connection

Post by adafruit_support_carter »

The controller example sketch generally does not need any modifications for use with a Mega. Here's a link to where the controller example sketch code lives for reference:
https://github.com/adafruit/Adafruit_Bl ... controller

The only difference between usage on the UNO and the Mega will be the SPI pins wired to on the Mega itself. As mentioned above, the hardware SPI pins on the Mega are:

Code: Select all

MISO = 50
MOSI = 51
SCK = 52
The other pins are used as simple GPIO and do not need changing. The same pins should work just as well on the UNO and the Mega.

Code: Select all

CS = 8
IRQ = 7
RST = 4
To verify this, I wired an Adafruit Bluefruit LE SPI Friend:
https://www.adafruit.com/product/2633
to a Mega and ran the controller sketch - with no changes to any of the code. It runs as expected:
Screenshot from 2023-01-16 09-35-01.png
Screenshot from 2023-01-16 09-35-01.png (36.7 KiB) Viewed 125 times

Double check your wiring and try the controller sketch again. If it still is not working, check your soldering (even though it worked on an UNO). The one visible pin looks potentially under soldered (arrow). It may also be worth trying different wiring in case there's a bad crimp (circle).
wires.jpg
wires.jpg (17.28 KiB) Viewed 125 times

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

Re: Arduino connection

Post by walterkorner »

Thanks - but having reviewed all solderings and connections I still only get a number of backward question marks, repeatedly. You made no alterations to the sketch?

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino connection

Post by adafruit_support_carter »

Correct - no changes to the sketch.

Double check your baud rate setting in the Arduino Serial Monitor. What you describe sounds like the sort of garbled output you'd see if the sketch / monitor bauds don't match. Should be 115200.

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

Re: Arduino connection

Post by walterkorner »

And so it is....Still no..
Other suggestions?

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Arduino connection

Post by adafruit_support_carter »

Can you repeat the previous success when using the UNO? Use the same wires, etc. Just move the connections back to the UNO and see if it works again as it did before.

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

Re: Arduino connection

Post by walterkorner »

How should GND be wired- common for power supply and Arduino?

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

Re: Arduino connection

Post by walterkorner »

It gets different - now I get the q marks w/ a carriage return

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

Return to “Wireless: WiFi and Bluetooth”