I want to know why do I have to interface stepper motor with FPGA? and how? what kind of IC that i use to do that? Please make ur answer simple and if you can provide something that can help like data sheets that will be really appreciated.
I think there is some writing mistake... Anyways..
Checkout this document..... for details.
Well to drive a stepper motor your FPGA code should able to generate specific sequence on four pins of FPGA which will further connected to bases of darlington pair transistor to drive the stepper motor coil.
see this ULN2800 IC details.
that was really helpful guys. I done with the microcontroller part I think. the microcontroller should get 2 inputs, one to move the motor left one step and the other is to move it right one step. does anyone know which ports am I using to get the signal to the microcontroller from the FPGA spartan 3E
If you want to use the standard way that is used from all the cnc software applications
then you should use one pin for direction control (for example 0 clockw1se/ 1 counterclockwise)
and a second pin that moves the motor one step when it receives a pulse.
You say that you have programmed the mcu and now you want to interface to the FPGA,
why would you use both when you can do it with only one device, either the mcu or FPGA.
One reason I can think is to use the mcu for communication and the fpga for things that need faster and more reliable timings.
But mainly I don't really see why you would need both either. The fpga I understand, better control over your timings. But if you have the fpga, then why use an mcu? Do you have a CAN bus or something?
Also, are you going to use pwm to control motor current? Or just a small motor that you can drive with a darlington for each phase?
well at the beginning I was just reading about controlling the motor with FPGA( the motor is 12v 3.6 deg for the step) but I was just reading how to do that and found that I need a mcu to interface. If anyone does know how to control it with FPGA only that will be good. I just went that way as I thought its the only way to get that done.If any one can give me ideas that will be appreciated.
You can use a state machine or if/elseif which checks the value of a counter and use only the fpga to provide the steps according to the input pins (dir, step)
You can store the output steps in a constant array and then use it to output the correct value, this is an example for a bipolar motor using full step
Code VHDL - [expand]
1
2
3
4
5
6
7
8
type INIT_ROM_TYPE isarray(0to3)ofstd_logic_vector(3downto0);constant step_array : INIT_ROM_TYPE :=( b"1010", -- ++
b"1001", -- +-
b"0101", -- --
b"0110");-- -+ -- then in the part of the code where you assign the values use
output<= step_array(current_step);-- increase or decrease the current_step to turn the motor in different direction
if you are using a bipolar motor and H bridge then you must turn everything off for a few µs and then switch on the opposite transistors/mosfets to avoid any short-circuit in the bridge.
If you have a unipolar and there is no bridge there is no such problem and no delay is needed.