Scroll down Paul.
This is the best site by far I have ever found on the subject by a factor
of 10.
Many examples are given both in asm and C for different micro computers
including the
AVR PJRC Teensy that I am using on the ignition board as well as the
FreeScale
processor used in the megasquirt.
http://www.scriptoriumdesigns.com/embedded/interrupt_examples.php
Somebody put a lot a man hours into this site.
Paul Lamar
For the past couple of weeks I have been working real hard on a solution
for using
LS1 and RX8 smart coils with megasquirt 1 V2.2 and carbs. What I am
discovering is a
clear division in micro computer chips. Those that are simple with
assigned I/O pins
and those that are complex with un-assigned I/O pins. It is up to the
human
programmer to assign the pins.
The simple ones are easy to program in asm the others are not. Asm is
essential when
dealing with 10,000 RPM engines like the rotary. Especially when it comes
to real
world hardware random interrupts. Periodic interrupts can be a problem
also when two
come in at the same time despite a difference in frequencies. I solved
that proplem
back in 1976 but apparently microprocessor designer did not catch on.
http://www.rotaryeng.net/IEEE-road-test-sys.pdf "Besides, interrupts are
just very
cool, and you deserve to get to the cool stuff ASAP."
Most AVR chips fall into the second group as does the MC9S12. The first
group is the
6502, 8051 and the MC68HC908 used in the megasquirt 1. The megasquirt 2
and above use
the MC9S12 and C. The development software for the AVR studio 6 stunned
me when I
saw the size of the file. The install IDE exe was 750 megabytes and
installed it
required several gig. One of my XP computers told me I did not have enough
space on
the C: drive to install the IDE :) After several hours installing the
extremely
complex IDE it told me the AVR chip I wanted to use was unsupported in
asm. See the
attached jpg.
I am now considering going back to the 8051 or the MC68HC908. The low cost
8051 has
excellent world wide support. Even AVR makes a version.
http://tinyurl.com/bt9bdw8
The exception to the rule is the high end Silicon Labs
C8051F340/1/2/3/4/5/6/7/8/9/A/B/C/D With human programmer assigned pin
outs and 48
million instructions per second. I can order these from china for $30
bucks each
including 32 MB of on board flash memory no less. Great for storing a
bunch of RPM
history data and timing data.
I have a SL development board and all the SL assembler software. Also
makes a great
data ack board with on board 10 bit A to D's.
Henry Nee is over there as we speak and he can check out the company and
see if it is legit.
Paul Lamar
I'm actually in Taiwan today. Not sure what I can contribute at the moment
but I think division. Of labor on a few Low cost, simple uP may be easier
to make right. My thought has been on taking a page from your 555 system,
and use one such chip every rotor. (6 for the 6b if needed). This can be
done easily with ATtiny. Use a mother processor with analog input to
calculate the variable outputs without too much real time restrictions, the
use simple serial interface to transfer the resulting values to those
ATtiny and you have a very scale able solution. The ATtiny can be stacked
such that a hard wire ID corresponding to a rotor can be established
automatically. What do you think?
Henry
Sounds like a good plan but I would not use a AVR Tiny when you can get a
40 Mhz, 32
bit, 512K flash memory PIC with built in USB for $12. :) Even I can
afford $12 a
rotor. The 512K memory could store a whole flight's worth of engine data
if not a
years worth. This chip is more powerful than a PC from a few years ago.
With GPS Rx
you can have real MPG on the panel.
Not only that, PIC have an excellent BASIC compiler. I am of the opinion
that
computers should do more to help you program now a days. You should be
able to speak
and say what you want the program to do and the computer should record and
write the
program. System 7 Windows does an excellent job of speech recognition
built in.
My wife tells her Android phone whom to call. Just like the computers in
Silent
Running and Star Trek. Plain language BASIC is a step in the right
direction unlike
cryptic C with curly brackets and inane commands all over the place :)
With this much
speed and power why not.
MikroElectronika have a 32 bit PIC big board with touch graphics screen
and built in
Mikro PIC BASIC support for $250. It even has a SD card reader/writer. It
would be
nice to have a touch screen on the panel for calling up engine parameters.
Paul Lamar
I was thinking about Basic for complex functions such as altitude
compensation, automatic leaning, ignition advances, etc. Then a separate
8051 like tiny to do the actual time control without real time OS,
colliding interrupts, etc.
A serial link can be used to log information from the to tiny back to the
main uP. So you do get all the benefits of a full system. In my mind, the
codes may be much easier to understand and there might be a chance to go
after certification with it.
Henry
The Silicon Labs C8051 comes close to 32bit PIC in power and there is a
MikroElectronika BASIC compiler for it.
Paul Lamar
I believe things should work for us. And it needs to work for you as
you have the most knowledge. Therefore I thought if we can write all
the decision logic in basic, and not having to worry about efficiency,
it will be great.
Then we can write a really really tight routine to be run on a simple
8051. Basically it knows the period. From there, it calculates the
delay until it turns on the transistor to ground the coil for 2ms.
Any timing change base on atmosphere pressure, MAP, air temp, etc. can
be calculated by the basic program easily, and the resulting
adjustment send to the 8051 easily.
This partition of labor means that the codes can be read and
understood easily, and there is no concern of race conditions
occurring in the same processor. So it may be easier to get certified
eventually.
Henry
I agree 100% except use a PIC rather than a 8051. They are only $12. Actually much
cheaper than a SL C8051 that is half as fast. The PIC can run 80 MHZ. Also there is
better support for the PIC.
I have an old IBM laptop running DOS and a printer port that will give me almost
enough I/O to write a prototype EFI in QB. I think the printer port had a paper out
hardware interrupt that QB could recognise. It would not be perfect nor fast enough
but the code would be almost the same.
You can download the MikroElectronika 32bit PIC MikroBASIC and manuals from here.
http://www.mikroe.com/eng/products/view/624/mikrobasic-pro-for-pic32/
It supports graphic screens and I am looking for a larger screen 240 X 128 than the
one sold by MikroElectronika. Nice to have a VE MAP on the panel. Keep an eye out in
ShenZeng.
The PIC official BASIC does not support graphic screens.
BTW you could do graphic screens in QB way back in the 80's.
MikroBASIC does full floating point math just like QB.
Paul Lamar
--
The Rotary Engine News Letter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
You Tube key word PaulLamar2
Copyright 1998-2012 All world wide rights reserved.