Last firmware available:
PIC 16F1827 : Firmware ACCDI v7.9 r24 c0
PIC 16F628A is EOL: Last version was ACCDI v7.9 r20 c2
Owners of previous paid version, please contact me. Sorry there is no free upgrade from 16F628 to 16F1827.
- Adaptable to other single-cylinder bikes.
- Accuracy (0.15°/8000RPM).
- Advance curve is in EEPROM and can be freely modified
- 100 to 30.000 RPM
- Optional rev-limiter
- Need a working charging coil for the capacitor.
- Need a 6 or 12v battery
- Firmware for PIC16F1827 16MHz (or PIC16F628A 4MHz)
- PCB can use both 16F1827 or 16F628A
|PIC 16F628A / 16F1827||files|
|Make the PCB:||PCB Layout|
|or Buy the PCB:||SHOP|
|Build the CDI:||Schematic|
|Draw the advance timing curve:||Excel file for 16F1827|
|Excel file for 16F628A|
|Burn the PIC:||Firmware|
(Source code is not available.)
Free and Full Firmware are in the SHOP section.
Add the free firmware to your basket then go to pay ZERO euro.
Click on “View basket” or on the “basket icon” on the upper-right > Click on “Checkout” > Fill in the “Billing form” > you are not charged, it’s FREE >Click “Place order” > You will receive immediately a link to download the firmware and a email with this link.
WHAT DO YOU NEED?
HOW DOES IT WORK?Click here for more info
In the following I describe how this CDI works on a XT600 which have 2 pickup at 12° and 36°BTDC but it works too with others values or with only one pickup.
If the bike has only one pickup, connect it to the 36° input and leave the 12° input unconnected.
In case of 2 pickup, the SCR receives the pulse from the 12° pickup to directly trigger the SCR via D8 R7 C9.
The PIC only receives the pulses from the 36° pickup.
Of course the PIC cannot jump in time to ADVANCE the spark, it can only DELAY it.
That’s why the pickup signal used is set at the maximum advance (Here: 36 deg. before TDC)
At idle and low RPM, the PIC generates maximum delay (about 36°) before fire a spark a few degrees ahead of TDC.
The spark fired by the PIC comes a few degrees AFTER the spark triggered directly by the SCR at 12° BTDC.
So that the 12° pickup is the one to fire the engine and the PIC triggered spark does nothing since it comes a few degrees later.
That way, there is no or little advance from TDC at low RPM.
As the RPM increases, the more the advance would increase ahead of TDC accordingly. (Delay is inversely proportional to engine speed.)
At a point where the timing curve passes 12° the PIC takes over from the 12° pickup and because it fires sooner, it is the one to fire the engine so when the 12° pickup triggers the SCR it does nothing.
As the PIC takes over it follows the ignition timing curve programmed in EEPROM.
Thus the more the speed increases the more the delay is reduced, advancing the spark. At high speed there is no delay, thus give the maximum 36 degree advance.
Pickup signal must be > 2 volts in order to be detected by the PIC
A 0.5ms pulse, delayed according to the Eeprom values (the timing curve), is available at pin 1 and trigger the SCR T1 via D4,R7,C9.
This pulse is manually adjustable from 0.5ms until 5ms or can adjust itself automatically: (from 5ms at idle shorten to 0.5ms at max rev.)
HOW TO PROGRAM THE CDI?
2 or 4 strokes, 1 or 2 cylinders…?
See: CDI compatibility
PICKUPClick here for more info
A pickup (aka: VR, Variable Reluctor, Reluctor) is a sensor that have a signal wires and a ground wire.
It’s made of a coil of wire wrapped around a magnet. When a ferrous part passes by the magnet, the magnetic field is modified and a voltage pulse is created in the coil generating a sine wave.
– 1 input for inductive pickup with 1 signal per crank rev.
– Pickup must puts out 3 to 30Vac
– Points, reluctors, Hall sensor, optical sensors can be used as long as they give only 1 pulse per revolution.
– This CDI is NOT compatible with multi-pulses pickup or missing tooth wheel.
How to calculate the Pickup Position?
Check the polarity of the pickup (NP: Negative then Positive or the opposite PN) with a Needle galvanometer (in milliAmp position) while kicking or better: Use your laptop as an oscilloscope with this cheap interface. 😉
For a better understanding, this video can help.
Compatibility with others pickups.
CDI v7 can be triggered either by a positive-first pickup signal or a negative-first signal.
My cdi ONLY detect the positive going edge of the trigger pulse, if the positive wave is the second one like Honda or Suzuki, the timing will be bad…
In one word: The FIRST wave MUST be POSITIVE.
If your pickup gives out a NEGATIVE first pulse, there are 2 workarounds:
1) Invert the 2 wires that come from the pickup to the CDI if none of them are internally connected to GND
2) OR use Q1 and Q2 transistors to reverse the first negative signal so it becomes positive.
According to YOUR pickup signal, just use and sold the appropriate components:
For positive-first pickup signal (PN)
Remove: Q1, Q2, R10, R11.
Add : D5, D9, R9.
For negative-first pickup signal (NP)
Remove: D5, D9, R9.
Add : Q1, Q2, R10, R11.
Yellow: pickup signal
Red: PIC input
HALL EFFECT SENSOR
Most often, Hall sensor output are default HIGH, going LOW when a magnet pass in front of them.
To use an Hall sensor with ACCDIv79 or DCCDIv79 we need to invert the signal with one NPN transistor:
- Error in degree of advance:
TachometerClick here for more info
[TP1]: A tachometer output is available at pin11.
The tacho output is a +5v level and 5% Duty Cycle signal.
For tachometers that need a +12v level at 50% DC signal an external processor IC3 is available here:
Duty Cycle Converter
(Needs Q3 + R13 + R14)
LEDsClick here for more info
– At startup, Led D3 flashes 3 or 4 times and goes OFF meaning that programming was correct.
(if it doesn’t flash, something went wrong with the PIC or the power line or the programming…)
– FreeTrial After 50 startups there is no more trial left and LED blinks continually. CDI won’t start.
– When PIC input pin10 is high [must be >2.4v], led D3 (pin2) brights.
So at each input pulse received from the pickup, LED D3 blinks in phase.
– If LED D3 always brights, that mean pin10 is always high! => Measure pin10 and try to lower R9 value from 10Kohm to 1.8Kohm or less according to your pickup.
– At each pulse LED D3 blinks.
(Blinking is very short: 0.0005 second, so you can hardly see ONE pulse, but when there are a lot of pulses, you can see the led glowing)
The firmware doesn’t contain any limit, for that matter a video below show it working at 30’000RPM !
There are 2 ways of limiting the RPM:
First in the Excel file: Above the highest RPM value in the sheet, there is no more sparks.
ie: when RPM goes over 10653, sparks stops.
Second: With JP2 jumper.
JumperClick here for more info
JP2: REV LIMITER
If jumper is ON (meaning putting a jumper, so RA1/pin18 is connected to ground) then Optional RPM limit is activated. [cell N34 of Advance_curve tab].
If jumper is OFF (no jumper, so RA1/pin18 is connected to +5v through R5) then RPM limit is cell D9 of Advance_curve tab.
This jumper can be use as a racing/legal switch.
(Even if JP2 is not used, R5 is mandatory!)
TroubleshootingClick here for more info...
– You can check the cdi the same way as V6
After a reset:
– If led blinks 3 times it means that +5v has been cut (CDI has been powered off.)
– If led blinks 4 times it means that a RESET occurred (Manual or due to parasitic transient/aka EMI)
Electromagnetic Interference comes when external high dV/dT append nearby the processor.
– Only use ignition coil designed for CDI (not for TCI!)
– Use 5K to 20Kohm spark cap noise eliminator
– Use shielded sparkplug wire
– Ground shift: Sparks induce high current in the ground line. If gnd trace or wire are too narrow, ground level will raise up. Use a separate strong ground wire as close as SCR’s cathode as possible. Don’t use a unique ground path for microcontroller AND ignition coil!
– Add a filter across the SCR (snubber, varistor, Ferrite bead choke)
– Search for bad solder joint
– Use a good power rail strong and stable, can need more caps on it. (100uf + 100nf + 10nf)
– Add 100nF decoupling cap to power supply pins as close to the PIC as possible
– Add 100nF between reset pin (MCLR pin4) to ground
– Lower R1 pullup resistor to 4.7k
– No floating pins. Ground any unused pins if they are at low state.
– Use the last firmware
– Shield the circuit: Enclose the PCB inside a metallic box connected to ground.
How To simulate a VR pickup.
Upgrade the firmwareClick here for more info...
To upgrade the firmware without losing the timing data in the Eeprom, pls follow this order:
Connect PICkit3 to the PC
Launch PICkit3 Software, goto:
Tools > Check communication
Device Family > Midrange > 1.8v Min
Device: Select Part 16F1827
Uncheck “EEPROM Data”
Check “Program Memory”
File > Import HEX
Load the new firmware > Write
- After Firmware tuning and a 1000km proof test without any issue. (Thanks to “Toe T.”):
- Video of v7.9 on a Gilera 125cc model 1980:
- Video of v7.9r10 on a Suzuki DR800:
- Video of v7.9 on a Bench from 1000 to 13000RPM:
- See wasted spark and advance in real time:
- How a pickup works?
- Video of a bench from 1000 to 30000RPM with the pickup simulator:
- Led blinking when powering on. (v7.8)
- Firmware V7.9R7 at 2000 RPM
( Blue trace below = input pin 10 = pickup signal and Yellow trace at the top = output pin 1)
- Firmware V7.9R7 at 4000 RPM
- Firmware V7.9R7 at 10000 RPM
- You may have a look for a box of 76x53x20 millimeters dimensions
- ie: Hammond 1550P IP54 Diecast Aluminium Enclosure (80 x 55 x 25mm)
Thanks to Sylvain B. who print this 3D box: and share the STL files.
VERSIONSClick here for more info
- Version 7.0:
- First Version.
- Version 7.1:
- [soft] Advance at low RPM adjustable.
- Version 7.2:
- [soft] Bug fixes
- [soft] Suppress adjustment at low RPM.
- Version 7.3:
- [soft] Bug fix. Adjustment at low RPM available.
- Version 7.4:
- [soft] Self generation of sparks.
- [hard] Reorientation of D3,C10.
- Version 7.5:
- [soft] pull-up resistors active.
- [soft] unused pins configured as output. (ECM protection).
- [hard] C1 = 10nF (ECM protection).
- [hard] JP1 move to portB (for pullup res.).
- [hard] add JP2 (for future use).
- Version 7.6:
- [soft] Internal pull-up resistors disabled.
- [soft] Led D3 goes off immediately when pickup switch to low state.
- [soft] PIC fuse: Power Up Timer: enabled.
- [soft] PIC fuse: Brown Out Detect: disabled.
- [soft] PIC fuse: Master Clear Enable: enabled.
- [soft] PIC fuse: Watchdog: disabled.
- [hard] JP1 move to RB2, [JP2] move to RA1.
- [hard] Add 2 external pull-up resistors R5+R12.
- Version 7.7:
- [soft] Bug fixes.
- [soft] Suppress adjustment at low RPM.
- Version 7.8:
- [soft] accuracy increased. (1.5° at 8000rpm)
- Version 7.9R7:
- [soft] Adjustment at low RPM available. (<1000rpm)
- [soft] LED D3 blink 2 times on startup.
- [soft] LED D3 is off in auto-spark mode.
- [soft] Usage of a 16bits Timer.
- [soft] PIC fuse: Watchdog ON to restart the microprocessor if crashed.
- [soft] No more checksum errors when loading Intel8HEX file in ICPROG.
- [soft] Output pulse that trigger the SCR is shorter (500µs) to reach higher RPM.
- [hard] Add D1 for ICSP connector.
- [hard] C6 goes 1500uF/16v.
- Version 7.9R8:
- [soft] TP1 goes from pin 7 to pin 11
- [hard] TP1 goes from pin 7 to pin 11
- [hard] All unused pins are grounded
- [hard] R1 increased to 10K
- Version 7.9R9:
- [hard.] R9 goes from 470K to 10K
- [soft.] Correction in Excel file about 2 and 4 strokes
- Version 7.9R10:
- [soft.] Improvement for low rpm adjustment in Excel file
- Version 7.9R11:
- [soft.] Major correction (prescaler value wasn’t transmitted)
- Version 7.9R11c1:
- [soft.] Change the display at low RPM in the Excel file.
- Version 7.9R11c2:
- [soft.] Larger adjustable range at low RPM
- Version 7.9R11c3:
- [soft.] Change the display at low RPM in the Excel file.
- Version 7.9R12c0:
- [soft.] Add RPM limiter. Can handle pickup position upper then 50deg.
- Version 7.9R13c0:
- [soft.] Add SCR trigger pulse adjustable from 0.5ms until 5ms.
- Version 7.9R13c1:
- [soft.] Fix Excel sheet.
- Version 7.9R13c2:
- [soft.] Define RA1 as input.
- Version 7.9R14c0:
- [soft.] Auto adjustable pulse width to SCR. Code Protection ON
- Version 7.9R14c1:
- [soft.] Code Protection OFF.
- Version 7.9R15c0:
- [soft.] Define RB3 as Output.
- [soft.] JP2 is used to BYPASS the advance curve. WARNING: USE IT ON A BENCH FOR TEST ONLY !
- [xls.] Major correction in “Advance at low RPM” tab. (Advance value displayed was relative, not absolute.)
- [hard.] Suppress unused TP2 output.
- [hard.] R7 lower from 330 to 180 to drive BTA type SCR.
- [hard.] Suppress C9-100n that could destroy PIC output in same cases.
- [hard] Drilling of Pads goes from 1.4 to 1.6mm.
- Version 7.9R16c0:
- [xls.] Correction in “Advance at low RPM” tab.
- [soft.] Major improvement of precision.
- Version 7.9R16c1:
- [xls.] Enhance accuracy in “Advance at low RPM” tab.
- [soft.] Enhance accuracy when use of 40us steps.
- Version 7.9R17c0:
- [soft.] Now firmware is a paid product downloadable in Shop Section.
- [soft.] JP2 used to activate a Rev-Limiter.
- [xls.] Add a optional Rev-Limiter.
- Version 7.9R18c0:
- [soft+xls.] Change calculation below 500 RPM.
- Version 7.9R19c0:
- [soft+xls.] Major improvement at low RPM.
CDI is now working from 2Hz/120rpm (Meaning easier kickstart, steady idle).
- [soft+xls.] Allow pickup positioning as far as 360° btdc.
- [soft+xls.] Major improvement at low RPM.
- Version 7.9R20c0:
- [soft.] Increase accuracy
- [soft.] Add a PIC reset if power goes below 4v
- [soft.] JP2 Rev-Limiter is usable on the go.
- [soft.] Remove oscillator output. Remove JP1 (autospark)
- [soft.] Fix error at Rev Limiter
- [soft.] Fix bug at 450rpm
- [soft.] Fix led that doesn’t go off at RevLimit
- [hard.] PCB has room for the second PIC option for tachometer
- Version 7.9R20c1:
- [soft.] Unused RB2 pin set as output
- Version 7.9R20c2:
- [soft.] Disable PIC reset if power goes below 4v (BOR)
- [soft.] EOL. This is the FINAL VERSION FOR 16F628A. No more improvement.
- Version 7.9R21c0:
- [soft.] Firmware carried to a 4 time faster PIC 16F1827
- [soft.] Usage of INTERRUPT to largely improve accuracy, especially at LOW RPM
- [soft.] Detection of pickup when it goes low.
- Version 7.9R21c4:
- [soft.] Major correction of advance timing at low RPM
- [soft.] Many improvements
- [soft.] Add Debug diagnosis with LED
- [soft.] LED blinking at startup can be disable to speed up the start
- [soft.] Better detection of slow pickup signal
- [soft.] Better protection against EMI
- [soft.] Free version goes from 20 to 50 trials without led blinking.
- Version 7.9R22c0:
- [soft.] Now 160 RPM values are adjustable (+66%)
- [soft.] Lowest RPM is now 100 RPM
- [soft.] First measurement of RPM can be disable to speed up the start
- [soft.] Add an operational hysteresis to filter noisy VR pickup
- [soft.] LED blinks forever when trial version is expired
- [soft.] EMI protection improved
- Version 7.9R23c0:
- [soft.] Use different step value for low and high RPM to avoid too many XLS warnings
- Version 7.9R23c1:
- [soft.] Correction: RPM now changes when 4stk is selected
- Version 7.9R24c0:
- [soft+xls.] Simplification of LOW RPM settings.
- [soft.] Advance timing is now perfectly flat from 100 to 1000RPM.