Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 11 months ago.
NUCLEO-IHM02A1 : More than one Board
Hallo,
I try to use more than one Stepper Motor Controler Board (3 to be precise). Every single working perfect with individual CS jumpers set by using the standard library from st.
But using the together don't work: Only the first (initialized) Board (2 Motors) works. If I swap the CS definitions again only x_nucleo_ihm02a1_A is working.
Here you see the initalisation on a logic analyzer:
If I change the order of the CS Pins ... again only the 1st board do successful SPI communication:
URGENT HELP appreciated!
parts of HelloWorld (modified)
/* Motor Control Expansion Board. */ XNucleoIHM02A1 *x_nucleo_ihm02a1_A; XNucleoIHM02A1 *x_nucleo_ihm02a1_B; XNucleoIHM02A1 *x_nucleo_ihm02a1_C; DevSPI dev_spi(D11, D12, D3); /* Initializing Motor Control Expansion Board. */ x_nucleo_ihm02a1_A = new XNucleoIHM02A1(&init[0], &init[1], A4, A5, D4, D2, &dev_spi); x_nucleo_ihm02a1_B = new XNucleoIHM02A1(&init[0], &init[1], A4, A5, D4, A2, &dev_spi); x_nucleo_ihm02a1_C = new XNucleoIHM02A1(&init[0], &init[1], A4, A5, D4, D5, &dev_spi); /* Building a list of motor control components. */ L6470 **motors[3]; motors[0] = x_nucleo_ihm02a1_A->get_components(); motors[1] = x_nucleo_ihm02a1_B->get_components(); motors[2] = x_nucleo_ihm02a1_C->get_components(); pcTerminal.printf("Motor Control Application Example for 6 Motors\r\n\n"); int b; int m; while(true) { for (b=0; b<3; ++b) { for (m=0; m<2; ++m) { pcTerminal.printf("Board %d Motor %d Steps %d\r\n",b,m,STEPS_1); motors[b][m]->move(StepperMotor::FWD, STEPS_1); wait(1); } }