AC-CDI 16F628 v7.9

Synoptic.

 


How does it works?

The PIC receives the pulses from the 36º sensor and:

  • At idle it delay the pulse to fire a spark a few degrees ahead of TDC.
  • At high RPM it fire a spark immediately 36deg ahead of TDC
  • Between those 2 points, the more RPM increases, the more the advance would increase ahead of TDC accordingly. Following the ignition timing curve programmed in Eeprom.

Pulses coming from the 12º pickup directly trigger the SCR via D7 R7 C10.
(If the bike has only one pickup, connect it to the 36º input and leave the 12º input unconnected)

Pulses coming from the 36º pickup are limited to 5 volts by Zener D5 then drive the PIC (input pin 10).

Pickup signal must be > 2 volts in order to be detected by the PIC

At each pulse received from sensor 36º, the green LED D3 blink in phase.
(Blinking is very short: 0.0005 second, so you can hardly see ONE pulse, but if there are a lot of pulses, you can see the led blinking)

A 0.5ms pulse, delayed according to the eeprom values (the advance curve), is available at pin 1 which trigger the SCR T1 via D4,R7,C9.

 

CDI reprogramming

In difference with CDI v5 or v6 where the advance curve was inside the software, v7 separate the software (protected) and the advance map (not protected).

The advance curve is stored in the internal data EEPROM. You don’t need to ask me to rewrite the entire soft to integrate your special curve, you are now on your own!

You can change the advance curve yourself as often as you want…

Just draw the new curve in the excel sheet, program values in the PIC’s EEPROM using either the ICSP connector or a classic PIC programmer then restart the CDI. That’s all done!

Draw the advance curve

  • Use the Excel sheet (in download section below) to define the curve for your bike:
  • Change the yellow cells.
  • 1) Type in the physical position of your pickup in cell F5.
    Eg: 36 degrees Before Top Dead Center
  • 2) Select the number or cylinder (cell M24) and the number of strokes (cell M25)
  • 3) Select the maximum RPM by changing the variable TIMER1 in cell B9.
    As TIMER1 has only 94 values, if you set the highest RPM to 29297RPM (meaning TIMER1mini = 2), the maximum value of TIMER1 will be 96 (94+2) therefore, the minimum RPM still adjustable will be: 610RPM.
  • 4) Type in the advance you want for each RPM in column F.
  • Leave the prescaler default value in cell M26 as long as you can draw the desired curve.
  • If you run into “out of range” error messages, try to
    • Change the advance values at step 4
    • Change the RPM range at step 3
    • Try another prescaler value at step 2
  • Play with those 3 steps until the curve fit in the excel sheet.
  • If you want to manipulate the points of the curve instead of changing values column F, use this excel plugin
  • Any Excel errors will result in a faulty HEX file that won’t work !

When done:

    • Adjust the advance desired at low RPM in cell I2 of the other tab named “advance_at_lowRPM”.
      (In this example you can slightly adjust advance between 100 and 580RPM):

 

    • Once your curve is drawn, there are 2 tables available: Intel 8Hex and Raw data formats.
      We will use the Intel 8Hex format.
      (Raw = only the values without CRC and addresses)
    • Save the EEprom data that contain the advance curve, into a text file:
      • Create a empty file named Eg: c:\eeprom.txt
      • Select the Intel 8Hex data [cells O18 to O35] from the excel sheet, right clic | copy
      • Paste the content into c:\eeprom.txt, save and close the file.
      • Rename c:\eeprom.txt into c:\eeprom.HEX

       

      1. Launch ICPROG
      2. Even if you use another software to program PICs, use Icprog to build a unique HEX file including the software AND the Eeprom data.  Video tutorial
      3. Select 16F628A on the upper right of ICPROG screen, “File”, Open File and load my SOFTWARE: ACCDI_16F628_V79R11.HEX
        (This software doesn’t contain any curve inside.)
      4. Open Data file then load your file c:\eeprom.HEX, which is the Intel 8Hex eeprom data file you’ve just created with excel.
        (Your eeprom data doesn’t contain any soft, it’s only the advance curve)

        • or simply type in the 95 values of the RAW data [cells Q19 to Q34] in the ICPROG Eeprom Data screen, quite bothersome…
    • Now Icprog windows display both my software + your eeprom data (=curve) ready to program:
      Configuration ICPROG

 

  • Pay attention to:
    Device type 16F628A
    Fuses WDT+PWRT+MCLR = ON
    Oscillator IntRC I/O
    Configuration word Icprog 3F34
    Configuration word PicKit3 v3.10 2134
    Software Checksum in Icprog * 58CB for v7.9R9
    B9FC for v7.9R11
    Software Checksum in Pickit3 v3.10 592B for v7.9R9
    B9FC for v7.9R11

    * (Checksum of the software alone, without eeprom data)

  • Now you are ready to burn the PIC with ICPROG, but if you use another software programmer which doesn’t allow to program Eeprom separately (MPLAB, WinPic800, others…) still use ICPROG to save the total .HEX file that now contains software + eeprom data:
  • File”, “Save File As… : c:\software_and_eeprom.HEX to use with your own programmer…


