thunderbug1 / Spherebot-Host-GUI

Qt based GUI to control the spherebot
54 stars 60 forks source link

Pin out confirmation and verification #4

Closed connerk closed 10 years ago

connerk commented 10 years ago

Having found no electronics schematic for the Thunderbug1 Spherebot build, I built the circuit as seen here: http://tinyurl.com/m4nj8vn

Then I noticed the pin definitions listed in config.h to be far different.

define YAXIS_DIR_PIN 14

define YAXIS_STEP_PIN 15

define YAXIS_ENABLE_PIN 21

define YAXIS_MS1_PIN 19 //don´t make this connection!! ADC6 and ADC7 cannot be used as a digital pin ( I made the pull up connection manually)

define YAXIS_MS2_PIN 28

//#define YAXIS_MS3_PIN 18

define YAXIS_ENDSTOP_PIN -1 //13

define XAXIS_DIR_PIN 10

define XAXIS_STEP_PIN 8

define XAXIS_ENABLE_PIN 2

define XAXIS_MS1_PIN 3

define XAXIS_MS2_PIN 4

define XAXIS_ENDSTOP_PIN -1 // <0 0> No Endstop!

define SERVO_PIN 13

Though moving the connections to the correct pins on the Arduino is simple enough, I note that Arduino Uno has only 13 digital pins and many defined above are above that.

I noticed no comment in the commit history about these changes so wanted to verify what I'm seeing.

Was the most recent commit setup with a Mega? Should I re-define these to what is defined in the link above?

Thank you!

thunderbug1 commented 10 years ago

You found none because I´ve never made a schematic. I just soldered everything together on a protoboard, but it´s not very complex. Just connect your power supply lines correctly and then connect the pins of the stepper drivers with the matching arduino pins.

My strategy was to firstly make all the needed connections and then tell the arduino in software where all the pins are connected to. (Because of that I also made the mistake to connect the MS1 signal to a pin which can´t be used as a digital out, but you can hardwire the MS- pins to either high or low depending on what step-size you want)

I used an arduino nano and yes, the pinout can be a little bit confusing. http://jkblog.azurewebsites.net/wp-content/uploads/2013/04/nano.png It took a little bit of trial and error to get it right

When you´re done with your Mega-build you could upload a config.h for the mega version to help the others a little bit ;)

connerk commented 10 years ago

After posting this I changed the pin defs back to what the original schematic demonstrates and it worked fine.

I'm actually building with a Uno now but want to switch to a nano after Easter. I tried to upload to a nano before solving issue #3. no sense in using a mega!

Thanks for the nano pinout link.

I'll tinker with config a bit to aid variable setups (uno, nano) and submit a pull request.