Trevors said:
Hi Eric,
Yes, I still have the same delays. Don't have any analog pins though. Using a 16F84a, but I have purchased a 16F628a. Going to start using that soon. How would I implement the pot idea?
Txs for those delays Donniedj. I'm sure those will come in handy.
hi Trevors,
Connect a variable resistor say a 5K0, one end of the pot to 0V and the other to the +5V rail, wiper to the analog pin of the PIC.
Use the ADC value as right justified to get 0 thru d'1023,, call the value say Dv.
To get a 'useful' value of Dv and to set the 'minimum' delay value of Dv do this:
Delay= (Dv * multiplier) + shortest delay required.
Assume for explanation that Dv is 0 from the ADC registers.
then Delay = shortest delay time required
Assume that Dv is 1023 from the ADC registers
then Delay = (1023 * multiplier) + shortest delay === Longest delay time.
You will have to determine the values of the 'multipler' and 'shortest delay required' to suit your motor and application.
I would start with values of 'multiplier' = 1 and 'shortest delay' =1000
Once you have determined the max and min value, as the speed pot is adjusted, the ADC output is read and the Delay calculated from this formula and loaded into a 'DELAY' subr.
I hope you can follow this.?