To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 8542
8541  |  8543
Subject: 
Re: JRM code and Reset
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Wed, 2 Jan 2002 21:13:56 GMT
Viewed: 
1946 times
  
Fred,

Thanks for the info on how IC determines whether to auto-start a program or
not.  Based on your suggestions ----

I just finished downloading the open-source (free) version of IC.    I had
been running Newton Labs 3.1 and most recently 3.2.

I unzipped the open-source version of IC files, configured DL and IC and
successfully downloaded the "new" Pcode to my HB.   My HB LCD displayed:  "
Interactive C V2.81  9/28/93 " and the heartbeat.

Using  peek(0x8000),  showed 0x8000 to be equal to 1 (one).   I used
poke(0x8000,0); to change memory location 0x8000 to be equal to 0 (zero).
I then used peek(0x8000) to confirm that 0x8000 had been changed to equal to
0 (zero)......it had.

With 0x8000 set to 0 (zero), I downloaded my "  main()  " file (filename:
jrm1.c) to the HB.   Again, using peek(0x8000); I checked 0x8000 and is was
equal to 1 (one).....so far, so good.

I then reset the HB and my "  main()  " program would not run.  I tried
multiple times.  As always, typing   "    main();  "  on the PC caused my "
main()  " program to run properly.

Now, it gets more interesting. I unloaded the "  main()  " program
(filename: jrm1.c).  Unloading did not cause 0x8000 to be set equal to 0
(zero).    This might or might not be ok.

To find out,  I confirmed the unload  using " list files ".  Then, I  poked
0x8000 to equal 0, and confirmed the poke with peek(0x8000);.... 0x8000 was
equal to 0 (zero).  Calling "  main()  " from the PC resulted in the
"Function main undefined" message.  So, no " main() " function resident on
the HB and 0x8000 is equal to 0 (zero).

Next, I loaded a file which does NOT have a "  main()  " function (filename:
music.c)...... peeked 0x8000 and it was now equal  to 1 (one) !!??  Both a
program WITH  a " main() " function and one WITHOUT a " main() " function
set RAM location 0x8000 to equal 1 (one).....???!!

Incidentally, "music.c" worked fine, I could call the various tunes from the
PC and it did not start running upon HB reset.  I could further confirm that
music.c had no " main() " function by trying to call "  main()  " from the
PC.......I simply got the "Functon main undefined" message.

Just to double check, I then changed everything back to Newton Labs IC v3.2.
I downloaded the Pcode (3.10)  and my HB LCD displayed "  IC v3.1 Handy
Board 1.2  " and the heartbeat.  Yes, it does display v3.1, even though
under Help/About the message says I'm running v3.2  (Newton Labs take note).

Anyway,  I repeated all the  above peeks, pokes, loads, peeks, unloads, et
cetera, ......getting exactly the same results.

My testing would indicate that 0x8000 being a 1 or a 0 does not define a
downloaded file which contains a "  main()  " function.  Have I
misinterpreted something....sorry if so.

I've looked at the source code, but can't figure out how to determine the
memory address of PCODE_ORIGIN.....I'll study it more.

Suggestions?


Thanks,

John



















In lugnet.robotics.handyboard, Fred G. Martin writes:
OK, I looked at the source code to try to understand what could be the
problem.  If anyone wants to download the source themselves, go to
http://handyboard.com/software/base.html and click on the link at the
bottom of the page.

The following is true of the open-source (free) version of IC.  I don't
think it's changed in Newton Labs' IC, but I could be wrong.

The very first byte of battery-backed RAM, 0x8000, marks whether or not
an auto-start program is in place.

If this byte is 0, there is no auto-start program.
If this byte is 1, there is an auto-start program, and compiled code
beginning at 0x8001 is executed.

So, given this, I'd check that you can properly read and write to
location 0x8000 of your RAM.

I haven't heard of this problem before so I too am curious as to what's
going on.  Definitely try things with the open-source IC that's
distributed from the HB site.

Fred



On Tuesday, January 1, 2002, at 11:03 PM, John McDaniel wrote:

Dan,

Thanks for hanging tough on this problem.....I'm feeling really
inadequate
on this one.

