Grand central- pin noise on startup

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
peej22
 
Posts: 2
Joined: Sun May 07, 2023 12:38 am

Grand central- pin noise on startup

Post by peej22 »

Im driving a 4988 stepper driver with the grand central. Using arduino code. My problem seems to be that before i even get to the setup() function the stepper motor moves- taking it out of position. I can use the stepper motor normally after starting up.

Code: Select all

const int dirPin = 25;
const int stepPin = 24;

void setup()
{
	// Declare pins as Outputs
	pinMode(stepPin, OUTPUT);
	pinMode(dirPin, OUTPUT);
}
void loop()
{

}
I can sit there pressing reset over and over again and the motor spins quarter of a turn each time with this blank code. Whats the best way to stop this?

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Grand central- pin noise on startup

Post by mikeysklar »

There are no pull-ups on the SDA/SCL pins. You will want to add your own resistors to reduce noise.
Top Row
SDA - the I2C (Wire) data pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup. This pin is the same as D20
SCL - the I2C (Wire) clock pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup. This pin is the same as D21
Be aware that the Adafruit microcontroller boards do not have I2C pullup resistors built in! All of the Adafruit breakouts do, but if you're building your own board or using a non-Adafruit breakout, you must add 2.2K-10K ohm pullups on both SDA and SCL to the 3.3V
https://learn.adafruit.com/adafruit-gra ... l?view=all

User avatar
peej22
 
Posts: 2
Joined: Sun May 07, 2023 12:38 am

Re: Grand central- pin noise on startup

Post by peej22 »

Thank you Mikey!
I am a bit of a novice so had to do a bit of reading but adding some resistors worked great. Things are far less jittery now.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Grand central- pin noise on startup

Post by mikeysklar »

Cool. This is just one of those scenarios where the pull-ups are not baked in. Glad it worked.

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

Return to “Metro, Metro Express, and Grand Central Boards”