Subject: Atmel and ZBasic Rotary Project lore
From: Rotary Engine
Date: 5/22/2010, 5:54 AM
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!


  OK, so the "Hello, world" program was the program loaded at the factory,
  not
  your program.  Compiling yours results in one error that reads,
 "parameter
  1
  of GetADC, pin 82 (&H52) is not a valid pin for target processor "zx24"

  Mark
  Ah you forget to set the target device.
  Go into options menu device options target device and type in ZX-1280n.

  BTW check your EeePC and see if you can get it in the command mode
  window. You will need that for running QB. In the XP start menu it
  is called the Command Prompt. In effect it puts you into a
  DOS window so you can run DOS programs like the QB IDE.

  You will love the QB IDE as it is far easier to use
  than the ZBasic IDE. I sent you a QB zip file. Do you still
  have it?


  Paul Lamar



 Paul,

 It doesn't look like I can get to the DOS prompt on the EeePC.  I'll check
 with my son this weekend to be certain.  He's a Systems Analyst.

 Programs all seem to work now that I selected the proper hdw in the
 Options
 menu.  You may need to provide some guidance on how to connect the zx1280n
 in order to get meaningful results from the programs.  Currently, there is
 nothing connected to my dev. board.

 Yes, we have a Fry's here.  We also have great BBQ.

 Mark

 OK Mark. No problem on the DOS QB. I know it does not work
 in Windows 7. See if you can find an old used PC with
 Windows XP on it. That may be the cheapest way to get
 XP. Fry's sells XP in the hardware dept for about $100
 but I think you have to buy a mother board.

 The other possibility is Visual Basic but that is
 expensive. I'll have to think on this for awhile.

 Here is the pin out on the ZX1280n. The ports and pins
 are clearly marked on the PC board.

 Tell me what pressure sensor you have and I will come
 up with a schematic.

 Paul Lamar

 I have all of the schematics saved from before.  The one labeled
 "main-schematic 1" shows pin 82 going to Port K, pin 8.  But the Port K is
 labeled 0 - 7.  I'm assuming that pin 8 is actually the one labeled "7".
 This is the kind of stuff that drives people crazy!!!

 I have the MPX5999D pressure sensor.  There is no nipple to hook the hose,
 but I guess I could make a holding/clamping fixture.  Or, I could simply
JB
 Weld a nipple onto the body of the sensor.  I would JB Weld it to the
 modified spark plug but it could be damaged when screwing it into the
 engine.

 Mark

 Yes the computer world can't get their act together on this :)
 It is something you get used to after 40 years :)

 Darn I thought the MPX5999D had a nipple. My mistake.

 Have bob make this clip out of 3/4 rod.

 I think JB welding a nipple on the top may blow off the SS cover.
 Also the JB Weld may plug the hole. The sensor can be glued
 into the clip with RTV.

 ----------------------------------------
 This one will be easier to make out of 1 inch rod.
 Just use three 4-40 screws and a washer with holes in it to
 hold it on the sensor.


 Paul Lamar


 Thanks for the drawings.  I'll see what I can work out for a nipple.

Mark

I think you could make the sensor holder part of the device that
screws into the spark plug hole.

BTW I checked out five different brands of netbooks at Fry's.
They all had the command line under Accessories. Some said
Windows 7 but it was probably the 32 bit version.

Of course we don't need the QB now as we can edit the
data file using the hex editor.

Paul Lamar


Paul,

Well, what do you know!!!  Who would have thought they would put something
like a DOS prompt under Accessories???

And yes, that's where I found it, but they call it, "Command Prompt".
Something with that important sounding a name should have its own icon.
;-)

But, as you said, now we don't need it.

Mark

I have flipped on that. I have just figured out how to get QB to
write the EFI pulse width table. No need to calculate and type in a
lengthy list of pulse widths.  Yes a computer writing a program
for another computer.  More about that later.

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.