Dec-23-2023, 05:37 PM
hello,
I am working on writing a program for a stepper motor with a driver (pulse/dir).
this is done with acc and decc.
in the part with the constant speed I create the pulses for the driver with a for loop.
but I need to be able to jump out of that for loop, with 2 conditions.
1 - I release the push button (touch screen)
2 - the limit switch has been reached (extended I/O board).
the first comes in via UART (touchscreen).
and the second comes in with I2C (extended I/O board).
now I do that with "polling" the UART and the I2C.
but this slows down the "loop".
Now this can be solved by using interrupts for the UART and the I2C.
but I had read somewhere that there was no interrupt for the UART. and I don't know if there is an interrupt for the I2C?
Does anyone here know how I can best solve this problem ?
thank you.
I am working on writing a program for a stepper motor with a driver (pulse/dir).
this is done with acc and decc.
in the part with the constant speed I create the pulses for the driver with a for loop.
but I need to be able to jump out of that for loop, with 2 conditions.
1 - I release the push button (touch screen)
2 - the limit switch has been reached (extended I/O board).
the first comes in via UART (touchscreen).
and the second comes in with I2C (extended I/O board).
now I do that with "polling" the UART and the I2C.
but this slows down the "loop".
Now this can be solved by using interrupts for the UART and the I2C.
but I had read somewhere that there was no interrupt for the UART. and I don't know if there is an interrupt for the I2C?
Does anyone here know how I can best solve this problem ?
thank you.