want to make 0 - 20 khz output with pic 16f877a

Status
Not open for further replies.

hitesh19872419

New Member
hi every body i want to make a 0 to 20 khz freqency output to any of the pin which depends on the analog input a0 on pic 16f877a which is 0 to 10v variable
that means
0 - 10v input (at ao) to 0 -20 khz output(any pin in pic 16f877a)
i am trying it with changing the period of the pwm but not able to scale from 0 - 20 khz
any ideas please help
 
hi,
Changing the frequency from 0 to 20kHz is not PWM.
What is the 0 to 20kHz going to be connected too.?
 
hey ericgibbs
i am using the flow code program so on pwm macro there is an option if you want to change the freqency or the period of pwm so thats what i am using and i am going to feed that 0 -20 khz to the stepper drive which will convert this freqency in speed of the motor
-- new idea - i was thinking to feed the output of the volate to freqency covnertor to the stepper drive what you say -
 
Last edited:
PWM is no use for driving a stepper motor. You can drive steppers with a pic but I'm not sure how you would do it with flowcode.

Mike.
 
hi hitesh,
Do you have a simple diagram that you could post, so that we can see the idea's.??
 
analog input a0 on pic 16f877a which is 0 to 10v variable
Analog pin of 16f877a will be damaged by inputs greater than Vcc. You need to divide it before applying it to the PIC.
 
Analog pin of 16f877a will be damaged by inputs greater than Vcc. You need to divide it before applying it to the PIC.

Hi,
If the user has a current limiting resistor [ < 20mA] in series with the analog input pin the PIC's internal clamping diodes will protect it from damage.

I would agree that a 10V to 5V resistive divider is the best option.
 
A series resistor will protect it from damage. But without a divider, the ADC will give the same value for all inputs greater than Vref.
 
A series resistor will protect it from damage. But without a divider, the ADC will give the same value for all inputs greater than Vref.

I know, this is why I have also suggested a 10V to 5V divider, expecting the OPs input to vary from 0V to 10V.
I would agree that a 10V to 5V resistive divider is the best option
.
 
i wanna make a frequency of 0 to 20 khz to any output pin how can i do that in pic any body please that should vary according to the analog input
 
**broken link removed**
hey ericgibbs currently i going on with this concept i am reading input as a integer (o to 1023) and giving output a frequency of 0 to 20 khz comparing with the input
i know how to program in c but ericgibbs i am having problem with timers interrupts can you please help me on that or can you suggest any ebook or material for c and micro controller please some free source beacuse i am not in a condition to afford any one of them now. i am starting programming in ccs compiler and could you and i am a beginner
 
hi hitesh,
I dont use 'C' , I use assembler, but I am sure others will be able to help with the 'C'
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…