Programming

  • Burn the chip with a serial or USB programmer then insert it on the board:
  • or use the ICSP connector to program the chip in situ with PicKit:Config PICKIT3

Programming control

  • Always verify the PIC programming !
  • Read the PIC 16F628A with your programmer and save the result in a text file.
  • Open the text file with your favorite editor, you will see the program memory zone where the soft is standing.
  • Line 258, you will see the eeprom data zoom where the advance curve is standing.
  • Compare the reading with your original file c:\software_and_eeprom.hex you used to burn the PIC.
  • Checkout if the eeprom is populated, otherwise the CDI will not work !
  • (Example of a working file: dump_pic.doc)

Simulation

Oscillator:

[TP2]: A 20KHz square signal is available at RB3.
It can be use to drive a transformer to convert this AC-CDI into a DC-CDI.

Tachometer:

[TP1]: A reverse output is available at RB5. (the output is the opposite of RA2)
It can be use to drive a tachometer with the need of some other components.

LEDs:

– At startup, Led D3 blinks 2times and goes off meaning that programming was correct.
(if it doesn’t blink, something went wrong with the PIC or the power line or the programming…)

– When pickup input pin10 is high [>2.4v], D3 led (pin1) is on. So at each pulse received from the pickup, LED D3 blink in phase.
If LED D3 stay on, that mean pin10 is always high! => Measure pin10 and try to lower R9 value from 4.7Kohm to 1.8Kohm or less according to your pickup…

– You can remove D3 + R4 to lower the current consumption, but you’ll lose the feedback.

– At each pulse going from the PIC (output pin1) to the SCR, LED D4 blink.

– D4 is a High sensibility LED, it lights at 2mA, if you use a classical LED instead, the CDI will work but you wont be able to see anything because a simple led need 10 to 20mA to bright!

– You can replace D4 by a 1N4148 if you don’t like blinking led.

RPM limitation:

The software doesn’t contain any limit, for that matter a video bellow show it working at 30’000RPM !
You set the limitation up in the Excel file, therefore in the Eeprom.  See point 3) of cdi reprogramming

Jumpers:

JP1: AUTOSPARK MODE.
If jumper is OFF (meaning no jumper, so RB2/pin8 is connected to +5v through R6)
CDI is working normally, (one pulse from the sensor = one output pulse to trigger a spark)

If jumper is ON (meaning putting a jumper, so RB2/pin8 is connected to ground)
CDI is automatically generating sparks without any pickup signal, at a frequency of 50Hz.
(50Hz = 2800rpm for a 2strokes)

JP2: UNUSED
Jumper can be ON or OFF. (RA1/pin18 can be connected to +5v through R5 or to ground)

Please note that:

  • Welding R5 and R6 is mandatory!
  • JP1 is tested once at boot time! So if you move the jumper, reboot the CDI.

Electromagnetic perturbation:

Unused pins N° 3-6-7-15-16-17 are grounded for improving electromagnetic protection.
For the same reason, even if you don’t use jumpers JP1 JP2, still weld R5 and R6 to don’t leave pins disconnected.

Printed Circuit Board.

Zoom

Warning: PCB for version 7 is different than the one for v6 or v5 !

Printed Circuit Boards are available for sale !

 

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 edge of the trigger pulse, if the positive wave is the second one like Honda or Suzuki, the timing will be bad… Then Q1 and Q2 transistors are used to reverse the signal in order to look like a Yamaha’s one.

According to YOUR pickup signal, just use and weld the appropriate components:

