Programmable Open Source CD Ignition PIC1840 - Page 6 - RC Groups
View Poll Results: Whatís the most important thing to you?
Lowest possible cost 3 23.08%
Make it as small and light as possible 6 46.15%
Battery longevity is very important 3 23.08%
Highest power possible 3 23.08%
Highest RPM possible 2 15.38%
Only use through hole construction 2 15.38%
No winding of transformers 4 30.77%
Group buy of components including boards 0 0%
Group buy of boards only 1 7.69%
Iíd rather buy a kit with everything in it 0 0%
I want to buy a pre-built & pre-programmed system 0 0%
I only want to use a 4.8v Ni-MH battery 2 15.38%
I only want to use a 2S battery 1 7.69%
I only want to use a 3S battery 1 7.69%
I want to use a 4.8v battery to 3S battery 5 38.46%
I want to use only off the shelf parts from Digi-Key or Mouser 3 23.08%
I want the Timer board to be separate from the HV board 6 46.15%
I want a combination Timer & HV board 1 7.69%
I want all the options possible using jumpers 3 23.08%
I want a USB connection 2 15.38%
I want a serial connection (DB9) and Iíll use my own USB adapter 3 23.08%
I want a ICSP connection 3 23.08%
I want a premade parts list (BOM) at Digi-Key 2 15.38%
I want a premade project parts list (BOM) at Mouser 1 7.69%
I want 1 design and 1 design only 1 7.69%
I want optional designs to choose from and Ill make the boards myself 8 61.54%
Multiple Choice Poll. Voters: 13. You may not vote on this poll

Thread Tools
Dec 17, 2012, 04:52 AM
Registered User
Glad to see people are working on the spreadsheet. I probably never should have made it so complicated. It seems like minor changes tend to break something or other and it's been a big PITA.

I hope everyone is checking things over and not just blindly relying on the buttons and macros. Those are only to make certain tasks easier, you should always check to make sure you're putting reasonable values into the code.

As for the timing issues... in the pics Gompy posted in the other thread look like there's several errors in different places. There certainly can be problems with different Excel versions. I use Excel 2007. There's really no way for me to test things on every version and then fix all of Micro$ofts bugs. For the next version I'll try to make a more basic spreadsheet without all the troublesome macros.

I don't know what's going on with the timing problems Rob is having. It's probably do to the problems he's having with the spreadsheet.

I have run v1.0 on a real engine. The video is here...

The only timing problem I've had is that there seems to be a little bit of retarding as the RPMs increase. The calculations are correct, so there is either some delay in the hall signal or in the output circuitry, or in both.

I haven't had a RPM readout and a timing light running at the same time to take any real-world measurements, so maybe somebody can help with that. To me it looks like around .5-1 deg, per 1-2K RPM. When we get some measurements we can calculate it out in the spreadsheet.

There is a maximum RPM limit due to the nature of the system. I usually simulate things and make sure it can handle 15k or better. In my simulations it seems it should do around 16k, but the real-world limit may be lower if there is delay in the hall sensor. There must be some sort of delay which becomes more important as RPMs increase.

I test on a Homelite 25cc 2-stroke engine. It can't do that high of RPMs so I'm kind of limited in how high I can test things. For now, it looks from Gompy's tests that there may be a limit around 12k RPM, so I highly suggest not exceeding this until we can figure things out better. I never thought people would be spinning props over 10k, so I haven't put much work into testing these high RPMs.

I'm working on switching over to on-the-fly calculations instead of the table lookup scheme, and I think there are some performance gains that can be had this way. It will certainly simplify the spreadsheet.

I don't see any reason to have pull-ups disabled, but if you want to turn off the hall sensor pullup it is easy enough to do. I just suggest that you do with the WPU (or WPUA) register rather than turning them off globally.

I don't like the idea of using the MCLR pin as a reset pin. It simply wastes that pin and you risk EMI or power supply problems resetting the processor. Reset pins are just a bad idea all around. If you want to reset the processor I suggest just interrupting the power supply. You can even put a switch in to do it. The code isn't written to be reset, there should never be a reason to reset the processor. If you are having to reset the processor then there is probably a problem with your hardware. There's no software problems that should require a reset and there are no changes the software makes that would be cleared by resetting it.

