1

I have an SKR PRO control board with a dead (shorted, it's burning hot) main processor. I ordered a new board, it was my mistake.

The voltage regulators work, so I ordered a replacement STM32F407 processor from STM (a free sample actually) and I'll repair the board in my free time.

How can I test all pins of the new board, so that I can ensure the board is working when I'll sell it/when I'll use it for my next project?

I think that programmatically turning on and off each pin would be enough, then I would use an oscilloscope or a LED to verify the result. The pins which have special functions (heater, fan, MOSFET in general) would be tested accordingly, but I still need the pulsating input.

FarO
  • 3,906
  • 13
  • 31

2 Answers2

0

Well I got some problems with a batch of STM32 boards where some work and some don't. I'm trying to figure out the same thing. The initial plan is a simple board with a socket for the micro and some LEDs, hopefully not 64 of them, and put in it a simple firmware that just goes around testing all the GPIOS, but I fear that the test could not be enough.

0scar
  • 32,029
  • 10
  • 59
  • 135
0

A good starting point could be to use one of the two versions of the RAMPS1.4_TestCode.pde testcode, which is linked to by this thread on the RepRapWiki, RAMPS 1.4 test code:

Please note it will switch on and off your heated-bed and extruder hot-end too besides moving all the motors and flashing the leds. Disconnect them if you do not want any heating while testing.

There is a later version, in this post on the same thread, which also checks the individual stepper motor steps:

#define X_STEP_PIN 54
#define X_DIR_PIN 55
#define X_ENABLE_PIN 38
#define X_MIN_PIN 3
#define X_MAX_PIN 2

#define Y_STEP_PIN 60
#define Y_DIR_PIN 61
#define Y_ENABLE_PIN 56
#define Y_MIN_PIN 14
#define Y_MAX_PIN 15

#define Z_STEP_PIN 46
#define Z_DIR_PIN 48
#define Z_ENABLE_PIN 62
#define Z_MIN_PIN 18
#define Z_MAX_PIN 19

#define E_STEP_PIN 26
#define E_DIR_PIN 28
#define E_ENABLE_PIN 24

#define Q_STEP_PIN 36
#define Q_DIR_PIN 34
#define Q_ENABLE_PIN 30

#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13

#define FAN_PIN 9

#define PS_ON_PIN 12
#define KILL_PIN -1

#define HEATER_0_PIN 10
#define HEATER_1_PIN 8
#define TEMP_0_PIN 13 // ANALOG NUMBERING
#define TEMP_1_PIN 14 // ANALOG NUMBERING

void setup() {
  pinMode(FAN_PIN , OUTPUT);
  pinMode(HEATER_0_PIN , OUTPUT);
  pinMode(HEATER_1_PIN , OUTPUT);
  pinMode(LED_PIN , OUTPUT);

  pinMode(X_STEP_PIN , OUTPUT);
  pinMode(X_DIR_PIN , OUTPUT);
  pinMode(X_ENABLE_PIN , OUTPUT);

  pinMode(Y_STEP_PIN , OUTPUT);
  pinMode(Y_DIR_PIN , OUTPUT);
  pinMode(Y_ENABLE_PIN , OUTPUT);

  pinMode(Z_STEP_PIN , OUTPUT);
  pinMode(Z_DIR_PIN , OUTPUT);
  pinMode(Z_ENABLE_PIN , OUTPUT);

  pinMode(E_STEP_PIN , OUTPUT);
  pinMode(E_DIR_PIN , OUTPUT);
  pinMode(E_ENABLE_PIN , OUTPUT);

  pinMode(Q_STEP_PIN , OUTPUT);
  pinMode(Q_DIR_PIN , OUTPUT);
  pinMode(Q_ENABLE_PIN , OUTPUT);

  digitalWrite(X_ENABLE_PIN , LOW);
  digitalWrite(Y_ENABLE_PIN , LOW);
  digitalWrite(Z_ENABLE_PIN , LOW);
  digitalWrite(E_ENABLE_PIN , LOW);
  digitalWrite(Q_ENABLE_PIN , LOW);
}


void loop () {

  // if (millis() %1000 <500)
  // digitalWrite(LED_PIN, HIGH);
  // else
  // digitalWrite(LED_PIN, LOW);

  // if (millis() %1000 <300) {
  // digitalWrite(HEATER_0_PIN, HIGH);
  // digitalWrite(HEATER_1_PIN, LOW);
  // digitalWrite(FAN_PIN, LOW);
  // } else if (millis() %1000 <600) {
  // digitalWrite(HEATER_0_PIN, LOW);
  // digitalWrite(HEATER_1_PIN, HIGH);
  // digitalWrite(FAN_PIN, LOW);
  // } else {
  // digitalWrite(HEATER_0_PIN, LOW);
  // digitalWrite(HEATER_1_PIN, LOW);
  // digitalWrite(FAN_PIN, HIGH);
  // }



  if ( millis() % 60000 < 30000) {
    digitalWrite(X_DIR_PIN , HIGH);
    digitalWrite(Y_DIR_PIN , HIGH);
    digitalWrite(Z_DIR_PIN , HIGH);
    digitalWrite(E_DIR_PIN , HIGH);
    digitalWrite(Q_DIR_PIN , HIGH);
    digitalWrite(HEATER_0_PIN, LOW);
    digitalWrite(FAN_PIN, HIGH);
    digitalWrite(HEATER_1_PIN, LOW);
    digitalWrite(LED_PIN, HIGH);

  }
  else {
    digitalWrite(X_DIR_PIN , LOW);
    digitalWrite(Y_DIR_PIN , LOW);
    digitalWrite(Z_DIR_PIN , LOW);
    digitalWrite(E_DIR_PIN , LOW);
    digitalWrite(Q_DIR_PIN , LOW);
    digitalWrite(HEATER_0_PIN, HIGH);
    digitalWrite(FAN_PIN, LOW);
    digitalWrite(HEATER_1_PIN, HIGH);
    digitalWrite(LED_PIN, LOW);

  }

  digitalWrite(X_STEP_PIN , LOW);
  digitalWrite(Y_STEP_PIN , LOW);
  digitalWrite(Z_STEP_PIN , LOW);
  digitalWrite(E_STEP_PIN , LOW);
  digitalWrite(Q_STEP_PIN , LOW);

  delay (200);

  digitalWrite(X_STEP_PIN , HIGH);
  digitalWrite(Y_STEP_PIN , HIGH);
  digitalWrite(Z_STEP_PIN , HIGH);
  digitalWrite(E_STEP_PIN , HIGH);
  digitalWrite(Q_STEP_PIN , HIGH);

  delay (200);

}

As your board isn't a RAMPS you will probably have to change some of the #defines, to correspond with your board, but that should just be a simple search-and-replace exercise.

Greenonline
  • 5,831
  • 7
  • 30
  • 60