You need a high value series resistor at the input, eg. 100K or so - the points could have pulses of hundreds of volts...That D9 input is supposed to be 5 V tolerant, but I guess it can't tolerate 6-7.5 V at unlimited current.
Like, how small? I think the smallest I have on hand is 10 nF. 100K x 10 nF gives a time constant of 1 ms. I'm looking at 20-200 Hz, I think. 3.3v digital input; logic high would be 2v. If I'm switching 6v, I guess I'll get to 2v in half a millisecond, so 200 Hz is no problem, right?a small filter cap to ground at the MCU side.
Ah, I think I get it now:Almost; not zeners, just schottky diodes to the MCU 0V and positive supplies, to limit the voltage to that range.
Wow, you weren't kidding:...
The HT coil and distributer "condenser" form a resonant circuit that rings at rather extreme levels when the points open.
...
Like this?OK; I think the extreme voltage is messing up the filter effect, as the "cutoff" is a proportional reduction of the input.
Add a second series resistor (47K?), after the clamp diodes but before the filter capacitor.
If the response is then too slow, try reducing the input resistor that feeds the clamp to 47K.
Makes sense.With the input to the second resistor & cap filter limited to 3.3V, it should work much better.
I don't think I have any option for that. The timer/counter has a digital filter:Also, is the pin you are using on the MCU set as a schmitt trigger? That would reduce any side effects or spurious triggers from the slow ramp that appears in the waveform.
where I am using 1111 and f DTS is 500,000 Hz (the counter frequency) at the moment. Looking this up, I see that I can divide that by 2, 4, or 8 (without affecting the counter frequency), which might help.Input capture 1 filter
This bit-field defines the frequency used to sample TI1 input and the length of the digital filter applied
to TI1. The digital filter is made of an event counter in which N consecutive events are needed to
validate a transition on the output:
0000: No filter, sampling is done at f DTS
0001: f SAMPLING =f CK_INT , N=2
0010: f SAMPLING =f CK_INT , N=4
0011: f SAMPLING =f CK_INT , N=8
0100: f SAMPLING =f DTS /2, N=6
0101: f SAMPLING =f DTS /2, N=8
0110: f SAMPLING =f DTS /4, N=6
0111: f SAMPLING =f DTS /4, N=8
1000: f SAMPLING =f DTS /8, N=6
1001: f SAMPLING =f DTS /8, N=8
1010: f SAMPLING =f DTS /16, N=5
1011: f SAMPLING =f DTS /16, N=6
1100: f SAMPLING =f DTS /16, N=8
1101: f SAMPLING =f DTS /32, N=5
1110: f SAMPLING =f DTS /32, N=6
1111: f SAMPLING =f DTS /32, N=8
Exactly like that.Like this?
I calculated the same. I thought about doubling it to 1 ms, but that could be a little marginal at high RPM, since it is not a 50% duty cycle but depends on the dwell angle of the points. [I never had a good way to measure the dwell; it's hard to find good tools for 6V systems these days. I just set the gap and left it at that. But now I can measure the dwell very accurately!] I might give it a quick try anyway, since it only takes a few minutes to update the firmware. With the unit still mounted in the car I can use my laptop to flash it over USB.Exactly like that.
OK on the digital filter, that's fine, better than a schmitt trigger!
With the settings you have, and if I'm understanding it correctly, the input has to be stable for 512uS (2uS * 32 * 8) for the level to be recognised, which I think should be OK.
I did look at the grounds. The ground at the SD card is about 40 mV above the battery ground, but looked fairly clean (from a quick look). At the moment, there is only a single wire connecting ground to the controller board (I think it is 18 gauge), and there is only one pin from the ground plane in the controller board to the SD card board (now soldered on both ends). I will have to look at the SD ground - MCU ground. The MCU is socketed, but it does have two ground pins and both go to copper pours at GND on both the top and bottom layers of the controller board.Are you getting any voltage on the SD ground/0V compared to the MCU ground? If the top board is connected to the power circuit ground at more than one point, it could be voltage drop in the power wiring being transferred through and messing things up.
If the ground is clean, try a combination of capacitors, one at least ten times the other.
(I don't have time just now to go back through the thread and work out the interconnections etc.)
Thanks!Either a choke, low value resistor or both to isolate the B+ from the regulator input should help.
Also a large, eg. 10uF, multilayer ceramic across the input to the regulators, as well as 0.1uF ceramics across each regulator output.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?