Subject: Atmel and ZBasic Rotary Project lore
From: Rotary Engine
Date: 5/20/2010, 6:46 PM
To: AAA Put this in the To box


  I suggest if you are interested in this system you make
  a folder and drag over all the many future messages on this
  subject otherwise delete it.

  Paul,

 I did as you suggested, but didn't see any difference in the results.
 I've
 attached a screen shot of the program after F7.

 Thanks for the help.  I'll stick with it as long as you're willing to
 tutor
 me.  ;-)

 Mark

 OK I think I see what the problem is.
 verbose only works if you are in a project.

 You are not in a project.
 Select the Project drop down menu
 Select new
 If the Directory is not what you want select change
 or browse.
 Type in a new project name.
 Then select OK.

 What will come is the editor that will look like this:
 Sub Main()
 End Sub

 Now select Options  Open Project File.
 It will look like this:
 ...name you gave it.bas

 Put in

 --verbose

 Select "save" under File.
 It will blink.

 Now go back and select the first tab... name you gave it.bas

 You can always tell if you have a valid project as you will see
 a tab with ......name you gave it.pjt

 Now put your program between Sub Main() and End Sub
 go from there and get back to me.

 Paul Lamar

 See attachment

 Mark

 OK great Mark. I'll send this off to Don.
 Do you have anything other than ZBasic running?

 ---------------------------------------------------
 Don wants to know if your are running in Windows 7 or you
 are running 64 bits?

 He is obviously on line :)


 Paul Lamar


 Paul,

 I'm running Windows 7 (64bit)

 Mark

 OK I think that is the problem.
 Don nailed it. I think that is a no no.
 I'll check with Don.

 Do you have an old XP computer lying around?


 Paul Lamar


 Paul,

 Another case of bleeding-edge technology leaving another victim cut up and
 bloody.  ;-)

 I'll try it on my EeePC (running Windows XP).  Stay tuned.

 Mark

 If that works that would be real cool.
 Then we could get back to the efi.

 Here is what Don said about it:

 Location: Portland, OR

 Posted: 20 May 2010, 12:03 PM    Post subject:  Reply with quote
 Paul Lamar wrote:
 Yes he is running windows 7 64 bit.
 The version of the back-end compiler that ZBasic currently uses is
 not compatible with 64-bit Windows.
 Our tests indicate that it does run on Windows 7 32-bit.

 Paul Lamar wrote:
 Is there a stand alone communication program that will
 receive data from the AVR debug.print or console.write?


 Many. I've used TeraTerm and Bray's Terminal. A search
 using "terminal emulator" and similar terms should turn
 up several options, most of which should be no-cost.[/quote]

 End quote

 I checked the speed of that program on the scope and it it took
 only .25 ms to do the A to D and the scaling.
 Here is what the program looked like.

 ---------------------------------------------
 Sub Main()
 Dim x as Integer
 Dim val as Integer
 For  x = 1 to 10000
 Call PutPin(12, ZXOutputHigh)
 val = GetADC(82)\ 5
 val = (val * 55)\100  'fine tune the  voltage verses psi trick.
 Call PutPin(12, ZXOutPutLow)
 'Debug.Print CStr(val) ; ", ";  'optional
 Console.Write (CStr(val) & ", ")
 Delay(0.01)
 Next
 End Sub
 -----------------------------------------------

 That bodes well for the EFI program.
 I'll need to do two A to D's and send out a pulse in only 8 ms.
 One A to D for MAP and one for the leaning knob.
 Looks like no sweat.

 When you send a program to the board it stays
 there in flash mem. You could send me the board and I could
 program it and send it back. Then you could use
 a com program running under Windoze 7 to receive the data.
 Just an option.

 I think you should switch to Linux. I think Zbasic will
 probably run on Linux. That solves a lot of problems
 with Windows running in command mode which is
 what ZBasic does. I'll ask Don.

 Paul Lamar

 Paul,

 Eureka!!!  It works!!!
 The video died on my old PC so I had to use my EeePC running Windows XP.
 I
 hadn't used it in quite a while, so had to charge the battery and update
 virus files before I could download the ZBzsic IDE s/w.  I still need to
 d/l
 the zx-1280 development board drivers so the EeePC can talk to it.
 Hopefully, that won't be a problem. We're almost there...

 Mark

 (I hate the miniature keyboard on the EeePC!)

 Hey USB keyboards are cheap. $10.

 Also check out a Intel Atom mother board for $90
 with the processor on it. I have two computers all
 working off the same video, keyboard and mouse.
 One can buy a switch at Fry's to do that.

 Do you have Fry's in Texas?

 I have an oem version of XP but it may need
 activation. If so I can't share it. I hate activation.
 One reason I run Linux. Don tells me ZBasic does
 not run on Linux. Too bad.

 I might have a XP hard drive lying around. Next
 time I'm in the hangar I'll check .


 Paul Lamar

 Paul,