For positive-first pickup signal

Yamaha, Kawasaki


Remove: Q1, Q2, R10, R11
Add : D4, D9, R9, C3

 

For negative-first pickup signal

Honda, Suzuki


Remove: D4, D9, R9, C3
Add : Q1, Q2, R10, R11

TESTS.

    • The CDI has been tested OK at 20000RPM (333Hz)
    • You can check the cdi the same way as V6

  • CDI powered ON but not connected to a bike.
    (without Q1,Q2)(JP1 OFF)
    CDI powered ON in self spark generation.
    (JP1 ON)
    Volts PIN Volts
    0 RA2 1 18 RA1 5
    0 RA3 2 17 RA0 0
    0 RA4 3 16 OSC 0
    5 MCLR 4 15 OSC 0
    0 Gnd 5 14 Vss 5
    0 RB0 6 13 RB7 0
    0 RB5 7 12 RB6 0
    5 RB2 8 11 RB1 0 or 5
    2,5 CCP1 9 10 RB4 0
    Volts PIN Volts
    0,23 RA2 1 18 RA1 5
    ~4 RA3 2 17 RA0 0
    0 RA4 3 16 OSC 0
    5 MCLR 4 15 OSC 0
    0 Gnd 5 14 Vss 5
    0 RB0 6 13 RB7 0
    0 RB5 7 12 RB6 0
    0 RB2 8 11 RB1 4.7
    2,5 CCP1 9 10 RB4 0
  • You can test the CDI with my Pickup Simulator
  • Video of a bench from 1000 to 30000RPM with the pickup simulator:
  • Led blinking when powering on. (v7.8)
  • Software V7.9R7 at 2000 RPM
    ( Blue trace bellow = input pin 10 = pickup signal and Yellow trace at the top = output pin 1)
  • Software V7.9R7 at 4000 RPM
  • Software V7.9R7 at 10000 RPM
  • Video of v7.9 on a Gilera 215cc model 1980:
  • Video of v7.9r10 on a Suzuki DR800:
  • Video of v7.9 on a Bench from 1000 to 13000RPM:

DOWNLOAD

PIC 16F628A v7.9R11   600 to 30000rpm
To make the PCB PCB Eagle v6 files
To build the CDI Schematic Partlist
To draw the advance curve Excel file
To burn the PIC Software Icprog.exe

(Source code is not available.)

 

EEPROMS

VERSIONS

  • Version 7.0:
    • First Version.
  • Version 7.1:
    • [soft] Advance at low RPM adjustable.
  • Version 7.2:
    • [soft] Bug fixes
    • [soft] Suppress adjustement at low RPM.
  • Version 7.3:
    • [soft] Bug fix. Adjustement 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 removed.
    • [soft] Led D3 goes off immediatly 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 adjustement at low RPM.
  • Version 7.8:
    • [soft] accuracy increased. (1.5°)
  • Version 7.9R7:
    • [soft] Adjustement 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 D5 for ICSP connector.
    • [hard] C4 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 15K
  • Version 7.9R9:
    • [hard.] R9 goes from 470K to 4.7K
    • [soft.] Correction in Excel file about 2 and 4 strokes
  • Version 7.9R10:
    • [soft.] Improvement for low rpm adjustement in Excel file
  • Version 7.9R11:
    • [soft.] Major correction (prescaler value wasn’t transmitted)

 

