drive dc motor with pic 16F877
Hi, I'm a beginner in this forum.
I want to control a 12 Volt DC motor in constant speed. To do it, i will use half of H bridge. As i have two switching element, mosfet, i will have two gate signal. I want to do it by 16F877, know i have to learn that how i could convert an analog input to a digital. I have an potentiometer , i change the resistance and i set an analog value and pic understand it.
The second question. I have to make pwm in constant frequency. Pic take the analog value from its leg (the first analog value for the speed which we set at first ) and there is a feedback system, feedback voltage from tako, pic compares the value comes from tako with we set at first and if neccessary it will change the duty cycle in constant frequency.
Example: we set 100 mV to drive motor in 1400 rpm
I want to get some examples in assemble (16F877) for analog digital converter. And i wanna know to make a pulse in constant frequency.
I look at pic 16F877 datasheet but i think it is hard to solve problem by using datasheet. Some basic example will help me too much. Thanks very much. Please help me...