I downloaded your revision of my program and it did not help.  Of
course, if
I do type " main() " on the PC, it does give your "Press Start....."
message
and waits for me to press START.  After pressing START, the HB beeps and
starts running "my" program.

Yes, I'm downloading the Pcode version 3.1.  However, per your earlier
suggestion, I downloaded the "PWM Pcode" to my HB and then downloaded
my "
main()  " file......no joy!.... same problem.

I will download the 'free' IC version and try everything from a DOS
prompt,
although that'll have to wait until tomorrow.

Incidentally, I just reattached the battery pack after resoldering every
connection on the HB.....no change.

Well, I've got 103 fewer Toshiba 68HC11's than you, but I'm glad to hear
that you don't think that the Toshiba is the problem -- or maybe I wish
it
were that.

Please feel free to post any/all of this discussion on the other
board....I'll take any help I can get.  You can probably tell that I'm
really frustrated with this problem.  I'm ready to get on with my robot
project, but I have to get past this problem first......arrrrgh.   If I
can't get this squared away, I'm going to have a very expensive
paperweight.

Regards,
John



In lugnet.robotics.handyboard, Dan Gates writes:
John,
I added a little sub routine to your program, see if you can use it
this way.
Probably not, but hey it's worth a try. Also, if you don't mind I'd
like to
post it to the yahoo handyboard files too at
http://groups.yahoo.com/group/handyboard/files/
-Dan

/* filename: jrm1.c    John R. McDaniel */

  void main()
             {

  init();         /* Run initialize routine */

  while(1){ /*do this loop endlessly*/


  printf("Test Motors !!\n");   /*print 'Test Motors !!' on LCD*/

  ao(); /*both motor off for 2 seconds*/
  sleep(2.0); /*delay start so can unplug cable*/

  /*go forward*/
  printf("Forward\n"); /*print 'Forward' on LCD*/
  fd(0); /*left motor forward*/
  fd(2); /*right motor forward*/
  sleep(3.0); /*do this for 3 seconds*/
  alloff(); /*let motors coast to stop*/
  sleep(1.0);

  /*turn right*/
  printf("Right\n"); /*print 'Right' on LCD*/
  fd(0); /*left motor forward*/
  bk(2); /*right motor backwards*/
  sleep(2.0); /*do this for 2 seconds*/
  alloff(); /*let motors coast to stop*/
  sleep(1.0);

  /*turn left*/
  printf("Left\n"); /*print 'Left' on LCD*/
  bk(0); /*left motor backwards*/
  fd(2); /*right motor forward*/
  sleep(2.0); /*do this for 2 seconds*/
  alloff(); /*let motors coast to stop*/
  sleep(1.0);

  /*go backward*/
  printf("Back\n"); /*print 'Back' on LCD*/
  bk(0); /*left motor backwards*/
  bk(2); /*right motor backwards*/
  sleep(3.0); /*do this for 3 seconds*/


  alloff(); /*all motors off, rest until next loop*/
  printf("Loop Done\n"); /*print 'Loop Done' on LCD*/

  sleep(5.0); /*pause before doing loop again*/

  }
  }

  /* end */

  /* ****************** Subroutines ************************* */


  void init()
  {
       printf("Press Start to  Go!\n");
       while(!start_button()){}
       tone(800.,1.);
}




Message has 2 Replies:
  Re: JRM code and Reset
 
Wow, What a bugger! This is one of the strangest cases I've seen. Works fine while connected, but not when reset. Works fine on my board either way. Memory and 68HC11 have been traded out. Scope shows no voltage drop at Mem-power durring reset. Both (...) (22 years ago, 2-Jan-02, to lugnet.robotics.handyboard)
  Re: JRM code and Reset
 
Since it seems like everything else has been checked, I have one other suggestion after looking at my pcode source. If the "start" button on the HB is pressed during power on, the autostart will be disabled. Has your hardware been hacked at all, (...) (22 years ago, 2-Jan-02, to lugnet.robotics.handyboard)

Message is in Reply To:
  Re: JRM code and Reset
 
OK, I looked at the source code to try to understand what could be the problem. If anyone wants to download the source themselves, go to (URL) and click on the link at the bottom of the page. The following is true of the open-source (free) version (...) (22 years ago, 2-Jan-02, to lugnet.robotics.handyboard)

16 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR