Re: need a pic basic program
And how much will you pay the first person who does this work for you?
Re: need a pic basic program
I think you've explained it quite clearly.
First, you need to go to the Microchip site and download the datasheet for the specific chip you're using. Read through it noting what registers if any need to be set for the chip to work.
I'd then recommend you search this forum for simple programs to blink and LED on pin b.1 to ensure you're communicating with the chip.
Then, search this forum for PWM, Pulse Width Modulation, and use those posts to write your own code.
Once that's done post your code and your schematic along with chip number, PBP version and most everyone here will help you to "fix" your errors.
I look forward to hearing from you.
Re: need a pic basic program
Quote:
Originally Posted by
AvionicsMaster1
I think you've explained it quite clearly.
First, you need to go to the Microchip site and download the datasheet for the specific chip you're using. Read through it noting what registers if any need to be set for the chip to work.
I'd then recommend you search this forum for simple programs to blink and LED on pin b.1 to ensure you're communicating with the chip.
Then, search this forum for PWM, Pulse Width Modulation, and use those posts to write your own code.
Once that's done post your code and your schematic along with chip number, PBP version and most everyone here will help you to "fix" your errors.
I look forward to hearing from you.
Isn't it funny how people seem to think we all having NOTHING to do of our own, but are just waiting to create their 'dream device' for them for nothing. Heck, I have enough problems creating my own, let alone someone else's!
Re: need a pic basic program
Just out of curiosity, can't this be done using discrete chips alone?
Quote:
if input increases then output volt which is 5 volt dc should decrease with 1:1 relation but reverse order
I've only dabbled with gates, transistors and amplifiers; but can't they do this very well?
Robert
Re: need a pic basic program
Absolutely, Robert. But that would not be the point of the school project, would it?
Re: need a pic basic program
everyone assumes the input is a pwm stream ,if so what frequency . what if the input is actually an analog level ?
ditto for the output. there not enough info in this question
Re: need a pic basic program
well i am a student and cant pay anything ,i have to build a project as assighnment ,i have to build a triac and microchip based voltage stablizer, i have a transformer with 0-150-250 volts loops and a triac drives the 150 loop of transformer ,an optocoupler drives the triac ,its input is 0 to 1 volt dc which will be controlled by pic 16f72 outputpin and another inputpin of 16f72 which is attached with transformer's 250 loop which is also a output of stablizer voltage ,it ia attached through a optocoupler ,when voltage will vary from 150 to 250 then microcontroller and triac will adjust is to 220 volt ,I have done all work with electronics circuit the only missing thing is a programm , the only thing i know is how to blink a led with microcontroller , can someone tell me how to use pwm to build my project ,thanks in advance
Re: need a pic basic program
simple pwm is not what you want for a triac regulator , search this forum for light dimmer projects , one of them should give you some ideas
Re: need a pic basic program
Phase control with feedback has several hardware/software functions that must work together.
I break down each function to its own operation and write the program so each function can be tested separately.... then the main program brings the functions together.
For Phase control you may need.....
-zero cross detector circuit and software (requires interrupts by microprocessor)
-Triac drive function ckt/routine , pulsed or timed pulse for inductive loads (inductive loads can 'bounce triac off at wrong time if gate not held on)
- voltage feedback ckt/routines.....takes some smoothing hardware to get reasonable DC level from the AC voltage.
- a main program loop to combine all the functions, control/on/off, adjust parameters, check and handle errors etc.
Breaking projects down to testable individual parts has been the easiest method to make working stuff for me.
don
Re: need a pic basic program
Sounds like you need to find a late model Chevrolet throttle position sensor and call it a day!
So...
i don't know if this is the case (I'm actually a lil curious...) Is 5v output as PWM a straight % based on dutycycle? For instance...
5v output @ 50% dutycycle = 2.5v?
cuz if so then set
HPWM dutycycle = ((5-ADCIN0)/5)*255
and ur straight....
Subtract INPUT from 5 to get the inverse
Divide by 5 to get the percentage output you want
multiply the % by 255 because dutycycle is set 0-255
of course, if 50% dutycycle <> 50% voltage, I just wasted the last 7 minutes of my life...