Ok, just to prove that the pulsin idea does work.........(within certain parameters anyways, I know it takes a finite amount of time for an injector to open and close and this amount would have to be accounted for in final calculations, and I also know that fuel rail pressure, system voltage, and injector/fuel temperature also have an effect on open/close times. I never said this method would be 100% accurate, but I'm sure the results can be tweaked thru software to get something fairly accurate.)
Do you have working hardware? In other words, do you have an input wire that could be or is connected directly to a PIC input pin? And if you connected an o'scope to that pin/wire, would the resultant signal on the 'scope follow/match the signal on the wire to the injector?
Without working hardware, further discussion would be fruitless...
So if you're just talking in theory, an idea you have...say so now so I (others?) don't use up too much time on this.
@skimask you are right ,
I work on proteus before ,
Now Im just build circuit on breadboard.
And Im take some shoot.
This is "duty cycle meter" working circuit ,I say before ..
Its working good on bench and my car ..
This is duty cycle shema
![]()
Last edited by MaxiBoost; - 27th December 2006 at 19:28.
PWM generator ,this simple circuit come with duty cycle meter .
Its use for test.
PWM generator shema ,simple 555 pwm generator .
Starting circuit on breadboard,
16F84A ,10mhz osc
![]()
Last edited by MaxiBoost; - 27th December 2006 at 19:29.
Here simple "pulsin" code ,
yes its not finish .Only run for test .
'DEVICE 16F84A
DEFINE OSC 10
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 3
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
TEST1 VAR WORD
PULSIN PORTA.0,1,TEST1
Lcdout $fe, 1,"Puls :" ,#TEST1
PAUSE 200
lcd picture
This is proteus circuit,
![]()
Last edited by MaxiBoost; - 27th December 2006 at 19:38.
whats wrong ?
'DEVICE 16F84A
DEFINE OSC 10
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 3
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
TEST1 VAR WORD 'PULS_LOW
TEST2 VAR WORD 'PULS_HIGH
TEST3 VAR WORD 'ADD TWO RESULT (PULS_LOW+PULS_HIGH)
TEST4 VAR WORD 'MULTIPLY 100 (TEST3 * 100)
TEST5 VAR WORD 'DIVIDE PULS_HIGH
PULSIN PORTA.0,0,TEST1
PULSIN PORTA.0,1,TEST2
TEST3=TEST1+TEST2
TEST4=TEST3 * 100 'WHATS WRONG ??
TEST5=TEST4 /TEST2
LCDOUT $FE,$80,"1:",#TEST1 'puls_low
LCDOUT $FE,$88,"2:",#TEST2 'puls_high
LCDOUT $FE,$C0,"3:",#TEST3 'puls_low + puls_high
LCDOUT $FE,$C8,"4:",#TEST4 '
'LCDOUT $FE,1,"5:",#TEST5
PAUSE 200
![]()
I'm afraid this does not work; after the first pulsin has taken its reading, since the transition has *already* happenned, the next pulsin of the opposite polarity (level?) will take place only at the next-to-next pulse. Of course, if the duty cycle for a sequence is going to stay somewhat the same then this should make no difference. I was trying to decode an IR signal by using these consecutive pulsins, and got completelty wrong results.
Hi,
I am not sure about the fuel injection stuff. Possibly a variable duty and variable frequency. One option may be to use the portb on change interrupt feature. So for every falling or rising edge you get an interrupt. One problem is that depending on the timer prescaler you may run out of time if the frequency is too low causing a timer overflow. Again that can be accounted with ISR checking for timer overflow and incrementing a pseudo timer high byte counter making the timer a 16bit one.
Regards
Sougata
Hi,Sougata,
you're right ...
But the big problem is injectors are nor open 100% of the cycle !!!
a "100%" aperture equals, say, only 20 or 30 degrees at crankshaft ....
and this value has to be entered somewhere to measure something useful.
now, a simple "PULSIN" is enough to measure the ON duration in µs ... but maximal aperture ( vs. rotation speed ? ) has to be known to calculate a displayable percentage.
add to that needles inertia is not negligible at those timings ... and you'll see your measure is somewhat false !!!
Some data is missing here ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks