Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 23rd January 2009, 03:46 PM   #1
Default how to compare to analog signal.... pic184f331

hi friends ,

i want to compare to analog dc signal & want 2 change the duty cycle of PWM according to the error signal... how can i do that??

if someone having C code... plz help me....
chinusneha is offline  
Old 25th January 2009, 05:44 PM   #2
Default

You setup the A/D, run the conversion, get the numbers out of ADRESH & L, scale them with a multiply instruction, offset them them with an add or subtract, then load them into the PWM registers.

Usually. If a linear relationship won't do it, you may have to write a big lookup table. If the whole thing needs to be a PID loop, that's even more fun. Start with the basic linear function, though.
duffy is offline  
Reply

Tags
analog, compare, pic, signal

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Inturrupting Analog Signal Addohm General Electronics Chat 6 6th November 2008 04:23 AM
How to simulate analog signal in MPLAB SIM? jumpjack Micro Controllers 8 7th October 2008 03:04 PM
How to invert an analog signal? toodles Micro Controllers 22 29th July 2007 07:25 AM
Analog to squared signal, need help... Zane83 Electronic Projects Design/Ideas/Reviews 54 18th September 2006 05:54 PM
Analog signal duplication is it possible egg0900 General Electronics Chat 3 16th July 2004 02:52 AM



All times are GMT. The time now is 05:25 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker