wire stepper_i0; // your fpga internal signal that you want to go to the "I0" pin of the 3717
wire uc3717_i0_pado; // Output to the IOB pad.
// note the inversion to make up for the inversion done by the open collector scheme
assign uc3717_i0_pado = (stepper_i0 == 1'b1) ? (1'bz) : (1'b0);
Are you really sure you want to use P-fets? Doing the high side stuff yourself with discretes gets to be a hassle real fast. Especially if this is a hobby thing and the objective is to "save money". Because you won't save money by doing that.
Apart from that ... build a sin table (say 8 bits) for the reference voltage, use your favorite way to generate a voltage from this 8-bit value. I used pwm + RC lowpass for that and got about 7-bit accurate voltage, which was good enough. Then use comparators to compare the generated sin/cos with the voltage across your coil current sense resistors. Based on this comparator output you do your pwm for the coil drivers.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?