I've got some time off for X-mas, so I'll hopefully get another major version finished during that time. I've now got a prop ready for my engine and I'm also planning to try and make some sort of fan-boat and play around with that in the snow and water. That should give me some real-world data to work off of.

Sign up now
to remove ads between posts
Dec 17, 2012, 04:43 PM
Registered User
Gompy's Avatar
Have fun.
Last edited by Gompy; May 05, 2013 at 05:59 PM.
Dec 17, 2012, 05:37 PM
Registered User
Wow, 14,000 rpm. Wish I could afford the boat it fits into!
Sounds like a screamer of an engine. You need a powerful ignition to keep up with that thing for sure!

Dec 18, 2012, 05:58 AM
Registered User
Gompy's Avatar
Have fun.
Last edited by Gompy; May 05, 2013 at 06:01 PM.
Dec 22, 2012, 07:28 PM
Registered User

Older versions of the software

Trying some of the old versions before version 1 is giving better results in regards to the timing issues. Some of the changes made after version 9.8 are where the problems started. Ran one of my engines up to 14,000 rpms with it and didn't notice the timing shift after 12,000 like in version 1.0 software. Doing a line by line comparison shows where the routines are different.
It's got to be the rpm tracking cause when it exceeds the limits set, that's when it starts dropping the pre sets in the curves.

Dec 26, 2012, 07:10 PM
Registered User


Some of the lines in the source code are being skipped over when being run in simulation mode . I'm not a programmer but to me, you would think at least once in the main program loop it would access every line at some point to check the statements if they apply or not . Timing changes to extreme ends do not affect the scanning of these lines . I believe this is why there are problems after 12,000 rpm' s .

Dec 29, 2012, 03:50 AM
Registered User
I have been building an experimental electronic ignition system to use on my Sunbeam S7 motorcycle.
I chose the TCI version of Gompy's circuit with the 16F628A PIC.
At the moment I am driving it with a 555 variable timer circuit as I have not sorted out the sensor side of things yet. All seems to work as far as the PIC is concerned but when I connect a coil I get a few sparks then a spike on the 5V which upsets the PIC and it stops sparking. I am using a Fairchild ISL9V5036 IGBT. If I bypass the PIC and drive the IGBT with the 555 direct I get a really good spark. I have used Veroboard as I don't have psb facilities and mounted the IGBT on the same board as the PIC.
Any advice on how to proceed would be most welcome.
Don m5aky.
Bristol UK
Dec 29, 2012, 06:18 PM
Registered User
This was the problem with that ignition system. I build a few versions of the CDI systems trying to trace the problem. Dug the whole lot out again a few months ago for another attempt but ended just the same as before. The software was written by someone who would not release the source code and therefore no one else could attempt to fix the software which many said was root of the problem. I read many things about the 16F628A which said they were a rather sensitive micro so for me and many others it still remains a mystery. This was initially the main reason to switch to another system, and John developed a simple CDI unit with others using a 12F683 chip. This system works absolutely flawlessly, however, when one wants to change the ignition curve, it is a bit involved.
This was when Jake became involved to try to write software firstly, for the 12F683.This works but there are small problems to do with high revs apparently.The whole objective is to transfer the code into a 12F1840 chip which has more resources for future developement such as telemetry.

If you go here you will see the end of the era so-to-speak on the 16F628A

And in this area from pages 1 to about page 5 I think, you will find details on John's original 12F683 version

This expands to it's present 43 pages to include the new system from Jake.

A lot of reading but many have been working on this for many years. A lot of improvements and versions, and few mistakes.
Last edited by bluejets; Dec 29, 2012 at 06:54 PM.
Dec 29, 2012, 10:23 PM
Registered User
You can plug either the 683 or 1840 into the hardware design. They're pin compatible. Right now the code is exactly the same for both, with the exception of the porting changes required because of some naming convention changes.

