中文English
In theory, do not add peripherals, you can like said upstairs, 32 IO port connected to 8 motors, if connected to the peripheral, you can and the 2nd floor said the same, connected...

How many two-phase four-wire stepper motors can 89c51 MCU control at most? Need control at the same time?

In theory, do not add peripherals, you can like said upstairs, 32 IO port connected to 8 motors, if connected to the peripheral, you can and the 2nd floor said the same, connected to the earth, because there is a dedicated control of the stepper motor chip, single-chip motor control is very convenient, but this may not realize the meaning of the questioner. We're just talking about not adding peripherals.

However, in addition to the restrictions of the IO port, there are restrictions of the MCU, because the MCU running instructions are executed one by one, there is no concurrency mechanism, so if multiple stepper motors are operated at the same time, if the operation frequency is not high, it can be almost simultaneously (not strictly at the same time, because the instructions are only executed one at a time). Of course, the synchronous operation of two motors is not within the scope of discussion). However, if you connect a more sophisticated stepper motor with high speed and high frequency operation, there may be problems.

In popular terms, you send an instruction to the stepper motor, the motor moves a step, after the motor moves to the next step, the MCU then sends the next instruction, in between the two instructions the MCU can do other things, such as to control another motor. If the motor control is fine, in the most extreme case, the interval between the two instructions is not enough to execute an additional instruction, then the single chip microcomputer can only control a motor. Even the use of interruption is useless, the operation of the first motor will be affected.

So how many motors can be controlled, to refer to the crystal oscillator of your single chip microcomputer, and what kind of control you need for the motor, if the required operation is not too fine, in the first motor two instructions interval can have time to send multiple instructions, then you can increase the number of control motors, this number needs to be seen according to the actual situation.