Progress report...
I dowlnoaded the ftdi dirvers and got them installed on the EeePC.  Now the
pc recognizes the zx-1280n.  Although I did get a message that Com1 wasn't
working. Turns out the add-on mouse I was using on the EeePC was using
Com1.
 So, I unplugged the mouse and now the zx-1280 is talking to the pc.

Open ZBasic and press F7 to compile.  It got one error.  It reads, "Error:
reference to undefined identifier "qval"
Line 6 of the program is highlited in yellow.  It reads, "qval = GetADC(82)
\ 5"

At least the back-end error is gone.

Mark


It is supposed to be just val. Not qval

Sub Main()
Dim x as Integer
Dim val as Integer
For  x = 1 to 10000
val = GetADC(82)\ 5
Console.Write (CStr(val) & ", ")
Delay(0.01)
Next
End Sub

My EEEPC has three USB ports.
Try putting the mouse in another port.
If that does not work go into serial port options
and fool around changing the com number.
Mine is working on com5


Paul Lamar


HAPPY DAY!
Its running on the EeePC.  I guess I'm supposed to be seeing a 2 line
message which reads, "zx1280n says... Hello, world"  Now how do I  get it to
stop?  ;-)
I have no idea where the "q" came from.

To get the PC to talk to the zx1280n, I had to reconfigure the USB as COM1.


BTW, I received my pressure transducer yesterday (the p/n you referenced).
I guess my next task is to rig it up for a simulated compression test.
There is no nipple, so I guess the plan is to JB Weld one onto the
transducer?

As always, thanks for your help and patience.

Mark

P.S.  Received the Renesis wp inlet/outlet today... very nice!

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

I have not seen that hello world message in a long time.
I think Don put it in flash memory and it was over written
the first time you down loaded one of your own programs.
I could be wrong.

I have a slew of USB ports so I think it depends
one what USB device or devices  is/are plugged into your PC
when you first plug in the USB cable from the Atmel.
This kind of stuff is highly sequence dependent I suspect.

Tomorrow I will publish the first rudimentary EFI
program. I will assume there are two Crank Angle Sensors
set to 22 degrees BTC and 180 degrees later for rotor
two. The first will have 4 ms at 7500 RPM to fire the plugs
on rotor one, read the A to D on the MAP sensor, store it and fire
the injectors with the proper pulse width. Likely around 8 MS
assuming the MAP is near atmos. The second sensor
event will fire the plugs on rotor 2, read the leaning pot,
and modify the MAP value. Thats it for now. The rest of the
time the computer will be twiddly its thumbs. It takes less
than .25 ms to read the A to D. Probably about ten
times longer than any other function except sending
data to the Net Book.

The program will be less than one page long.

You set the fixed 22 degrees BTDC timing by slots in the trigger
wheel.

Bob can get some more weight out. We stopped milling
to keep the cost reasonable.

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.