Hi to all! I am using the CY8CKIT-049-42xxCY8CKIT-049-42xx PSoC board from Cypress to control two stepper motors. This controller will be replicated a number of times in a modular system. The main design of the circuit schematics in the PSoC Creator 3.3 is shown in the image below:
The stepper controller part needs 4 PWM due the characteristics of the controller. Then I need to set two end-switches for the steppers and two signal LEDs. These are set as shown in the figure above. The I2C connection instead is not yet present.
After an incredible number of tries I continue to be unable to get any signal from the input switches END_STOP_1 and END_STOP_2. To make the things easy I have created a second project excluding all but the switches and the LEDS, attached to this post.
I have tried in several ways the kind of pin input settings with no result at all. The main code uses pin read function as in the code snippet below and the pin driver mode has been set in all the ways (pullup, pull down, resistive, strong etc.) with always the same result. I have the suspect of a macro error that I continue not to see. If someone has an idea welcome
int main() { CyGlobalIntEnable; /* Enable global interrupts. */ for(;;) { STATUS_LED_1_Write(END_STOP_1_ReadDataReg()); STATUS_LED_2_Write(END_STOP_2_ReadDataReg()); CyDelay(500); // STATUS_LED_1_Write(0); // STATUS_LED_2_Write(1); // CyDelay(500); // STATUS_LED_1_Write(1); // STATUS_LED_2_Write(0); // CyDelay(500); } }
For testing if the commented lines are uncommented LEDs blink correctly.
Thanks to all in advance for any suggestion.
Enrico