andre@ditechnology.com wrote: > I have question that I am kind of stuck. friend of mine asked me to > make small board for his vw bug that has 1 input and 1 output. the > input takes pulse (4 pulse is 1 cycle) the frequency goes from hz to > khz at this > moment is unknown so the pic reads the pulse and output changes on > time only ( in this case called dwell control) but the frequency > input vs > output is same. Is english your first language? Where are you located? Your web site gives no hint of location. The runon sentences make it difficult to decipher what you are trying to do. You want to pass a pulse train from input to output, except that the pulses need to be delayed by some previously known fixed amount? > attachment image is I am reading the pulse and the > output is same at this moment since things do not work for me at list > I outputted the same thing. There was no image attached, only a .c file. > does any > one feel like doing this project I prefer to use CCS C compiler if > you do not have it you can barrow mine until its done or if you guys > can give some direction I can continue working on it. Try to break up separate points into separate sentences. The above contains one question and three separate points. That's too many. > so far what I did is > I used pic capture input to capture how fast it runs that's using ccp > interrupt then in main loop i am trying to output same pulse but to be > able to change on time this is where I am not doing it right. More runon. This is getting annoying. Also remember to start each sentence with a upper case letter. That's a simple rule anyone can follow, whether familiar with english or not. Why do you need a CCP module just to receive the pulses? Do you also need to measure the pulse width? Is the whole pulse to be delayed with width intact, or just the leading edge, or something else? How the dealay is done depends on how long and accurate it must be, and whether you must be able to receive a new pulse before outputting the previous one. My first knee jerk reaction is to do the output delay in the interrupt routine, assuming you can ignore new pulses until sending out the previous one. The nature of that delay timing will depend a lot on the delay time and accuracy requirements. It could be a few inline instructions, to a timer, to letting the foreground code handle it. If outputting delayed versions of pulses is all the PIC is doing, then perhaps everything can be done in the foreground routine, or you can use the pulse input as a external GOTO 4 input. You need to give us real specs. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist