New CDI - opensource project JMJ and Bigboat
#1226

My Feedback: (2)
Joined: Dec 2002
Posts: 234
Likes: 0
Received 0 Likes
on
0 Posts
From: Chiburbia,
IL
There is a very interesting electronic ignition theory thread going on over in the "Gas engines" forum.
A couple of you highly technical guys would surely be up to this request for discussion from an extremely competent Ladyflyer... :
From post#109
http://www.rcuniverse.com/forum/m_97...mpage_5/tm.htm
"With battery/coil ignition circuits there are many elements outside the simple DC resistance of the coil that will affect the actual operating load. Those factors, like the Ohm's law debate are probably beyond the scope of this topic. Perhaps we could start a new thread ?
"Current Draw in Pulsed Coils At The Point of Magnetic Saturation" Anyone ?
We could discuss how voltage engine speed ,crankshaft dwell angle etc affect the saturation point as well.
WOOPS.
It seems that thread has been locked down.
Maybe this one,if anyone is interested.
http://www.rcuniverse.com/forum/m_9726159/tm.htm
A couple of you highly technical guys would surely be up to this request for discussion from an extremely competent Ladyflyer... :
From post#109
http://www.rcuniverse.com/forum/m_97...mpage_5/tm.htm
"With battery/coil ignition circuits there are many elements outside the simple DC resistance of the coil that will affect the actual operating load. Those factors, like the Ohm's law debate are probably beyond the scope of this topic. Perhaps we could start a new thread ?
"Current Draw in Pulsed Coils At The Point of Magnetic Saturation" Anyone ?
We could discuss how voltage engine speed ,crankshaft dwell angle etc affect the saturation point as well.
WOOPS.
It seems that thread has been locked down.
Maybe this one,if anyone is interested.
http://www.rcuniverse.com/forum/m_9726159/tm.htm
#1229
HI....I read the following in a prior posting...about max RPM a CD will work good. Is this the bottom line?
<div id="TixyyLink" style="border-bottom: medium none; text-align: left; border-left: medium none; background-color: transparent; color: #000000; overflow: hidden; border-top: medium none; border-right: medium none; text-decoration: none">All CDI's you can buy can handle only 10,000 rpm max.
For most of us more then enough, but for a Zenoah it's
Thanks Capr,n
</div>
<div id="TixyyLink" style="border-bottom: medium none; text-align: left; border-left: medium none; background-color: transparent; color: #000000; overflow: hidden; border-top: medium none; border-right: medium none; text-decoration: none">All CDI's you can buy can handle only 10,000 rpm max.
For most of us more then enough, but for a Zenoah it's
Thanks Capr,n
</div>
#1230
Thread Starter
Senior Member
Joined: Dec 2005
Posts: 548
Likes: 0
Received 0 Likes
on
0 Posts
From: Alkmaar, NETHERLANDS
Most CDI's for modelengines can handle ~10,000rpm, not more.
The modelengines we use, weedeathers - jigsaws - aso, aren't make for high rpm and have a low powerband.
If you buy a race engine like Zenoah, they run more then 15,000rpm and have there own CDI.
This CDI's are not programmable, they use the wonders of nature magnetism to delay the spark.
The modelengines we use, weedeathers - jigsaws - aso, aren't make for high rpm and have a low powerband.
If you buy a race engine like Zenoah, they run more then 15,000rpm and have there own CDI.
This CDI's are not programmable, they use the wonders of nature magnetism to delay the spark.
#1231
Thread Starter
Senior Member
Joined: Dec 2005
Posts: 548
Likes: 0
Received 0 Likes
on
0 Posts
From: Alkmaar, NETHERLANDS
@Charlie,
Wat code is this ?
OSCCON = 0b01100111; // internal OSC set to 4MHZ
I can't find anything about this code into the datasheet.
BTW, if we use this pins as programmed we can't use rs232 communication in the future and for now no incircuit programming.
Wat code is this ?
OSCCON = 0b01100111; // internal OSC set to 4MHZ
I can't find anything about this code into the datasheet.
Code:
bit 7 Unimplemented: Read as ‘0’ bit 6-4 IRCF<2:0>: Internal Oscillator Frequency Select bits 111 = 8MHz 110 = 4 MHz (default) 101 = 2MHz 100 = 1MHz 011 = 500kHz 010 = 250kHz 001 = 125kHz 000 = 31 kHz (LFINTOSC) bit 3 OSTS: Oscillator Start-up Time-out Status bit(1) 1 = Device is running from the external clock defined by FOSC<2:0> of the Configuration Word register 0 = Device is running from the internal oscillator (HFINTOSC or LFINTOSC) bit 2 HTS: HFINTOSC Status bit (High Frequency – 8 MHz to 125 kHz) 1 = HFINTOSC is stable 0 = HFINTOSC is not stable bit 1 LTS: LFINTOSC Stable bit (Low Frequency – 31 kHz) 1 = LFINTOSC is stable 0 = LFINTOSC is not stable bit 0 SCS: System Clock Select bit 1 = Internal oscillator is used for system clock 0 = Clock source defined by FOSC<2:0> of the Configuration Word register
#1232
Senior Member
Hi Rob,
0b tell the compiler the the number is binary and the rest of that line is in the datasheet.
01100111 The upper nibble selects the osc speed the lower nibble selects rc osc and a few other things.
#1233
Thread Starter
Senior Member
Joined: Dec 2005
Posts: 548
Likes: 0
Received 0 Likes
on
0 Posts
From: Alkmaar, NETHERLANDS
ORIGINAL: COM
Hi Rob,
0b tell the compiler the the number is binary and the rest of that line is in the datasheet.
01100111 The upper nibble selects the osc speed the lower nibble selects rc osc and a few other things.
Hi Rob,
0b tell the compiler the the number is binary and the rest of that line is in the datasheet.
01100111 The upper nibble selects the osc speed the lower nibble selects rc osc and a few other things.
#1234
Senior Member
Rob here is the modified code. RA4 and RA5 are output and RA2 is input. Whats too fast?
void main()
{
const char tspark[]={ 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 18, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 43, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, 64,
64, 64, 65, 65, 63, 63, 64, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 68, 69, 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 104, 105, 105, 106, 106, 107, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 112, 113, 113};
char tspk,spark, t0;
OSCCON = 0b01100111; // internal OSC set to 4MHZ
ANSEL = 0; // Disable Analog channels
CMCON0 = 0x07; // Disable Comparitors
TRISIO = 0x0C; // set GPIO1 for input, all others for output
GPIO = 0x00; // set output to SCR low
OPTION_REG = 0x07; // set to 07=256 RE - tmr0 SOURCE INT CLOCK, 06=1:128 PRESCALER
TMR2 = 0;
PR2 = 255;
T2CON = 0x07; // start TMR2 counter 1:16
INTCON = 0; // clear INTCON
// Following table is based on 360 degree timing arc & 40 deg starting arc (South pole of magnet triggers Hall switch)
// table based on a polynomial and limits the min delay to 15 TMR2 cycles
// the spark flag is a one shot to prevent continuous sparking on a Hall low signal
while(1) // loop forever
{
while( GPIO.F2 ^ 1) // wait for high pulse on Hall switch
{
spark = 1;
} // North pole of magnet has passed
while(spark)
{
t0 = TMR0;
TMR0 = 0; // start new rev count
if(INTCON&4) tspk=255; // <<<< ADD THIS LINE TO YOUR CODE!!! 917> RPM 255x16uS=4,080mS
else tspk = tspark[t0]; // use table lookup for spark delay
T2CON = 0x07; // start TMR2 counter 1:16
TMR2= 0; // clear spark timer
while(TMR2 < tspk); // loop until timeout to send spark
GPIO ^= 0x30; // take ground off the SCR Pin GPIO4 and 6
delay_us(50); // 23 us delay
GPIO ^= 0x30; // sends a ground to the SCR gate
spark = 0;
INTCON = 0; // clear INTCON
} // end while spark loop
} // end loop forever
} // end of program
////Notes
//
// ; At a engine speed of 1200 RPM;
// ;
// ; 1200 / 60 = 20 revs per second
// ; 1 / 20 = 50mS per rev
// ; 1 rev = 360 degrees
// ;
// ; 36 degrees at 1200 RPM = (36 / 360) X 50 = 5mS
// ;
// ; 100uS loop time
// ; 4MHz clock / 4 = 1MHz instruction cycle
// ; cycle time = 1/1MHz = 100uS
// ; 100uS/100uS = 100 cycles
// ; prescaler set to divide by 4
// ; preset TMR0 = 231, when = 0 = 100uS
// ; 231 to 255 = 25 x 4(prescaler) = 100
// -O-
// VDD o o RA GND
// SCR RA5 o o RA0
// Strobelight RA4 o o RA1
// MCLR RA3 o o RA2 Hall input
//
#1235
Thread Starter
Senior Member
Joined: Dec 2005
Posts: 548
Likes: 0
Received 0 Likes
on
0 Posts
From: Alkmaar, NETHERLANDS
The question was , why not the hex-format 67 ?
OSCCON = 0x67
But if this works, why change it ?
OSCCON = 0x67
But if this works, why change it ?
#1236
Member
Joined: Sep 2006
Posts: 34
Likes: 0
Received 0 Likes
on
0 Posts
From: Steenwijkerwold, NETHERLANDS
During programming using the rcd programmer with Winpic i get the following error:
<font color="#ff0000">Resultaat van LoadHex: LastProgAdr=0x000242 LastDataAdr=0x0020FF (D:\Modelvliegen Evert\Saito benzine\CDI\CDI1.hex)
Programmeren...
Wissen ("bulk" of "Chip")
Wis chipgebruik algorithm "ERASE_16F62xA" .
Programmeren CODE, 0x000000..0x000242
Programmering 0x000000..0x000242, algo="16Fxx", CanRead=0 .
Vergelijk 0x000000..0x000242
Vergelijk foutr: 000006: lees 000045, benodigd 00008A
Vergelijk foutr: 000007: lees 003FFF, benodigd 000820
Vergelijk foutr: 000008: lees 003FFF, benodigd 000082
Vergelijk foutr: 000009: lees 003FFF, benodigd 000008
meerdere vergelijk fouten, onmogelijk deze alle te tonen (total=573)
Programmeren CONFIG, 0x002000..0x002007
Programmering 0x002000..0x002007, algo="CONFIG_MEM_16xxx", CanRead=0 .
Vergelijk 0x002000..0x002007
FOUT: Programmering Mislukt!
</font><font color="#000000">I'm using Winpic fot programming. If i'm programming with the PIC directly on de RCDprogrammer i don't get the error but then the CDI 'still isn't working.
Who can tell me wat's wrong?</font>
<font color="#ff0000">Resultaat van LoadHex: LastProgAdr=0x000242 LastDataAdr=0x0020FF (D:\Modelvliegen Evert\Saito benzine\CDI\CDI1.hex)
Programmeren...
Wissen ("bulk" of "Chip")
Wis chipgebruik algorithm "ERASE_16F62xA" .
Programmeren CODE, 0x000000..0x000242
Programmering 0x000000..0x000242, algo="16Fxx", CanRead=0 .
Vergelijk 0x000000..0x000242
Vergelijk foutr: 000006: lees 000045, benodigd 00008A
Vergelijk foutr: 000007: lees 003FFF, benodigd 000820
Vergelijk foutr: 000008: lees 003FFF, benodigd 000082
Vergelijk foutr: 000009: lees 003FFF, benodigd 000008
meerdere vergelijk fouten, onmogelijk deze alle te tonen (total=573)
Programmeren CONFIG, 0x002000..0x002007
Programmering 0x002000..0x002007, algo="CONFIG_MEM_16xxx", CanRead=0 .
Vergelijk 0x002000..0x002007
FOUT: Programmering Mislukt!
</font><font color="#000000">I'm using Winpic fot programming. If i'm programming with the PIC directly on de RCDprogrammer i don't get the error but then the CDI 'still isn't working.
Who can tell me wat's wrong?</font>
#1238
Member
Joined: Sep 2006
Posts: 34
Likes: 0
Received 0 Likes
on
0 Posts
From: Steenwijkerwold, NETHERLANDS
Now with picprog4u this message shows after programming the PIC.
<span style="color: #ff0000">[15:14:04] Hex file successfully loaded.
[15:14:27] Programming device was begun.
[15:14:27] Erasing device.
[15:14:27] Erasing Data memory.
[15:14:28] Device was erased.
[15:14:28] Erasing device entirely.
[15:14:29] Device has been erased entirely.
[15:14:29] Writing into program memory.
[15:14:40] Writing into program memory finished.
[15:14:42] Writing configuration word finished.
[15:14:42] Writing into configuration memory finished.
[15:14:42] Writing into data memory.
[15:14:43] Writing into data memory finished.
[15:14:43] Programming device finished.
[15:14:43] Verifying device.
[15:14:48] Verify failed at address 0003h,required:1283, read:3FFF
[15:14:49] Verifying configuration word.
[15:14:49] Verifying failed! There are 577 error(s)!
[15:14:49] Verifying failed!
</span><span style="">I'm not getting it to work. Nothing happens power up the cdi.
What's wrong?
</span>
<span style="color: #ff0000">[15:14:04] Hex file successfully loaded.
[15:14:27] Programming device was begun.
[15:14:27] Erasing device.
[15:14:27] Erasing Data memory.
[15:14:28] Device was erased.
[15:14:28] Erasing device entirely.
[15:14:29] Device has been erased entirely.
[15:14:29] Writing into program memory.
[15:14:40] Writing into program memory finished.
[15:14:42] Writing configuration word finished.
[15:14:42] Writing into configuration memory finished.
[15:14:42] Writing into data memory.
[15:14:43] Writing into data memory finished.
[15:14:43] Programming device finished.
[15:14:43] Verifying device.
[15:14:48] Verify failed at address 0003h,required:1283, read:3FFF
[15:14:49] Verifying configuration word.
[15:14:49] Verifying failed! There are 577 error(s)!
[15:14:49] Verifying failed!
</span><span style="">I'm not getting it to work. Nothing happens power up the cdi.
What's wrong?
</span>
#1239
Thread Starter
Senior Member
Joined: Dec 2005
Posts: 548
Likes: 0
Received 0 Likes
on
0 Posts
From: Alkmaar, NETHERLANDS
Your computer cant generate the programm Voltage of 13 Volt from the com-port.
A small modification must do the job
http://www.circuitsonline.net/schake...e-voeding.html
A small modification must do the job
http://www.circuitsonline.net/schake...e-voeding.html
#1241
Senior Member
Joined: Nov 2005
Posts: 805
Likes: 0
Received 0 Likes
on
0 Posts
From: Hamburg,
PA
Charlie, I built the RCD programmer version # 2.3 and it has an extra capacitor on the board to eliminate the problems he is having.. In fact, before it will program a pic, it says, "charging the capacitor" and then it goes into programming mode.. It hasn't failed me yet.. always provides the 13 volts needed. The programmer works flawlessly.
Have you made a board design yet for the 12f683 chips? I'm getting kinda anxious to build it and test it. Maybe Rob has already made a PCB, I don't know...been offline for awhile and missed all the pm's and posts. Also, have you added the test function back into the program? Haven't heard from Nyemi since he posted his code. I knew he was working on doing it for the 16f628 pic. I am still using his code without the test features.. My engines start easily and run fine with it.
John
Have you made a board design yet for the 12f683 chips? I'm getting kinda anxious to build it and test it. Maybe Rob has already made a PCB, I don't know...been offline for awhile and missed all the pm's and posts. Also, have you added the test function back into the program? Haven't heard from Nyemi since he posted his code. I knew he was working on doing it for the 16f628 pic. I am still using his code without the test features.. My engines start easily and run fine with it.
John
#1242
Senior Member
Hello John,
I have built a board for the 12F pic but I have a few things I need to iron out. I have not added the test function. I will and post the code. I will keep you posted about the board.
I have built a board for the 12F pic but I have a few things I need to iron out. I have not added the test function. I will and post the code. I will keep you posted about the board.
#1243
Thread Starter
Senior Member
Joined: Dec 2005
Posts: 548
Likes: 0
Received 0 Likes
on
0 Posts
From: Alkmaar, NETHERLANDS
I was allready start to make a pcb, but then there was a nasty virus and distoryed some important files.
Sunday a finish a clean install and now I have to fine tune the computer befor I can install the pcb-program.
I beleve I set the testfunction into the program of Nyemi allready online........somewhere.......if not, tonight I'll doit.
@Charlie, please use pin 6 and/or 7 for testfunction with jumpers placed to ground to test.
No jumpers is normal mode, pullup resitors activate in program !, with jumpers is test mode.
Sunday a finish a clean install and now I have to fine tune the computer befor I can install the pcb-program.
I beleve I set the testfunction into the program of Nyemi allready online........somewhere.......if not, tonight I'll doit.
@Charlie, please use pin 6 and/or 7 for testfunction with jumpers placed to ground to test.
No jumpers is normal mode, pullup resitors activate in program !, with jumpers is test mode.
#1245
Senior Member
If you guys want to use a bootloader then we need to switch back to either a 16F628,16F628a or one that the bootloader will work on. I have the bootloader source. the only thing is you need to use a level shifter like a max232 or similer to work. so that is something else to make. I have some soic devices and I am looking at putting it on the timer board.
#1246
Member
Joined: Sep 2006
Posts: 34
Likes: 0
Received 0 Likes
on
0 Posts
From: Steenwijkerwold, NETHERLANDS
ORIGINAL: COM
Evert1969
Why not just buy a pic programmer.The don't cost that much.
Evert1969
Why not just buy a pic programmer.The don't cost that much.
Because i've allready built one. If it works for other guys it should also work for me i guess. I'm only using it for programming the cdi so i want to keep this inexpensive.
When checking hardware in picprog4u i get 12,7V at pin 4, and 5,5V at pin 12 and 13.
I've used the 100uf capacitor. I'll try the 470uf like in the 2.3 version.
#1247
Senior Member
Joined: Nov 2005
Posts: 805
Likes: 0
Received 0 Likes
on
0 Posts
From: Hamburg,
PA
I use version 2.3 all the time with great results.... If you are programming a 16f628A chip, you must use the adapter socket shown on the RCD site. If you are forgetting to use that adapter socket, you will get the errors you are seeing when programming.
Hope this helps...
John
Hope this helps...
John
#1248
Member
Joined: Sep 2006
Posts: 34
Likes: 0
Received 0 Likes
on
0 Posts
From: Steenwijkerwold, NETHERLANDS
I'm glad a made the CDI with a PIC bracket so i can take the Pic out and put it directly on the rcd programmer. And yes, i'm using the adapter for this. Grrrrrr. After changing the capacitor to 470uf it still doesn't work and getting errors with verifying.
Would it be an idea to adapt the programmer to the 2.3 version and set voltage on mclr at 5V . Then use low voltage programming? Would that give the programmer more time to program and verify before the capacitor is discharged?
Would it be an idea to adapt the programmer to the 2.3 version and set voltage on mclr at 5V . Then use low voltage programming? Would that give the programmer more time to program and verify before the capacitor is discharged?
#1249
Senior Member
Joined: Nov 2005
Posts: 805
Likes: 0
Received 0 Likes
on
0 Posts
From: Hamburg,
PA
Maybe you should just build the version 2.3 programmer. I had built the version 2.2 and never got it to work right. Then I built the 2.3 and have had no problems since. Some of the pentium computers have an economized mother boardwhere they cut back on available power to the rs-232 ports and will not ever produce the correct voltages..I have one of those computers so I know they won't work right.
If you can update the current board to version 2.3, it should work.
John
If you can update the current board to version 2.3, it should work.
John
#1250
Senior Member
Joined: Nov 2005
Posts: 805
Likes: 0
Received 0 Likes
on
0 Posts
From: Hamburg,
PA
The problem as I saw it was that the voltage available to program does die off on version 2.2 drastically during programming. I measured voltages on the version 2.3 and got 13 volts consistently..due to the pulse charging of the 470Uf cap. It definitly made a difference in programming success for me..
John
John