They're about the same price, so I'd definitely order only 1840s. I'm not sure yet if the next version will support both chips or just the 1840.

AFAIK the current version works great. Simulation shows that it should have a max RPM around 16K. Some people have reported difficulties around 12k+ or 14k, so I would consider that as the practical maximum for the moment.

In the current scheme the table lookup takes most of the processing time. I haven't been able to do much more with the current version because I don't have anything that runs that fast for testing and I'm not sure that there's really anything that can be done in any case.

Hopefully the on-the-fly calculation I'm working on for the next version will be significantly faster since it will use a smaller 8-bit table.

In any case, I've had good results with the current version and current hardware. I am continuing development and I'm sure that 16k+ will be achieved before long.
Dec 30, 2012, 04:18 AM
Registered User
Currently have a bit of spare time so thought i'd do some testing. Started by downloading the Mplab and xc8 compiler and this is when trouble started.

Wondered if anyone has had problems installing as well.

Currently using it on WinXP SP3 on a 2.8 gig machine with 1 gig ram.

Mplab installs ok but towards the end of the compiler install it comes up with "problem running post install step" and goes on to quote the directory (too long to include). Also saying that Mplab may not work properly.
mmm....that's all one needs when one gets some spare time and the *** won't work to begin with.

I've dropped a line at microchip forum so hope some answer comes back from there.

Otherwise it will have to be back to re-installing the Mplab version8 (whatever one i can muster up)

I think it had a hi-tech compiler included.????
Dec 30, 2012, 06:56 AM
Registered User
What version are you using? They probably kicked out another buggy version to fix problems in the last one.

The whole thing is kind of a mess with java, netbeans, and XML config files strewn all over. All I can suggest is uninstalling MPLAB, java, and netbeans and thoroughly cleaning up all the files they leave behind, then trying again.

I use WinXP SP3, on a far weaker computer, also. I had a couple problems with one upgrade and had to uninstall and clean out everything myself. The uninstall is not very good about cleaning everything up and you can run into problems with java and netbeans if you have the wrong version installed.

The Microchip forums might also be able to help you. There's quite a few users there that are pretty helpful and will get back to you faster than Microchip support.
Dec 30, 2012, 09:04 AM
Registered User
Gompy's Avatar
Have fun.
Last edited by Gompy; May 05, 2013 at 06:02 PM.
Dec 30, 2012, 06:06 PM
Registered User
Mplab is version 1.41 and the xc8 is version 1.10 although I have tried the latest xc8 version 1.12 and it gives the same result.

You could be correct about "cleaning out" but where to start. Were you thinking the registry?

Will check back to microchip forum also, but doubt they have an answer yet.
Dec 30, 2012, 07:46 PM
Registered User
Uninstalled everything, after that,went into the "programs" folder and deleted complete "microchip" folder.

Tried to delete the "microchip" folder in registry but it would not allow it.

Went to the archives ...

Downloaded and installed MplabX v1.10 and xc8 v1.00.

All installed ok without any errors so maybe ok now.

Thanks Jake.......
Dec 30, 2012, 07:46 PM
Registered User
> You could be correct about "cleaning out" but where to start.

That's the problem. There are files left behind in "application data". .netbeans and .mplabcomm are there. Probably other places too, but just do the best you can.

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion CD Ignition lead and fixed plug .... solentlife Engines 10 Feb 18, 2014 12:03 PM
For Sale NIB 52cc Gas engine w/CD-Ignition 3.2kw kukntra Aircraft - Fuel - Engines and Accessories (FS/W) 4 Jul 23, 2012 09:10 AM
Discussion Best open source autopilot vs commercial solution syncra Multirotor Drone Talk 0 Apr 12, 2012 02:35 PM
Discussion Any Open Source / CC CAD Files for gliders? DrFragnasty Composites Fabrication 8 Apr 09, 2012 06:36 AM
Discussion I'm designing an open source quad frame. Inclusions anyone? Physics_Dude Multirotor Drone Talk 3 Mar 11, 2012 01:22 PM