75 Comments on "AC-CDI 16F628 v7.9"

  1. Cristian Luchetti | 29 July 2016 at 17 h 50 min | Reply

    I made the version cdi ac-cdi-16F628-v7-9 and it worked very well. CDI_16F628_V7.9R8.hex you load the program and run. It has a fixed 14 degree curve. Now my bike adecuare the curve that best walk as it is a reform of an old bike model Gilera 215 1980 Made in Argentina (Based on engine Gilera 98 Giubileo Italian)

  2. Hey Thierry,how are you? i cant download eagle files, error 404, could you check that out please? thanks.

  3. THANK YOU great site Built one extremely happy.Going to try a dual setup on the 4 cylinder drag bike when i have time available and see if i can build optical sensors for it
    THANKS AGAIN

    • Fantastic !
      using this CDI for a 4cyl is easy if the engine has a mechanical distributor (Delco) but much more challenging if using 4 electronic driven coils….

      • The idea is to use 2 Huandai dual cdi ht coils 2 programmable units ie one for cylinders 1-4 the other for no s 2-3,optic sensors for a bit more precision wish me luck as we breathe life into a 35 year old monster again

  4. Hi , my derbi atlantis 50cc 2000 not have captor coil , how to install cdi programable in the bike ?

  5. hola, te escribo desde argentina, quiero esamblar el cdi, pero tengo dos dudas, con respecto al pickup como puedo saber que tipo de señal obtengo, si positva o negativa y la otra pregunta es cuando te referis a la posicion fisica del pick up, seria cuanto grados esta desplazado del punto muerto superior del paso del sensor.
    te comento que lo pienso probar en un motor chino 150cc copia de un motor honda. espero tu respuesta y si puedo contartacme contigo por otro medio para consultarte. gracias
    Hello, I write from Argentina, I want esamblar the cdi, but I have two questions, regarding the pickup as I can know what kind of signal get, if positva or negative and the other question is when do you mean the physical position of the pick up, as would be degree it is shifted TDC sensor passage.
      I mention that I think try at a Chinese copy of a 150cc engine Honda engine. I hope your answer and if I can contartacme you by other means to consult you. Thank you

  6. Hello,
    I can’t think of anything else then using a oscilloscope or a cheaper PC sound card scope to see if the pickup signal is positive then negative or the other way.

    By position of the pickup, I mean the “electrical position” not the “mechanical position“.
    In other words, you’re right: How much degree between pickup and TDC?
    Generally it’s between 20 to 40 BTDC

  7. friend I hope this good, I am writing from Colombia visit their website and found it very interesting because I like to know that CDI competition can build to put my bike competition is a yamaha bike rx 115. THANK YOU for your attention, I hope his answer soon

    • @Angel: The same old question…

      2 strokes, 4strokes, 1-2-3-4-6 cylinders, mechanical/electronic distribution
      separate pickup or not, analog or digital pickup, TCI, AC-CDI, DC-CDI etc etc…
      There are so many different bikes that I can’t answer this!!

      If I try to summarize:

      Multi-cylinders:

      If the sparks distribution is mechanical with the use of an old Delco distributor
      it’s the same as a single cylinder/2 strokes.
      =>my CDI should works

      but if there is multiples coils (IE 4 coils for 4 spark plugs) the CDI must drive each coil at the right moment but my cdi cannot , there are just able to drive only one coil.
      =>my CDI won’t works

      bi-cylinders:

      my CDI works on BMW as they are opposed twin/4 strokes, and needs only one spark every 360°, the very same as a single cylinder/2 strokes.
      HT coil is double, so it generates at the same time 2 sparks, and one is wasted as the other cylinder is on its exhaust stroke.
      =>my CDI should works

      For bi that are not opposed, => my CDI won’t work

      mono-cylinder:

      If there is no separate pickup and the timing is done by using the High Voltage of the alternator
      =>my CDI won’t works

      If there is a separate pickup providing at least 3 volts
      =>my CDI should works
      but you eventually have to reverse the signal to get a positive signal first in order to have a good timing.

  8. Friend Thanks for your reply. My bike is a 2-stroke has a loading coil and other pulsora. and each has a cable and my bike is competitive CDI recommends me

  9. Malcolm Robartes | 15 October 2016 at 12 h 52 min | Reply

    Hi Thierry
    A ‘like very much thumbs up’ and order placed . A question on 2 stroke singles . Tach drive normally taken from coil LT wire from standard CDI .Is the pulse reaching the primary winding of the coil the same or does it require modifying ? Exhaust valve YPVS or Honda RC type that require a signal from the CDI unit to drive the exhaust valve controller ECU .Probably rpm pulse but from which point is this taken ? Should I check the output of the original CDI to the EV ecu and measure +V and then take use a similar source from your replacement CDI ?
    General questions .Do you have a recommended Hamilton case for your pcb’s ?Is it worth swapping out the 2n2222’s for the more heavy duty XT450s in this minor application for reliability’s sake ?
    Do you have plans for a combined programmable EFI/CDI for singles and 2 strokes .I hqve used mechanical fuel injection in the past on 2 strokes with lack of real success ,and used Tillotson types with great success, and flat slide carbs are great but the whole idea of dispensing with the mechanical issues and bucket loads of jets needles etc.these have with them appeals to me now that there are piles of motorcycle sized components about to adapt to 2 and 4 stroke single applications.Mikuni throttle bodies that will slip straight into a carburettor manifolds of various sizes complete with sensors for very little money.
    Keep up the good work .

    • Thanks Malcolm !

      As far as I know YPVS valve driving signal is a saw tooth form going from 0 to around 50volts
      A few guys have taken the signal from SCR anode with success.
      If I were you I’d have a look at the original signal if/when it work to see how it looks like then use the anode signal and lower it with a zener diode if needed. I can’t imagine that the aspect of the signal is important…

      I don’t know about tachometer command, I guess that it could be the same as YPVS with the use of the LT wire going to the coil but some other tach may use a classical 0/+12v square signal: Read the specs.

      Sorry I don’t know Hamilton materials, here Radiospare (rs-components.com) is a good source of electronics products. The box must be at least 76x53x20 millimeters, internals dimensions, but check the high of the capacitor before buying !

      Although 2N2222 are reliable transistors, the use of them is only depending on the form of the pickup signal, if XT450s give a positive-first signal then go without transistors.

      Finally EFI would be far over my skills. I do understand that it must improve the consumption but I’m a big fan of classical carburators and a “KISS” supporter 🙂

  10. Malcolm Robartes | 16 October 2016 at 15 h 12 min | Reply

    Thanks Thierry
    Yes I agree with you on both counts regarding signals for both ecu and tacho and I should imagine as the three most popular 125s out there ,the Aprilia ,Cagiva and Honda all being made in Italy will be using many interchangeable parts too so I will be triggering the NSR EV ecu and an Aprilia RS tacho, even the looms are similarly colour coded, so clearly nothing fancy going on with any of these.
    Hamilton make the lovely Euroboard aluminium heatsink cases and I didn’t know if you had designed the board around a Euroboard size until it arrived yesterday .Yes that large electrolytic is a naughty one , common sizes for these are tall and skinny or short and fat neither good for compact cases or board fitting , even above and below the 1500uf 16v rating . I have some that are 10mm dia by 20mm high by Wurth -pricy but perfect .Great service by the way .
    Sorry about brain failure but I should have said ZTX 450s , pretty much the same as the 2n2222s but are ‘heavy duty’ and can handle spikes and transients better when used in ignition systems.I used them instead of the 2n2222s in the MegaSpark/Squirt V3 I built a while back with good results and it may help in this area.A V12 Jaguar with lots of IGBTs and 2 sets of Audi V6 coil packs !
    Is the 4v7 Zener absolutely necessary as I have hundreds of 5v1s or is that running too close to the limit of the PIC ? I’ll have to wait on a reorder for the 4v7s otherwise !
    Lastly how about a complete parts kit so kids at school can make these up in class ?
    I’m with KISS technology,lets face it ,its that Kelly Johnson attributed ethos that took the SR71A Blackbird from design to flight at the Lockheed Skunk works way back ,but the design team was headed up by a British engineer Alan Brown, who made it all look very simple stupid indeed!
    Cheers
    Malcolm

    • I draw the PCB without thinking ahead and trying to fit a regular size of boxes… my bad! I’ll try to take this into account next time…

      I try to use easy to find parts that’s why I’m still using 16f628 despite there are much better big brothers of this MCU but this one has been widespread from Malaysia to Columbia… As well as 2N2222, olds but that the kind of general purpose NPN that we can find in our drawer.
      Obviously everything you can do to strengthen the CDI is great: stronger transistors, spikes protection, wider temperature range… Go for the ZTX things for sure !

      PIC inputs are protected by 2 internal diodes that goes to ground and to Vdd line. 5.1 zener diodes are close to the limit of the PIC but one day as I ran out of 4.7v zener diodes and I used 5.1v without notice anything weird.
      In my opinion, you could use any value from 2,7v to 5,1v

      This version 7,9 still need a PIC programmer, so it’s not really a easy kit to build and especially to program and to wire to the bike.
      I naively think that the people interested in DIY CDI have the skills to and are familiars with electronic parts, they probably have some so they don’t need any. Perhaps I’m wrong…
      I’ve a drafted v8.0 version that doesn’t require a pic programmer, perhaps it’s a better candidate for a KIT….

  11. How is the max Rpm limited in AC-CDI 16F628 V7.9.Is it loaded in the EEprom Memory ,because there are no shorting jumpers for rpm limit, except auto Spark and an unused jumper. Kindly explain
    Thanks and regards
    G.Rajan
    (from India)

    • Totally !
      You set it up in the Excel, therefore in the Eeprom.
      The software doesn’t contain any limit, for that matter a video above show it working at 30’000RPM !
      I point that at point 3) in cdi reprogramming above but I’ll write it clearly…
      Brg
      Th.

  12. Hi. Is there anyone using this for SEM CDI replacement – Husaberg is quite error prone, and now the spare parts are getting difficult to aquire. The SEM has the pickup at 60 deg if I understood it correctly. Would that be possible to handle by just another (odd) curve?
    Cheers,
    Lars

  13. Thanks a lot Thierry 🙂
    Cheers

  14. Hi,

    The CDI runs fine on the simulator pulses and shows correct operation on the Scope too. But once you put it on the bike it misfires, backfires hesitates to even idle right. Using Suppressor plugs, changed ignition coil, pickup etc but to no relief. What more to look into?

    • Hi,
      – Does the test led blink all time long? meaning that PIC is rebooting because of EMF?
      then power it up with a 9v cell battery.
      – Are you sure about the NP or PN position. How is the sine of the pickup?
      – sure about the pickup position BTDC ?
      – Reload the XLS sheet on this page, I’ve improved it a bit for lowrpm (ensure version is 7.9R10)
      – First use a flat advance curve around 5deg BTDC before trying a more tunned curve.

      Hope this help.

      • Hi, on the excel the values of timer change when we select 2 or 4 stroke engine. What I want to ask is why? considering on a single cylinder 4 stroke every alternative stroke is a wasted spark then what exactly is the logic behind it?

        • Or is it for the engines that trigger pulser after every 720 degrees?

          • You are right, this point is not clear enough.
            If you read the comment in cell L26 of the XLS, I explain:

            choose 2 for 2 strokes or 4 strokes WITH wasted spark
            choose 4 for 4 strokes WITHOUT wasted spark

            in 99% choose 2.
            Notice that it doesn’t change anything in the behavior of the sofware, that only change the RPM displayed in column C

    • Please use v7.9R11
      I have made a major correction in the HEX file.
      (the prescaler value displayed in the Excel File wasn’t used by the software.)

  15. Thanks Thierry for your DIY cdi.
    Is there any way to use your digital Cdi V7.9 for a motorcycle which does not have a battery. Do we need to change the pcb layout?

  16. Hi,

    – Is it input signals on the schematic labeled “X1-1” to “X1-5”? Where are these signals coming from?
    Or, can these signals be used as output signals, analog or digital, from PIC16f628A?
    – Similar question as from “Loop 26 November 2016”: In absence of 12V battery, but a LV supply magneto coil on the engine- leaving about 14-16Vac. How would that circuit look if 16Vac is connected to PAD2 instead of the battery +12Vdc?

  17. Thanks Thierry.
    Quotes:”If jumper is ON (meaning putting a jumper, so RB2/pin8 is connected to ground)
    CDI is automatically generating sparks without any pickup signal, at a frequency of 50Hz.
    (50Hz = 2800rpm for a 2strokes)”

    Why do you have 2800RPM 50Hz pulse frequency?
    Because I know so:50Hz=50 pulses in one second. 50*60=3000rpm/min
    Why only 2800 rpm 50Hz to you?
    I also deal with ignition advance delay microcontroller (12F683/8MHz) software.
    What is your opinion about it?
    Link:https://www.rcgroups.com/forums/showthread.php?1781959-Programmable-Open-Source-CD-Ignition-PIC1840/page92
    Thank you in advance for your reply.
    Regards nyemi

    • Totally right. I checked and it’s 20ms between pulses then 50Hz and 3000RPM. (I’ll correct it).Thanks

      I didn’t read the 92 pages of this huge thread, but it’s interesting. Personally I’m not a big fan of 8pins PIC as you need some tricks because the lack of availables pins.
      IE, I would avoid to deal with analog input to chose between 4 curves, I’d prefer 2 jumpers giving 4 possibilities.
      You chose to separate the timer from the power part. It’s a choice but in my experience, people who don’t have enough skills prefer a unique part or ever the simplest way to build one. Good stuff anyway.

  18. Is there any problem using pickit 2 for burning the IC?

    • Pickit3 is suppose to be faster for debugging, it can work with lower Vdd and must be use for the newest PICs. (ie: PIC32)
      but for those midrange PIC16F pickit2 is just fine!

  19. which are the other components needed to drive tachometer

  20. Malcolm Robartes | 25 December 2016 at 13 h 06 min | Reply

    As Thiery has said the tacho receives a pulse normally of the same voltage in the form of a sawtooth with little duration . This seems to be common on both the tachos I have Honda and Aprilia and I am trying a Yamaha R6 type to make sure that it is the same with ECU tacho out , but although these would look cool on any bike I suspect the ECU driven tachos deliver a 5V square wave to the tacho driver . The NPN common emitter works for both tachos that I have and is likely to be the solution for any tacho that used a combined CDI coil unit . It would seem that any medium power NPN transistor is OK for the purpose ( I chose one at random from my tray) and that output can be used for signal in to the exhaust power valve ECU too for the 2 stroke singles. I chose a medium power mainly because of the additional load required by the exhaust valve ECU but is probably not necessary .
    This is a great little kit for any young person into bikes with little experience in electronics and soldering and wants to learn the basics of programming ECUs for which Thierry must be congratulated as this is a very affordable way to start. A Merry Christmas to you Thierry and everyone else !

    • Hey! Glad to hear from you Malcolm !
      Thanks for you wishes, and get mines in return for you and all your beloved ones.
      Following our convo, the blackbird stickers have already been printed for version 8
      Thanks for this inspirational idea 😉

      I’m happily surprise that the NPN interface is enough to driuve the power valve. That’s cool and I regret to doesn’t offer a tacho output anymore on the future version… Hopefully I let 2 output in standby that could be use if I modify the soft.

  21. it’s possible to add input from map sensor to pic micro beside pickup sensor ?..if it possible how to modify the circuits n program?

  22. Jan van der Veen | 23 January 2017 at 16 h 05 min | Reply

    Thierry,

    I have built version v7.9 and it worked well.
    Now I want to programm on the circuitboard with ICSP connector.
    I use Pitkit V2 with Velleman VM203 but there is a problem, the programmer said; “Program Memory is not blank starting at address 0x000000” Also I can not verify the programm.
    When I programm the PIC on the Velleman board the programming works well.

    Can You help my out??

    Jan

    • Hello,
      Bad erasing are often relative to Vpp tension.
      -Don’t power up the CDI when using ICSP
      -Have you tried “tools >Use VPP First Program Entry” for Vpp coming before Vdd to avoid the software to start?
      -If LVP (low voltage programming) is ON, try to play with Vpp voltage going from +5Vdc to +2.5Vdc
      if not, check if pickit2 programmer is able to provide a strong +12Vdc Vpp

  23. Jan van der Veen | 24 January 2017 at 17 h 03 min | Reply

    Thierry,

    The option “Use VPP First Programm Entry” did the job, Its working!!

    Thanks

    Jan

  24. Hi.
    I found a bad engine start. In proteus simulator I saw a bug in delay on low frequency. 8 Hz is Ok, but 7 Hz has no any delay. 6 Hz very small delay and so on till 1 Hz. You can see it yourself in your proteus project and sample CDI_16F628_V7.9R11.hex

    • Hi
      You are right but it’s not a bug. At 7Hz (420RPM) the 16 bit Timer1 overflow.
      If you really need so low RPM you must slow down the PIC clock by increasing the prescaler value (cell M26)
      The new Excel file is clearer about that:

      • Ok, thanks, i see. I’ll try to play with prescaler value. But this does not solve the problem start engine by kick-starter or by bad accumulator. First flash occurs too early and kicks back. It would be ideal to use a second pulse of pickup coil for the first flash as doing many commutators but it need to change schematic.

  25. Can you modify the software to handle the advance of two cylinders with a single micro?

  26. With independent pickup

  27. THANKS FOR YOUR REPLY

  28. Good evening, is it possible that you can download the source code too?

  29. Hi,
    I have built this ignition and it works fine on table, but the bike’s behavior is not too fine…Maybe the ignition timing is not suitable. I’ve programmed the PIC with 36º pickup coil position, but I can’t find any information how much exactly is.
    May you know the exact electrical position? 90′ Suzuki DR650. Thanks in advance.

  30. Bonjour Thierry,
    tout d’abord un grand merci pour la qualité de votre site,
    j’ai monté votre allumage AC-CDI 16F628 v7.9sur un moteur de 103 allumage électronique, j’ai un petit soucis il ne veut pas passer les 6000t/min, auriez vous une petite idée?
    Merci d’avance

  31. lemonnier sebastien | 24 April 2017 at 16 h 06 min | Reply

    bonjour voila debutant en electronique j ai quelque soucis pour comander les composant neccesaire je voit sur la liste des differences avec le shema notament la resistances r1 etc et t il possible de recoir une liste plus detailler ou realiser des kit a monter soit meme mon premier projet est pour un scooter suzuuki
    merci de l attention portee a mon mail

  32. Hi terry..till now i’m stil watching up your site trying and trying to understand it,I still wait pickit3 that I’ve ordered from local online store.I hope you can guide me next,u know its a very hard way for me

  33. lemonnier sebastien | 25 May 2017 at 18 h 55 min | Reply

    hi i come back to you, i sorry but the cdi will not function cause my alternator not delivrate a 200v but only 24v (i think) i must confirm,could you eventually make and additional circuit for generate this voltage wiht the 24v comming from alternetor or with the 12 volt comming from the batterie (http://www.abcelectronique.com/annuaire/montages/cache/357/montage021.gif)this shema not help me cause a don’t know the part list to make it
    or i have find this https://www.amazon.fr/gp/product/B01K40NK6Q/ref=ox_sc_act_title_1?smid=A1XTJ6FZJZ40TR&psc=1
    thinks for your attention and sorry for my english
    if you need i cant speak in french that better for me

    • Hi, Then you need a DC-CDI (to transform +12Vcc into ~200Vac) not a AC-CDI !
      The kind of control you must do BEFORE building a CDI not after! 😉
      Autrement ce convertisseur 12/220 d’Amazon convient parfaitement. Trop puissant (150w) pour un scooter mais ce modele est bien régulé et il y a plusieurs tensions disponibles en sortie.
      Attention il y a un risque de destruction du SCR car celui-ci va mettre en court-circuit le convertisseur lors de l’etincelle.

  34. Hi Thierry, I really liked your device! I collected it and made a curve under your Moto, I was faced with the problem of EEPROM…. I need to tweak the EEPROM like on your photo in the program Icprog ?

    or simply type in the 95 values of the RAW data [cells to Q19 Q34] in the ICPROG Eeprom Data screen, quite bothersome…

  35. Thierry, thanks for the quick response! I can’t attach a photo in the comments of your example…after you create a curve in EXCEL, the code in the last line of the EEPROM turned out to 4F 0B 00 02 05 14 09 67 as I understand I need to iceprog in the last line of the EEPROM do so 00 00 00 00 and the next four pairs 14 09 05 67 do not touch?

  36. Thierry, I translate text through the translator, sorry for mistakes..

    • No worries for the translator.
      I don’t understand why you want to modify the eeprom directly instead of modify the Excel.

      If you draw a curve while you change the LAST line of eprom, calculations will be wrong! Don’t do that!

      ie, the meaning of: 4F 0B 00 02 05 14 09 67
      is
      02 = number of strokes
      05 = multiplier in lowRPM formula (cell I2)
      14 = Time for the PIC to make one calculation
      09 = Timer1 (max RPM)
      etc etc

      Each value as a meaning, don’t change them without knowing or you will get a f… mess!!

      Change the values in the Excel sheet (tab “Advance_curve” and “advance_at_lowRPM”) and the Eeprom values will change in Excel.
      Then copy (or type in by hand) the values that HAVE BEEN CALCULATED by Excel macro into the eeprom.
      Don’t invent values that wasn’t in the excel sheet.

      • I understand you. thank you very much!!! I’m really confused, I translate your text through a translator he introduced me astray…
        now I understand everything! I just need to copy the final file to my curve with EXCEL EEPROM and insert it in Icprog…

  37. Hi Thierry! I want to build a device, My question is, 1) Type in the physical position of your pickup in the cell F5.
    Example: 36 degrees before top dead center

    How do I know position ? any value? I have a Chinese copy of a Honda cub

Leave a comment

Your email address will not be published.


*



6 + 8 =