![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
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.... | |
| |
| | #2 |
|
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. | |
| |
|
| 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 |