Subject: Register Dot in ZBasic
From: Rotary Engine
Date: 7/25/2010, 12:35 PM
To: AAA Put this in the To box



I am getting high speed performance out of the ZBasic the
creator did not dream of. Here is a 100 ns pulse. Pulses
can take a significant amount of time
using the traditional BASIC bit set instructions.
On the order of 10 micro seconds. That can add up when you
only have 8 milli seconds to run the entire EFI program.
Lots of pulses are needed when you are doing real time
machine control.

Here is the test program that does it. It uses the ZBasic psuedo
asm language Register Dot commands.

For some strange reason one must use several in a row.
Perhaps my $5000 dollar scope is just not fast enough
to see them:)

I am very pleased to say the least. ZBASIC has
exceeded my wildest expectations.


snips....of bad test program.

Don, how about a implementing a binary
data type such as 00010011 ? It will help
greatly with bit set register dot.
Some assemblers have that feature.

------------------------------------------------

I made a mistake in the sniped code above. "PinK" should
be "PortK". I am surprised it worked at all. There should have
been an error message when it was compiled.
Anyway it is working fine now as expected with only
one instruction.

It works so well I used it to time various instructions
and data types. One of the big time consumers in
the EFI system is sending the engine data to a web book screen for
EFIS display using the USB interface. I was sending out
long data types that can be up to 10 bytes or characters
in length which is totally unnecessary for engine parameters.
One does not need engine temperature to 10 digit resolution :)
3 digits will do the job.
Using the unsigned integer data type cut it down
from about 1 millisecond to 60 microseconds.
A huge savings in time.

Here is the code for checking the length of time
an instruction requires. Just uncomment what instruction you
need to time or comment out what you don't need.
Any instruction or series of instructions can be timed
use a fast scope

public x as long
public val as byte
public val0 as byte
Public y as long
Public z as byte
Public Q as unsignedinteger

Sub Main()
Register.DDRK = &HFF  ' set the direction

val= 1
val0 = 0
Q =1
for x = 1 to 500000000000
for y = 1 to 500000   'delay
next y
Register.portK = val   'set  bit  0 high
'y = y + 1    ' long
'z = z + 1     'byte
'z = z * 10    'byte
'Q = Q + 1     'unsignedinteger
'Q = Q * 1000  'unsignedinteger
debug.print Q
'debug.print x     'long
'for y = 1 to 50
'next y
Register.portK = val0  ,set the whole port  low
next x
end sub

This whole system is going to be the cat's meow.
This may look like gibberish to some of you but
hang in there as it is going to be worth it.
Make a new folder and drag stuff over there for later
use in months to come. Our goal is a super cheap,
open source, engine control system (EFI), data
acquisition system and EFIS all combined in one, low
cost, easy to program in BASIC  system.

The ZBasic system on the Atmel 1280 computer is rapidly
proving to be the only way to go.

BTW this computer is powerful enough to do NC machine
tool control.

Paul Lamar

Hi Paul,

This stuff is interesting if not exciting to me to think I
might be able to build and program controllers from a set of parts.

We communicated a while back about getting your Kasuga up
and running and I was looking at some machines for my uses.

I just sold my old lawn mower engine powered 65 Porsche and
simultaneously found a 95% complete Cozy IV for about $10k,
a deal I felt I should not pass up. The owner was originally
going to use a Renesis to power it, but had sold the parts
before my purchase.

My purchase pushed back my plans to get an NC mill and lathe
to start cutting parts.

So for now I am concentrating on getting the engine stuff
accumulated and ready to mount on the steel tube frame, and
then get the electronics sorted.

I will be inquiring about which engine setup to use for my
craft. It will be turbo charged, I want to fly high.

Hope to use many of your designs and ideas to get this flying.

BTW, if anyone has space to share rent in your hanger in
the north Los Angeles area, up to Palmdale, or over
to Ventura, I'm interested.

Thanks!
Ed Carver


There are now a couple of hangars in SZP either for rent
or for sale. I would love to have you at SZP Ed.
We could work together on a lot of things.

Paul Lamar

-- 
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site. http://www.rotaryeng.net
Youtube key word PaulLamar2
Copyright 1998-2010 All world wide rights reserved.