CDI gr8flyer55
#377
Senior Member
Join Date: Nov 2005
Location: Hamburg,
PA
Posts: 805
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Jake, made all the recommended edits, changed my curve slightly to reflect the redline limits per rpms, compiled (again), programmed 2 chips this time, put one aside marked test#8, installed the other one. Fired up the engine in the dark and success! Timing light LED works great too. It tracks tru to the curve, accelerating and decelerating. Easy to start, hot restarts are a breeze.
Now I have two test timers working with a total of 4 separate curves. Added a pin and alligator clip to one timer to ground connection. Works for changing the curve great. Also when used as a kill to pin #3 it stops the ignition.
A side note here from the last edits you mentioned before the final edits. When you first power up, it waits about 1 second, fires one spark, then is ready to accept sensor input. Working great Jake!! Give yourself a big pat on the back, job well done!
Very happy with all the work you did. Any tweaking you do from here on out is icing on the cake.
John
Now I have two test timers working with a total of 4 separate curves. Added a pin and alligator clip to one timer to ground connection. Works for changing the curve great. Also when used as a kill to pin #3 it stops the ignition.
A side note here from the last edits you mentioned before the final edits. When you first power up, it waits about 1 second, fires one spark, then is ready to accept sensor input. Working great Jake!! Give yourself a big pat on the back, job well done!
Very happy with all the work you did. Any tweaking you do from here on out is icing on the cake.
John
#378
Join Date: Mar 2009
Location: xnot applicable, AUSTRALIA
Posts: 293
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Jake,
Just wondering with all this testing going on , how much would be entailed in writing a small program say for 12F683 that could take inputs from the hall effect and the existing micro output, take the time difference and with rpm as a reference, output degrees delay on an LCD display.
As John said earlier, playing in and around a spinning prop gets a bit iffy at times so just a thought to keep away from the prop with the timing light LED.
Just wondering with all this testing going on , how much would be entailed in writing a small program say for 12F683 that could take inputs from the hall effect and the existing micro output, take the time difference and with rpm as a reference, output degrees delay on an LCD display.
As John said earlier, playing in and around a spinning prop gets a bit iffy at times so just a thought to keep away from the prop with the timing light LED.
#379
Senior Member
Join Date: Jan 2012
Location: South Florida
Posts: 375
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
This is way over my head. I don't even know what CDI stands for!
I looked at the video too. All I saw was a little green light. It didn't look like it was flashing to me. It looked like it was just on steadily. If it was flashing at 800 times a minute, I certainly didn't see that. I can't count to 800 in a minute, let alone see anything flashing that fast ... no one can.
I'm outta here. Talk like this never made anyone the hit of the party or got them a woman. I'm headed to a bar for a drink and to hit on women.
I looked at the video too. All I saw was a little green light. It didn't look like it was flashing to me. It looked like it was just on steadily. If it was flashing at 800 times a minute, I certainly didn't see that. I can't count to 800 in a minute, let alone see anything flashing that fast ... no one can.
I'm outta here. Talk like this never made anyone the hit of the party or got them a woman. I'm headed to a bar for a drink and to hit on women.
ORIGINAL: av8tor1977
This is why I never followed the "new" CDI threads. Way over the heads of most people in this forum. I can build small do it yourself electronics projects, and usually figure out schematics, but I've never seen anything that a layman could understand, follow, nor build in your posts. If it ever becomes a simple, easily understandable by a layman/beginning electronics experimenter project, then I would be interested, as I imagine many more here in the forum might. Meanwhile, you are just "talking far over the heads" of most people here I would venture to say...
AV8TOR
This is why I never followed the "new" CDI threads. Way over the heads of most people in this forum. I can build small do it yourself electronics projects, and usually figure out schematics, but I've never seen anything that a layman could understand, follow, nor build in your posts. If it ever becomes a simple, easily understandable by a layman/beginning electronics experimenter project, then I would be interested, as I imagine many more here in the forum might. Meanwhile, you are just "talking far over the heads" of most people here I would venture to say...
AV8TOR
#380
Senior Member
RE: CDI gr8flyer55
how much would be entailed in writing a small program say for 12F683 that could take inputs from the hall effect and the existing micro output, take the time difference and with rpm as a reference, output degrees delay on an LCD display
A 12F683 by itself won't work for writing to a lcd. you need a pic with more pins or use a serial lcd.
But that would be a neat little device.
#381
Join Date: Mar 2009
Location: xnot applicable, AUSTRALIA
Posts: 293
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Hi Com,
I found this circuit here that uses a 75HC595 shift register that only require 3 lines from the micro.
Might end up not being quick enough though.
http://www.electronics-lab.com/proje...015/index.html
I found this circuit here that uses a 75HC595 shift register that only require 3 lines from the micro.
Might end up not being quick enough though.
http://www.electronics-lab.com/proje...015/index.html
#383
Join Date: Oct 2005
Location: Parma Heights,
OH
Posts: 168
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
ORIGINAL: COM
A 12F683 by itself won't work for writing to a lcd. you need a pic with more pins or use a serial lcd.
But that would be a neat little device.
how much would be entailed in writing a small program say for 12F683 that could take inputs from the hall effect and the existing micro output, take the time difference and with rpm as a reference, output degrees delay on an LCD display
But that would be a neat little device.
It is a neat idea, and I mention the above only to illustrate that it is doable maybe as a future refinement.
John
#384
Senior Member
RE: CDI gr8flyer55
I am just a novice at programming
That sounds interesting. If you are doing it in asm then you are more than a novice programmer.... at least in my opinion. I might take a stab at doing it. I will have to think on it a little more though.
#385
Join Date: Mar 2009
Location: xnot applicable, AUSTRALIA
Posts: 293
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
John,
I've been trying to self-educate on assembly for the last 6 months or so. I can manage so far to dig my way through existing code and try to make sense of it all but it is a long hard haul.
Would appreciate a copy.
I've been trying to self-educate on assembly for the last 6 months or so. I can manage so far to dig my way through existing code and try to make sense of it all but it is a long hard haul.
Would appreciate a copy.
#389
Senior Member
Join Date: Aug 2011
Location: Moscow,
ID
Posts: 144
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
ORIGINAL: BobbyMcGee
I'm outta here. Talk like this never made anyone the hit of the party or got them a woman. I'm headed to a bar for a drink and to hit on women.
I'm outta here. Talk like this never made anyone the hit of the party or got them a woman. I'm headed to a bar for a drink and to hit on women.
I don't see all that much more that can be done with the current processor. It doesn't have a UART for serial communications, and in any case we only have one spare pin left and it's currently tied to ground.
We're pretty limited by our low pin count at the moment. With the 12F1840 we can play around with things more by moving features to control via the serial port. Any device that can read serial output will be able to display different things.
-Jake
#390
Join Date: Mar 2009
Location: xnot applicable, AUSTRALIA
Posts: 293
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
ORIGINAL: jpanhalt
If someone wants the code to work on, I can send it to you, but it is quite rough. I am just a novice at programming.
It is a neat idea, and I mention the above only to illustrate that it is doable maybe as a future refinement.
John
If someone wants the code to work on, I can send it to you, but it is quite rough. I am just a novice at programming.
It is a neat idea, and I mention the above only to illustrate that it is doable maybe as a future refinement.
John
Jake,
Idea was as a stand-alone device.
I'll see how far I can get, might take me a while though, fairly new at assy. and although there are many sources for information, it's difficult to narrow down particular enquiries. Thanks again....Jeff
#391
Senior Member
Join Date: Aug 2011
Location: Moscow,
ID
Posts: 144
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
I would probably not be too difficult to output a PWM signal in relation to the RPM. All the hardware is still unused, all I use in the program is Timer1 and the GP2 interrupt.
You could also use the voltage reference output to put out a voltage in reference to the RPM (on GP1/pin 6). That's a fairly common technique. You can then read it with just a volt meter, or interface it with some other sort of readout.
In any case you'll save yourself a world of pain by just learning C. Assembly is terribly unpopular and just not that well suited for programming anything complex. C is every serious programmer's first language and everything after that is relatively easy. Learning assembly is kind of like learning how to hand stitch when you want to be a clothing designer. Sure, you need to know the basics of sewing, but in the real world most clothing is made with sewing machines. It's interesting to know the mechanics of how each kind of stitch is done step-by-step, but you could also just flip a switch on the machine and start learning how garments are made.
I just kind of find that assembly is tedious and non-portable, and it distracts from the big picture of the whole program. With today's optimizing compilers you'll usually end up spending twice as much time writing something in assembly, but unless you're very, very good the C compiler will usually produce better code in the end.
Check out...
http://www.gooligum.com.au/tut_midrange.html
These guys have excellent tutorials on PIC programming. They teach everything in assembly first, then they have the same lessons in C. For every example they compare the lines of code, size, and speed for assembly vs. C. I referred to these tutorials quite a bit when writing the CDI program.
-Jake
You could also use the voltage reference output to put out a voltage in reference to the RPM (on GP1/pin 6). That's a fairly common technique. You can then read it with just a volt meter, or interface it with some other sort of readout.
In any case you'll save yourself a world of pain by just learning C. Assembly is terribly unpopular and just not that well suited for programming anything complex. C is every serious programmer's first language and everything after that is relatively easy. Learning assembly is kind of like learning how to hand stitch when you want to be a clothing designer. Sure, you need to know the basics of sewing, but in the real world most clothing is made with sewing machines. It's interesting to know the mechanics of how each kind of stitch is done step-by-step, but you could also just flip a switch on the machine and start learning how garments are made.
I just kind of find that assembly is tedious and non-portable, and it distracts from the big picture of the whole program. With today's optimizing compilers you'll usually end up spending twice as much time writing something in assembly, but unless you're very, very good the C compiler will usually produce better code in the end.
Check out...
http://www.gooligum.com.au/tut_midrange.html
These guys have excellent tutorials on PIC programming. They teach everything in assembly first, then they have the same lessons in C. For every example they compare the lines of code, size, and speed for assembly vs. C. I referred to these tutorials quite a bit when writing the CDI program.
-Jake
#392
Join Date: Mar 2009
Location: xnot applicable, AUSTRALIA
Posts: 293
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Thanks for the advice Jake, much appreciated.
The pic lessons you refer to are the ones I'm using at present.(Gooligums)
I asked many places and some advised that learning the assy would be an asset which-ever way you go so that's pretty much why I chose that route.
Always like to have a full understanding of what is happening and why.
Left over from the early days of learning electronics I guess.
I do have all the other lessons though.
The pic lessons you refer to are the ones I'm using at present.(Gooligums)
I asked many places and some advised that learning the assy would be an asset which-ever way you go so that's pretty much why I chose that route.
Always like to have a full understanding of what is happening and why.
Left over from the early days of learning electronics I guess.
I do have all the other lessons though.
#393
Join Date: Oct 2005
Location: Parma Heights,
OH
Posts: 168
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Assembly versus C discussions for newbies (I include myself as a newbie) are like discussing which is "better" Metric or Imperial measures. They never end. Each has its place. The arguments supporting C versus Assembly can be used to support using other HLL's instead of C. If you write relocatable Assembly and use assembler directives, it even starts to look like C, minus the formatting characters. Some serious programmers still use Assembly. Check out the Microchip forums and search on Olin Lathrop for examples. You will find others who also use Assembly.
Anyway, I am sorry to have unintentionally started that discussion. C is a great programming language to use for some microcontrollers. I use Assembly, because that is all I know even a little of, and its full featured compiler is included in MPLAB free. I also have not ventured beyond the mid-range PIC's (i.e., 10F, 12F and 16F series). Note, other compilers and simulators are available that have a more graphical feel to them.
Now for tutorials, I find Gooligum excellent, but like many tutorials, it will sometimes introduce something without fully explaining it at the newbie level first. Here is a list of some other tutorials and resources I have used:
http://www.amqrp.org/elmer160/lessons/
http://www.mstracey.btinternet.co.uk/index.htm
http://winpicprog.co.uk/pic_tutorial.htm
http://www.gooligum.com.au/tutorials.html
http://www.mikroe.com/en/books/picbook/0_Uvod.htm
For the Art of Assembly Language:
http://webster.cs.ucr.edu/AoA/Windows/HTML/AoATOC.html
For code examples, math routines, radix conversions, serial communication, etc:
http://www.piclist.com/techref/piclist/index.htm
When I first started Assembly, Gooligum was not around, and I had the first three options listed. I tried to use all three, but found that was confusing. I settled on Elmer160. Now that I have written a few programs, I rarely go back to those first three tutorials and either go to Gooligum, PicList, or the Art of Assembly. I usually hit PicList first if I am looking for code examples and Gooligum if I am missing a concept.
Edit: Winpicprog have also been converted to C language tutorials. See: http://www.electro-tech-online.com/
John
Anyway, I am sorry to have unintentionally started that discussion. C is a great programming language to use for some microcontrollers. I use Assembly, because that is all I know even a little of, and its full featured compiler is included in MPLAB free. I also have not ventured beyond the mid-range PIC's (i.e., 10F, 12F and 16F series). Note, other compilers and simulators are available that have a more graphical feel to them.
Now for tutorials, I find Gooligum excellent, but like many tutorials, it will sometimes introduce something without fully explaining it at the newbie level first. Here is a list of some other tutorials and resources I have used:
http://www.amqrp.org/elmer160/lessons/
http://www.mstracey.btinternet.co.uk/index.htm
http://winpicprog.co.uk/pic_tutorial.htm
http://www.gooligum.com.au/tutorials.html
http://www.mikroe.com/en/books/picbook/0_Uvod.htm
For the Art of Assembly Language:
http://webster.cs.ucr.edu/AoA/Windows/HTML/AoATOC.html
For code examples, math routines, radix conversions, serial communication, etc:
http://www.piclist.com/techref/piclist/index.htm
When I first started Assembly, Gooligum was not around, and I had the first three options listed. I tried to use all three, but found that was confusing. I settled on Elmer160. Now that I have written a few programs, I rarely go back to those first three tutorials and either go to Gooligum, PicList, or the Art of Assembly. I usually hit PicList first if I am looking for code examples and Gooligum if I am missing a concept.
Edit: Winpicprog have also been converted to C language tutorials. See: http://www.electro-tech-online.com/
John
#394
Senior Member
Join Date: Jul 2010
Location: Alkmaar, NETHERLANDS
Posts: 404
Likes: 0
Received 0 Likes
on
0 Posts
#395
Join Date: Mar 2009
Location: xnot applicable, AUSTRALIA
Posts: 293
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Thanks so much to everyone for the programming links and advice.
Many approaches to consider.
John,
I have also found it difficult to understand some explanations in certain tutorials and tend to jump over to another like Mikro to get some grasp of what they mean.
Started to think it was just my brain getting older and unable to suck in the info like it used to do.
Gompy,
Had a quick look at the site in UK ...getting a bit late here so look more tomorrow..
Thanks again.......
Many approaches to consider.
John,
I have also found it difficult to understand some explanations in certain tutorials and tend to jump over to another like Mikro to get some grasp of what they mean.
Started to think it was just my brain getting older and unable to suck in the info like it used to do.
Gompy,
Had a quick look at the site in UK ...getting a bit late here so look more tomorrow..
Thanks again.......
#396
Senior Member
Join Date: Jul 2010
Location: Alkmaar, NETHERLANDS
Posts: 404
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Nice / cheap program and hardware to learn programming.
http://www.hackinglab.org/pinguino/index_pinguino.html
http://www.hackinglab.org/pinguino/index_pinguino.html
#397
Senior Member
Join Date: Aug 2011
Location: Moscow,
ID
Posts: 144
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
It's way too easy to get sucked into debates! Before I started here I hadn't used PICs before or seen assembly in a very long time. PIC programmers seem to be one of the few assembly holdouts left.
I've always had a strange combination of respect, pity, and disdain for assembly programmers. On the one hand it's a tribute to their skills that they have the brains to think like a computer, on the other hand things are so much easier in C so they either spend a lot more time or are simply a lot better than me. By the same token, it often seems so arrogant for them to think that they can directly manipulate the hardware in a better way than the C compiler writers.
But there's really not much of a debate over the two. Assembly is not a real programming language, it's simply directly manipulating the hardware. I know that I don't want to have to learn each instruction of every processor, and that even if I did, 9 times out of 10 I'm not going to come up with a better way to make the hardware implement an "if" statment, "for" loop, or do basic math.
I commented every line of code in Nyemi's program, looking up lot's of the instructions, and I still don't think I really fully understood exactly what it was doing at all times.
My program seemed to work out great though. Nyemi and I both seem to have the same 51 uS algorithm correction value, so apparently our code is exactly equally efficient. I run at twice the speed (8 MHz), but I'm also loading 16-bit table values, using 16-bit timer values, and doing dividing and rounding on the revolution timer values.
In any case, the main reason for us to use C in an open source community project is because C is much more readable, portable, and it's 90% of programmers' first language. I'd love to have more devs onboard, and I'm willing to put this project on Github or Google Code so we could all work on it simultaneously. If anyone sees anything in the code they don't understand 100%, please ask me about it. Fresh eyes and beginners not understanding something and asking about it is the best way I know of to find better ways to do something. My math skills are pretty weak, as far as programmers go, so I'd love to have some math experts helping out.
I also haven't written much for Windows/GUI programs in the past. So it would be great if someone could help me write an interface program. I'm not looking forward to doing that all that much. If anyone knows a good way to easily turn a spreadsheet into a standalone program that the source code can still be worked on that would be pretty nice. Let me know!
In other news... I'm working on loading the user settings into the tables so they will also switch with the table switch. That should be handy for tweaking startup settings. I'm also working on having the spreadsheet directly generate the hex file so that people don't have to install and use the compiler for each change.
-Jake
I've always had a strange combination of respect, pity, and disdain for assembly programmers. On the one hand it's a tribute to their skills that they have the brains to think like a computer, on the other hand things are so much easier in C so they either spend a lot more time or are simply a lot better than me. By the same token, it often seems so arrogant for them to think that they can directly manipulate the hardware in a better way than the C compiler writers.
But there's really not much of a debate over the two. Assembly is not a real programming language, it's simply directly manipulating the hardware. I know that I don't want to have to learn each instruction of every processor, and that even if I did, 9 times out of 10 I'm not going to come up with a better way to make the hardware implement an "if" statment, "for" loop, or do basic math.
I commented every line of code in Nyemi's program, looking up lot's of the instructions, and I still don't think I really fully understood exactly what it was doing at all times.
My program seemed to work out great though. Nyemi and I both seem to have the same 51 uS algorithm correction value, so apparently our code is exactly equally efficient. I run at twice the speed (8 MHz), but I'm also loading 16-bit table values, using 16-bit timer values, and doing dividing and rounding on the revolution timer values.
In any case, the main reason for us to use C in an open source community project is because C is much more readable, portable, and it's 90% of programmers' first language. I'd love to have more devs onboard, and I'm willing to put this project on Github or Google Code so we could all work on it simultaneously. If anyone sees anything in the code they don't understand 100%, please ask me about it. Fresh eyes and beginners not understanding something and asking about it is the best way I know of to find better ways to do something. My math skills are pretty weak, as far as programmers go, so I'd love to have some math experts helping out.
I also haven't written much for Windows/GUI programs in the past. So it would be great if someone could help me write an interface program. I'm not looking forward to doing that all that much. If anyone knows a good way to easily turn a spreadsheet into a standalone program that the source code can still be worked on that would be pretty nice. Let me know!
In other news... I'm working on loading the user settings into the tables so they will also switch with the table switch. That should be handy for tweaking startup settings. I'm also working on having the spreadsheet directly generate the hex file so that people don't have to install and use the compiler for each change.
-Jake
#398
Senior Member
Join Date: Aug 2011
Location: Moscow,
ID
Posts: 144
Likes: 0
Received 0 Likes
on
0 Posts
RE: CDI gr8flyer55
Thanks for the tutorial links jphanalt. I had a fairly hard time finding PIC tutorials and examples for C when I started.
I liked the Googlium tutorials so well I made an offline version and removed the PDF security so I could cut and paste from them. If anyone wants a copy of those, just email me.
-Jake
I liked the Googlium tutorials so well I made an offline version and removed the PDF security so I could cut and paste from them. If anyone wants a copy of those, just email me.
-Jake