A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
Thanks to Ayman, John and rtstofer for all the help!! I think the STAMP is out and one of the PIC Micros are in!! Where can I find more info about these little jewels? How expensive are they? This is probably a given, but I have to ask: Do they come with software tools and can I plug the device into a port on my computer, write the code in a program supplied by the manufacturer and then send the program through the port into memory on the board, then place the device and the engine in the airplane? Sounds like fun!!! More consideration on the resolution/granularity of the clock. Ideally the ignition advance is adjustable in single integer degree increments, from 0 to 36 (experimentation will determine the true range). "When the free-running clock matches the output compare it will trigger the ignition" - The process by which the device will make this comparison will take time and that increment of time will have to be small enough to fit within 1/2 degree rotation of the crankshaft at 14,000 RPM. For the clock to hit the mark within 1/2 of a degree of crankshaft rotation, at 14,000 RPM, its resolution will have to be a minimum of: 1/2 deg. / 360 deg. x .00428 secs/rev. = 0.000005944 seconds, or 168,224 Hz ?!?!?!?!?!?! To my novice ear this is sounding pretty incredibly fast ....... is it possible? I'm assuming the clock is a chip that can be removed and replaced on the board of the device, do they offer faster clocks if needed? This is very exciting and I'm looking forward to it. Thanks for all the help so far and I'm sure I'll have more questions, Tony J. |
|
|
|
I make the follwing suggestions: First, for $8.00 you can buy a 16F877 40 pin 20 MHz preprogrammed with a boot loader in the upper 2k of memory. That leaves 6k for you and that is a LOT. Check out www.junun.org and wander through the Mark III stuff until you see the PIC chip. Then head over to www.melabs.com for their prototype board for the 40 pin devices. You might also consider the "completion kit" which has the voltage regulator and a bunch of stuff. What I don't think it has is a 20 MHz crystal. While you are at junun.org, follow the link and pick up the latest Bot Loader software - free. This beats trying to use Hyperterminal or some equivalent package. Second, go to www.microchip.com and get MPLAB IDE 6.20 (also free) and you have the best assembly language product available for your chip. If you want speed you will probably have to ignore C - it can be difficult to figure out how much time the library routines take. For what it is worth there are FREE version of Hi Tech C (call PIC C Lite) and cc5x. PIC C Lite is quite good in that it is closer to ANSI C. When you start to order stuff buy a MAX233 chip to convert the PIC TTL signals to RS232 for your computer - the 233 doesn't require support capacitors. You can get some idea how to hook it up at junun.org - look at the schematic for the Mark III (also free). Realize that you are not using the same chip so you are looking at concepts, not wiring. Of course, you could use the DS232 (MAX232) with the external capacitors and follow the wiring exactly. Now with a straight through RS232 cable you are in business. Now, about that speed problem. Perhaps the PIC can't keep up with 6 uS pulse widths although some might. How about using the 20 MHz clock output of the PIC and feeding a programmable counter? Assuming count down for the moment, when the count reaches 0 fire a 1 shot to start the fire. Use the same signal to notify the PIC that the counter needs updating via an external interrupt. The PIC interrupt routine figures out what value to stuff in the counter, loads it and sets it off counting. You have to deal with the latency issue - time is going on while you are doing the load but that can be handled by loading a smaller value than required by time alone. You would be counting in 50 nS bits so maybe the counter needs to be 7 bytes wide. Or maybe you start counting from 36 degrees advance with a count value of 0 with TDS with a higher count (or delay). This wouldn't take as many bits. You actually need to worry about the slow rotation. You also have all the time after loading to figure out what to do next and get the value ready for loading. Piece of cake! --- In , "Tony" <tonyjmeier@e...> wrote: > Thanks to Ayman, John and rtstofer for all the help!! > > I think the STAMP is out and one of the PIC Micros are in!! > > Where can I find more info about these little jewels? > How expensive are they? > This is probably a given, but I have to ask: Do they come with > software tools and can I plug the device into a port on my computer, > write the code in a program supplied by the manufacturer and then send > the program through the port into memory on the board, then place the > device and the engine in the airplane? > > Sounds like fun!!! > More consideration on the resolution/granularity of the clock. > > Ideally the ignition advance is adjustable in single integer degree > increments, from 0 to 36 (experimentation will determine the true range). > > "When the free-running clock matches the output compare it will > trigger the ignition" - The process by which the device will make this > comparison will take time and that increment of time will have to be > small enough to fit within 1/2 degree rotation of the crankshaft at > 14,000 RPM. > > For the clock to hit the mark within 1/2 of a degree of crankshaft > rotation, at 14,000 RPM, its resolution will have to be a minimum of: > > 1/2 deg. / 360 deg. x .00428 secs/rev. = 0.000005944 seconds, or > > 168,224 Hz ?!?!?!?!?!?! To my novice ear this is sounding pretty > incredibly fast ....... is it possible? > > I'm assuming the clock is a chip that can be removed and replaced on > the board of the device, do they offer faster clocks if needed? > > This is very exciting and I'm looking forward to it. > Thanks for all the help so far and I'm sure I'll have more questions, > > Tony J. |
|
|
|
> I make the follwing suggestions: First, for $8.00 you can buy a > 16F877 40 pin 20 MHz preprogrammed with a boot loader in the upper 2k > of memory. That leaves 6k for you and that is a LOT. Do read http://www.voti.nl/swp I would recommend a bootloader only when there is a good chance that you will only use one or two PICs ever. Otherwise, get a programmer. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
Wouter, I certainly didn't mean to imply that a PIC programmer isn't necessary In fact, I don't see how, in the long term, anyone can do without it. But a lot of code can be developed and tested with a boot loader and it is faster than chip swapping. I tend to design all my toys for ISP and that works very well but it does put contraints on the design. Nevertheless, at some point a PIC programmer is necessary. I also forgot to mention using a ZIF socket when outfitting the prototype board. Much faster and less damage to the device. --- In , "Wouter van Ooijen" <wouter@v...> wrote: > > I make the follwing suggestions: First, for $8.00 you can buy a > > 16F877 40 pin 20 MHz preprogrammed with a boot loader in the upper 2k > > of memory. That leaves 6k for you and that is a LOT. > > Do read http://www.voti.nl/swp > > I would recommend a bootloader only when there is a good chance that you > will only use one or two PICs ever. Otherwise, get a programmer. > > Wouter van Ooijen > > -- ------------------------------------------- > Van Ooijen Technische Informatica: www.voti.nl > consultancy, development, PICmicro products |
|
|
|
> I certainly didn't mean to imply that a PIC programmer isn't necessary > In fact, I don't see how, in the long term, anyone can do without it. > But a lot of code can be developed and tested with a boot loader and > it is faster than chip swapping. I tend to design all my toys for ISP > and that works very well but it does put contraints on the design. IMHO designing for a bootloader imposes more restrictions than designing for ICSP. > I also forgot to mention using a ZIF socket when outfitting the > prototype board. Much faster and less damage to the device. I seldom use a ZIF. Either I design the board for ICSP, and use either a connector on the board or a DIP clip, or I haev the (DIP) chip in a turned-pin socket (acting as pin saver) and I move that combo around. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
Wouter, do I have the (wrong) feeling, there is a small war here between the programmers builders and the bootloaders suppliers ? :)) The advantage of a bootloader (let say wloader) is evident. However the beginners have problems in understanding why. (Maybe just my readers?...) There is a major advantage in using a bootloader in prototyping phase, when the user must program the PIC memory maaany times. Usualy, migration to the same PIC family it's easy. So, in my opinion there is no impediment in using a bootloader for prototyping (against the ZIF which is ugly and expensive enough). Mostly because: 1. there are no impedance problems on CLK and SDA like with ICSP 2. time required for programming is dependent by the code lenght (and not by program memory lenght like in most all programmers, except maybe xwisp?) 3. the PC-PIC connection may be allive in all development phase period 4. no ZIF-UNZIF & moving PIC is needed 5. migration is easy (at least at midrange PIC) I'll always vote for a bootloader for prototyping. But this also means you have the programmer just to program the bootloader firmware :) So, there is no war here, ufff what a relish. top 10 wishes, Vasile http://surducan.netfirms.com On Mon, 5 May 2003, Wouter van Ooijen wrote: > > I certainly didn't mean to imply that a PIC programmer isn't necessary > > In fact, I don't see how, in the long term, anyone can do without it. > > But a lot of code can be developed and tested with a boot loader and > > it is faster than chip swapping. I tend to design all my toys for ISP > > and that works very well but it does put contraints on the design. > > IMHO designing for a bootloader imposes more restrictions than designing > for ICSP. > > > I also forgot to mention using a ZIF socket when outfitting the > > prototype board. Much faster and less damage to the device. > > I seldom use a ZIF. Either I design the board for ICSP, and use either a > connector on the board or a DIP clip, or I haev the (DIP) chip in a > turned-pin socket (acting as pin saver) and I move that combo around. > > Wouter van Ooijen > > -- ------------------------------------------- > Van Ooijen Technische Informatica: www.voti.nl > consultancy, development, PICmicro products > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions |
|
|
|
> Wouter, do I have the (wrong) feeling, there is a small war > here between the programmers builders and the bootloaders suppliers ? :)) I feel schiztofrenia taking over :) > in using a bootloader for prototyping (against the ZIF which > is ugly and expensive enough). Mostly because: > 1. there are no impedance problems on CLK and SDA like with ICSP But there are other requirements, most probably access to the I/O pins used for communication. Sideline: how many I/O pins are needed for a bootloader? > 2. time required for programming is dependent by the code > lenght (and not > by program memory lenght like in most all programmers, except maybe > xwisp?) I would guess all reasably coded programmers write only the code that is needed. That certainly holds for xwisp with wisp628 nor wloader. > 4. no ZIF-UNZIF & moving PIC is needed junk the ZIF, use ICSP! Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
On Mon, 5 May 2003, Wouter van Ooijen wrote: > Sideline: how many I/O pins are needed for a bootloader? afik, for yours 18Fseries bootloader, 0 pins? but unfortunately, for me Phyton is mizery :( now I have blowed in your canvas ? or just provide a little storm ? Vasile |
|
|
|
where can I learn more about using a bootloader? Schematic? Text? Biz end on the PC? My Olimex programmer apparently doesn't do ICSP, although there are header pins for it . . . --- Wouter van Ooijen <> wrote: > > Wouter, do I have the (wrong) feeling, there is a > small war > > here between the programmers builders and the > bootloaders suppliers ? > :)) > > I feel schiztofrenia taking over :) > > > in using a bootloader for prototyping (against the > ZIF which > > is ugly and expensive enough). Mostly because: > > 1. there are no impedance problems on CLK and SDA > like with ICSP > > But there are other requirements, most probably > access to the I/O pins > used for communication. > > Sideline: how many I/O pins are needed for a > bootloader? > > > 2. time required for programming is dependent by > the code > > lenght (and not > > by program memory lenght like in most all > programmers, except maybe > > xwisp?) > > I would guess all reasably coded programmers write > only the code that is > needed. That certainly holds for xwisp with wisp628 > nor wloader. > > > 4. no ZIF-UNZIF & moving PIC is needed > > junk the ZIF, use ICSP! > > Wouter van Ooijen > > -- ------------------------------------------- > Van Ooijen Technische Informatica: www.voti.nl > consultancy, development, PICmicro products __________________________________ |
|
|
|
Two other thoughts on bootloader vs ICSP. First, the Bot Loader software I mentioned earlier has a problem - it wants to clear all of program memory 1 byte at a time. Every time! This takes too long but there is an upside using it without modification. It is known to work on 16F877! When first connecting a chip to a prototype board it is nice to know that it is doing something. At least the bootloader will send a sign-on string to the PC. The Bot Loader takes two pins TXD and RXD - it doesn't use handshaking. But wait! There's more... I kind of like using the serial port to send debugging information and I will probably leave those two pins permanently assigned to serial I/O even on the final circuit board. Now, ICSP is much faster but dealing with the issue of designing the circuit to isolate Vcc, RB3, RB6 and RB7 and maybe Vdd while having nothing ugly happen to the rest of the circuit can be a challenge. I have been leaning toward the 10 pin (2 row by 5) header. With this configuration I lose a little board space but I make up for it with guaranteed isolation. There is certainly no disagreement aboout using PIC programmers - they are required but for a first time user the bootloader flattens the learning curve substantially. --- In , Vasile Surducan <vasile@s...> wrote: > On Mon, 5 May 2003, Wouter van Ooijen wrote: > > > > > Sideline: how many I/O pins are needed for a bootloader? > > > > afik, for yours 18Fseries bootloader, 0 pins? > > but unfortunately, for me Phyton is mizery :( > > now I have blowed in your canvas ? or just provide a little storm ? > > Vasile |
|
John, Wander around the Mark III User Guide section on www.junun.org. Realize that this is specific to the 16F87x but you can find links to bootloader software and notes on its use. Also, I believe there is an app note at www.microchip.com for their version of a bootloader. I haven't used this one but it is much smaller. --- In , John Remington <jrem123@y...> wrote: > where can I learn more about using a bootloader? > Schematic? Text? Biz end on the PC? My Olimex > programmer apparently doesn't do ICSP, although there > are header pins for it . . . > > > --- Wouter van Ooijen <wouter@v...> wrote: > > > Wouter, do I have the (wrong) feeling, there is a > > small war > > > here between the programmers builders and the > > bootloaders suppliers ? > > :)) > > > > I feel schiztofrenia taking over :) > > > > > in using a bootloader for prototyping (against the > > ZIF which > > > is ugly and expensive enough). Mostly because: > > > 1. there are no impedance problems on CLK and SDA > > like with ICSP > > > > But there are other requirements, most probably > > access to the I/O pins > > used for communication. > > > > Sideline: how many I/O pins are needed for a > > bootloader? > > > > > 2. time required for programming is dependent by > > the code > > > lenght (and not > > > by program memory lenght like in most all > > programmers, except maybe > > > xwisp?) > > > > I would guess all reasably coded programmers write > > only the code that is > > needed. That certainly holds for xwisp with wisp628 > > nor wloader. > > > > > 4. no ZIF-UNZIF & moving PIC is needed > > > > junk the ZIF, use ICSP! > > > > Wouter van Ooijen > > > > -- ------------------------------------------- > > Van Ooijen Technische Informatica: www.voti.nl > > consultancy, development, PICmicro products > > > > > > __________________________________ |
|
|
|
> > where can I learn more about using a bootloader? http://www.voti.nl/wloader is one, and the page has links to others that I know of. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
Tony, Keep in mind that if this is for a plane, your rpm will be well under 10k, and you will only want it near that high if you are racing. Most guys prop their gas planes to keep the rpm under 8k. In that case, you won't need much more than 30 degrees of advance. If it's for a car, my guess is that you will have cooling issues at that high rpm. If it's for a boat, then you have the water cooling and a lot of those racers run the rpm real high but the engines wear out after a few short runs. I've converted more engines than I care to admit...got several pages on it. If you are looking to save money, then go buy an engine from an RC engine mfr. that already has a CH ignition on it. (BME and ZDZ are two great companies!) If you are looking to have fun, then convert one of your own...and if you want to spend even more money and have even more fun, then make your own ignition. Cliff http://www.rcfaq.com ----- Original Message ----- From: "Tony" <> To: <> Sent: Sunday, May 04, 2003 2:11 PM Subject: [piclist] Digital Spark Ignition Advance Project - Further considerations > Thanks to Ayman, John and rtstofer for all the help!! > > I think the STAMP is out and one of the PIC Micros are in!! > > Where can I find more info about these little jewels? > How expensive are they? > This is probably a given, but I have to ask: Do they come with > software tools and can I plug the device into a port on my computer, > write the code in a program supplied by the manufacturer and then send > the program through the port into memory on the board, then place the > device and the engine in the airplane? > > Sounds like fun!!! > More consideration on the resolution/granularity of the clock. > > Ideally the ignition advance is adjustable in single integer degree > increments, from 0 to 36 (experimentation will determine the true range). > > "When the free-running clock matches the output compare it will > trigger the ignition" - The process by which the device will make this > comparison will take time and that increment of time will have to be > small enough to fit within 1/2 degree rotation of the crankshaft at > 14,000 RPM. > > For the clock to hit the mark within 1/2 of a degree of crankshaft > rotation, at 14,000 RPM, its resolution will have to be a minimum of: > > 1/2 deg. / 360 deg. x .00428 secs/rev. = 0.000005944 seconds, or > > 168,224 Hz ?!?!?!?!?!?! To my novice ear this is sounding pretty > incredibly fast ....... is it possible? > > I'm assuming the clock is a chip that can be removed and replaced on > the board of the device, do they offer faster clocks if needed? > > This is very exciting and I'm looking forward to it. > Thanks for all the help so far and I'm sure I'll have more questions, > > Tony J. > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions |