1number: 1 2line: 1 3offset: 0 4bytes: 15766 5From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 6Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 7 id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 8Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) 9 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 10 for <handyboard@media.mit.edu>; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) 11Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) 12 by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; 13 Wed, 1 Jul 1998 10:56:30 -0500 (CDT) 14Sender: dblank@comp.uark.edu 15Date: Wed, 01 Jul 1998 10:56:30 -0500 16From: Douglas Blank <dblank@comp.uark.edu> 17Organization: University of Arkansas, CS 18X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) 19Mime-Version: 1.0 20To: Aaron Edsinger <aarone@sirius.com> 21Cc: handy <handyboard@media.mit.edu> 22Subject: Re: Serial Interface 23References: <199807010601.XAA26862@mail3.sirius.com> 24Content-Type: text/plain; charset=us-ascii 25Content-Transfer-Encoding: 7bit 26 27Aaron Edsinger wrote: 28 29> Hello, 30> I've been having some problems using my HandyBoard to talk directly to my 31> PC via the serial interface. I disable Interactive C and then Poke() and 32> Peek() as has been described on this list. I send short character strings 33> from my PC to the HandyBoard under Windows 95. If I send strings longer 34> than 2 characters, it seems that some of the characters get lost. This 35> behavior seems to be affected by repositioning or slightly modifying the 36> code, suggesting perhaps a timing issue. 37 38Although there is the HEXMON program, I too, have been trying to do what 39you describe, and encountered the same problems. I found it to be a 40timing issue, and, through trial and error, have a found some settings 41that seem to work most of the time. 42 43My goal was to make C code that looked the same when compiled and run on 44the Host is the code that ran under IC. 45 46I am including the host and HB programs here. If anyone knows of a 47better way of communicating, please let us know. 48 49-Doug Blank 50 51===================================================================== 52dblank@comp.uark.edu Douglas Blank, University of Arkansas 53Assistant Professor Computer Science 54==================== http://www.uark.edu/~dblank ==================== 55 56This code was written for MS C++4.0 running on Win95. 57 58//************** BEGIN: serial_HOST.c 59 60/* VC++4.0 HandyBoard Host Programming System 61 Dr. Douglas S. Blank 62 University of Arkansas, Department of Computer Science 63 www.uark.edu/~dblank 64 65 This code runs on a host PC. 66*/ 67 68#include <ctype.h> 69#include <conio.h> 70#include <stdlib.h> 71#include <stdio.h> 72 73#include "serial_HOST.h" 74 75void main(int argc, char *argv[]) 76{ 77 motor(0, 100); 78 motor(1, 100); 79 motor(2, 100); 80 motor(3, 100); 81 sleep(1000); 82 motor(0, -100); 83 motor(1, -100); 84 motor(2, -100); 85 motor(3, -100); 86 sleep(1000); 87 ao(); 88 print("\nThis is a test"); 89 printf("Knob is %d\n", knob() ); 90 printf("Analog(0) is %d\n", analog(0)); 91 printf("Digital(0) is %d\n", digital(0)); 92 printf("Analog(1) is %d\n", analog(1)); 93 printf("Digital(1) is %d\n", digital(1)); 94 printf("Analog(2) is %d\n", analog(2)); 95 printf("Digital(2) is %d\n", digital(2)); 96 printf("Analog(3) is %d\n", analog(3)); 97 printf("Digital(3) is %d\n", digital(3)); 98 printf("Analog(4) is %d\n", analog(4)); 99 printf("Digital(4) is %d\n", digital(4)); 100 printf("Analog(5) is %d\n", analog(5)); 101 printf("Digital(5) is %d\n", digital(5)); 102 printf("Analog(6) is %d\n", analog(6)); 103 printf("Digital(6) is %d\n", digital(6)); 104 printf("Analog(7) is %d\n", analog(7)); 105 printf("Digital(7) is %d\n", digital(7)); 106 printf("Analog(8) is %d\n", analog(8)); 107 printf("Digital(8) is %d\n", digital(8)); 108 printf("Analog(9) is %d\n", analog(9)); 109 printf("Digital(9) is %d\n", digital(9)); 110 printf("Analog(10) is %d\n", analog(10)); 111 printf("Digital(10) is %d\n", digital(10)); 112 printf("Analog(11) is %d\n", analog(11)); 113 printf("Digital(11) is %d\n", digital(11)); 114 printf("Analog(12) is %d\n", analog(12)); 115 printf("Digital(12) is %d\n", digital(12)); 116 printf("Analog(13) is %d\n", analog(13)); 117 printf("Digital(13) is %d\n", digital(13)); 118 printf("Analog(14) is %d\n", analog(14)); 119 printf("Digital(14) is %d\n", digital(14)); 120 printf("Analog(15) is %d\n", analog(15)); 121 printf("Digital(15) is %d\n", digital(15)); 122 beep(); 123 sleep(1000); 124 while (! stop_button() ) { 125 sprintf(buffer, "%d.0", (knob() * 10)); 126 tone( buffer, "0.1"); 127 } 128} 129 130//************** END: serial_HOST.c 131 132//************** BEGIN: serial_HOST.h 133 134/* VC++4.0 HandyBoard Host Programming System 135 Dr. Douglas S. Blank 136 University of Arkansas, Department of Computer Science 137 www.uark.edu/~dblank 138*/ 139 140#define MOTOR 0 141#define AO 1 142#define ANALOG 2 143#define DIGITAL 3 144#define PRINTF 4 145#define KNOB 5 146#define BEEP 6 147#define TONE 7 148#define START_BUTTON 8 149#define STOP_BUTTON 9 150#define QUIT 113 151 152#define sleep(NUM) _sleep(NUM) 153#define SERIALWAIT 5 154 155unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 156 157int send(int i) { 158 int retval; 159 retval = _outp( PORT, i); 160 _sleep(SERIALWAIT); 161 return retval; 162} 163 164int receive() { 165 int retval; 166 retval = _inp( PORT); 167 _sleep(SERIALWAIT); 168 retval = _inp( PORT); 169 return retval; 170} 171 172void hangup() { 173 send(QUIT); 174} 175 176void print(char buffer[]) { 177 int i; 178 send(PRINTF); 179 for (i = 0; buffer[i] != 0; i++) 180 send(buffer[i]); 181 send('\0'); 182} 183 184void motor(int motornum, int power) { 185 send(MOTOR); 186 send(motornum); 187 send(power + 100); // taken off on the other end 188} 189 190int analog(int sensor) { 191 send(ANALOG); 192 send(sensor); 193 return receive(); 194} 195 196int digital(int sensor) { 197 send(DIGITAL); 198 send(sensor); 199 return receive(); 200} 201 202void ao() { 203 send(AO); 204} 205 206int knob() { 207 send(KNOB); 208 return receive(); 209} 210 211void beep() { 212 send(BEEP); 213} 214 215void tone(char f1[], char f2[]) { 216 int i; 217 send(TONE); 218 for (i = 0; f1[i] != 0; i++) 219 send(f1[i]); 220 send('\0'); 221 for (i = 0; f2[i] != 0; i++) 222 send(f2[i]); 223 send('\0'); 224 _sleep((unsigned long) (atof(f2) * 1000)); // to keep from 225overflowing serial line 226} 227 228void interactive() 229{ 230 char c; 231 char key = ' '; 232 while (key != 'q') { 233 key = getch(); 234 send(key); 235 printf("Sent %c\n", key); 236 c = receive(); 237 printf("Got %c as a return value\n", c); 238 } 239} 240 241int start_button() { 242 send(START_BUTTON); 243 return receive(); 244} 245 246int stop_button() { 247 send(STOP_BUTTON); 248 return receive(); 249} 250//************** END: serial_HOST.h 251 252//************** BEGIN: serial_HB.c 253 254/* VC++4.0 HandyBoard Programming System 255 (Parts taken from other HB programs) 256 Dr. Douglas S. Blank 257 University of Arkansas, Department of Computer Science 258 www.uark.edu/~dblank 259 260 This code runs on the HB 261*/ 262 263#define MOTOR 0 264#define AO 1 265#define ANALOG 2 266#define DIGITAL 3 267#define PRINTF 4 268#define KNOB 5 269#define BEEP 6 270#define TONE 7 271#define START_BUTTON 8 272#define STOP_BUTTON 9 273#define QUIT 113 274 275int _isspace(int a) /* returns 1 for space or tab, 0 276otherwise */ 277 /* internal routine used by atof() and 278cgets() */ 279 280{ 281 return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ 282} 283 284/*****************************************************************************/ 285 286int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ 287 /* internal routine used by atof() */ 288 289{ 290 return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ 291} 292 293float atof(char s[]) /* Convert a string containing a number in 294ASCII */ 295 /* form (integer, float, or exponential float) 296to a */ 297 /* float. Strips whitespace characters (space 298and */ 299 /* tab) from the front of the string, but 300stops */ 301 /* parsing at the first (unexpected) 302non-numeric */ 303 /* character if the string has garbage at the 304end. */ 305 /* This means that " 34.3foo78" translates to 30634.3. */ 307 /* Modified from atof() function in the 308standard */ 309 /* library of the Hi-Tec C compiler for 310CP/M. */ 311 /* Note: all string literals converted to 312decimal */ 313 /* form because IC can't deal with string 314literals */ 315 /* in math 316calculations. */ 317 /* Also note: very ugly code because IC will 318not */ 319 /* allow any math operations on pointers! Thus, 320the */ 321 /* the number string has to be treated as an 322array! */ 323 /* Also also note: no error handling; assumes 324that */ 325 /* the string is a valid representation of a 326number! */ 327 /* Valid range for exponential-format numbers 328is */ 329 /* approximately 2.0e-38 to 3303.4e+38. */ 331 332{ 333 int i=0; /* index into string array */ 334 int sign=0; /* mantissa sign flag: 0=positive, 3351=negative */ 336 int exp0=0; /* mantissa exponent counter */ 337 int eexp=0; /* E-form exponent counter */ 338 int expsign=0; /* exponent sign flag: 0=positive, 3391=negative */ 340 float m=0.0; /* mantissa accumulator */ 341 342 /* skip any leading whitespace (space, tab) */ 343 while (_isspace(s[i])) 344 i++; /* skip it */ 345 346 /* check for mantissa sign */ 347 if (s[i] == 45) /* 45 is '-' */ 348 { 349 sign = 1; /* flag minus sign */ 350 i++; /* point to next */ 351 } 352 else if (s[i] == 43) /* 43 is '+' */ 353 i++; /* point to next */ 354 355 /* now get all digits up to either a decimal point or an e/E */ 356 while (_isdigit(s[i])) 357 { 358 m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ 359 i++; /* point to next */ 360 } 361 362 /* no more digits, so check for decimal point */ 363 if (s[i] == 46) /* 46 is '.' */ 364 { 365 i++; /* point to next */ 366 /* get all digits after decimal point */ 367 while (_isdigit(s[i])) 368 { 369 exp0--; 370 m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ 371 i++; /* point to next */ 372 } 373 } 374 375 /* check for e/E exponential form */ 376 if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ 377 { 378 i++; /* point to next */ 379 /* check for exponent sign */ 380 if (s[i] == 45) /* 45 is '-' */ 381 { 382 expsign = 1; /* flag negative exponent */ 383 i++; /* point to next */ 384 } 385 else if (s[i] == 43) /* 43 is '+' */ 386 i++; /* point to next */ 387 388 /* now get exponent */ 389 while (_isdigit(s[i])) 390 { 391 eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ 392 i++; /* point to next */ 393 } 394 395 /* adjust exponent sign */ 396 if (expsign) 397 eexp = -eexp; /* make it negative */ 398 } 399 400 /* compute absolute value of final float */ 401 exp0 += eexp; 402 while (exp0 < 0) /* for negative exponents */ 403 { 404 m = m / 10.0; 405 exp0++; 406 } 407 while (exp0 > 0) /* for positive exponents */ 408 { 409 m = m * 10.0; 410 exp0--; 411 } 412 413 /* adjust final float sign from mantissa */ 414 if (sign) 415 return (-m); /* negative */ 416 else 417 return (m); /* positive */ 418} 419 420void disable_pcode_serial() 421/* necessary to receive characters using serial_getchar */ 422{ 423 poke(0x3c, 1); 424} 425 426void reenable_pcode_serial() 427/* necessary for IC to interact with board again */ 428{ 429 poke(0x3c, 0); 430} 431 432/* 433====================================================================== 434For sending and receiving single bytes, you can use Randy's IC code: 435*/ 436 437void serial_putchar(int c) 438{ 439 while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty 440*/ 441 poke(0x102f, c); /* send character */ 442} 443 444int serial_getchar() 445{ 446 while (!(peek(0x102e) & 0x20)); /* wait for received character */ 447 return peek(0x102f); 448} 449 450void main(void) { 451 int pos, c = ' ', var1, var2; 452 float f1, f2; 453 char buffer[80]; 454 disable_pcode_serial(); 455 beep(); 456 printf("\nSerial IO Mode!"); 457 printf("Listening..."); 458 msleep(500L); 459 while (c != 'q') { 460 c = serial_getchar(); 461/* printf("[%d] ", c); */ 462 if (c == MOTOR) { 463 var1 = serial_getchar(); 464 var2 = serial_getchar() - 100; 465 motor(var1, var2); 466 } else if (c == AO) { 467 ao(); 468 } else if (c == ANALOG) { 469 var1 = serial_getchar(); 470 serial_putchar(analog(var1)); 471 } else if (c == DIGITAL) { 472 var1 = serial_getchar(); 473 serial_putchar(digital(var1)); 474 } else if (c == PRINTF) { 475 pos = 0; 476 while (c != 0) { 477 buffer[pos++] = c; 478 c = serial_getchar(); 479 } 480 buffer[pos] = '\0'; 481 printf(buffer); 482 } else if (c == TONE) { 483 pos = 0; 484 c = serial_getchar(); 485 while (c != 0) { 486 buffer[pos++] = c; 487 c = serial_getchar(); 488 } 489 buffer[pos] = '\0'; 490 f1 = atof(buffer); 491 pos = 0; 492 c = serial_getchar(); 493 while (c != 0) { 494 buffer[pos++] = c; 495 c = serial_getchar(); 496 } 497 buffer[pos] = '\0'; 498 f2 = atof(buffer); 499 tone(f1, f2); 500 } else if (c == START_BUTTON) { 501 serial_putchar(start_button()); 502 } else if (c == STOP_BUTTON) { 503 serial_putchar(stop_button()); 504 } else if (c == BEEP) { 505 beep(); 506 } else if (c == KNOB) { 507 serial_putchar(knob()); 508 } 509 } 510 reenable_pcode_serial(); 511 printf("\nHB Mode!"); 512} 513 514//************** END: serial_HB.c 515 516number: 2 517line: 512 518offset: 15766 519bytes: 8328 520From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 WETDST 521Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 522 id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 523Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) 524 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 525 for <handyboard@media.mit.edu>; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) 526Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for <handyboard@media.mit.edu>; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) 527Sender: goldt@ee.byu.edu 528Date: Tue, 07 Jul 1998 17:48:41 -0600 529From: "Timothy B. Gold" <goldt@et.byu.edu> 530X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) 531Mime-Version: 1.0 532To: handyboard@media.mit.edu 533Subject: Interrupt Handler for Serial communication 534Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" 535 536This is a multi-part message in MIME format. 537 538--------------18CC6AC44E2E 539Content-Type: text/plain; charset=us-ascii 540Content-Transfer-Encoding: 7bit 541 542Here's a bit of code that will buffer incoming serial information so 543that no information will be lost when transmitting to the handy board. 544There are two files: serial_isr.c and serial_isr.asm. You'll need to 545assemble the .asm file using as11_ic, and then both the .c file and the 546.icb file need to be loaded onto the handy board. I'm sure improvements 547could be made to the code to clean it up a little, but it's a start (and 548I haven't had any problems with it yet). Enjoy! 549 550--------------18CC6AC44E2E 551Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" 552Content-Transfer-Encoding: 7bit 553Content-Disposition: inline; filename="serial_isr.c" 554 555/* C program to read serial port with interrupt service routine */ 556/* First version: Written by Anton Wirsch 20 Nov 1997 */ 557 558/* 559 560 Second Version: Written by Tim Gold 27 May 1998 561 BYU Robotics Lab 562 goldt@et.byu.edu 563 564 Really, the only thing left from the original code are a few 565 lines in the .asm file. Everything else I pretty much had to 566 rewrite from scratch to get it to work the way I wanted to. 567 But the orignal code by Anton was a very helpful starting point. 568 569 Needed files: serial_isr.c 570 serial_isr.icb 571 serial_isr.asm (needed to change the buffer size) 572 573 The buffer size here is 32 bytes (probably much larger than it needs 574 to be.) To change the buffer size, do the following: 575 1. Change the BUFFER_SIZE constant below to the 576 desired number of bytes. 577 2. Edit the line(s) in the serial_isr.asm which contain 578 the word "EDIT" in the comment so that the value 579 matches that of BUFFER_SIZE. 580 3. Recreate the serial_isr.icb file by typing the following: 581 > as11_ic serial_isr.asm 582 583 */ 584 585 586 587 588#define BUFFER_SIZE 32 /* change buffer size here -- see above */ 589 590/* various constants used by the program... */ 591#define BAUD 0x102b /* baud rate set to 9600 */ 592#define SCCR2 0x102d 593#define SCCR1 0x102c 594#define SCSR 0x102e 595#define SCDR 0x102f 596 597int buffer[BUFFER_SIZE]; /* this is the actual buffer */ 598 599 600void initSerial() 601{ 602 /* Call this routine to activate the serial interrupt handler. */ 603 int i,temp; 604 605 /* clear out buffer */ 606 for(i=0; i<BUFFER_SIZE; i++) 607 buffer[i] = 0; 608 609 /* clear vairous flags */ 610 DATA_FLAG = 0; 611 INCOMING = 0; 612 CURRENT = 0; 613 614 /* pass address of buffer to interrupt routine */ 615 buffer_ptr = (int) buffer; 616 BASE_ADDR = (int) buffer; 617 618 /* activate interrupt routine */ 619 temp = peek(SCCR2); 620 temp |= 0x24; 621 poke(SCCR2, temp); 622 poke(0x3c, 1); 623} 624 625void closeSerial() 626{ 627 int temp; 628 629 /* deactivate the interrupt routine */ 630 temp = peek(SCCR2); 631 temp &= 0xdf; 632 poke(SCCR2, temp); 633 READ_SERIAL = 0x0000; 634 poke(0x3c, 0); 635 636} 637 638void serialPutChar(int c) 639{ 640 /* call this function to write a character to the serial port */ 641 642 while (!(peek(0x102e) & 0x80)); 643 poke(0x102f, c); 644 645} 646 647 648int dataAvailable() 649{ 650 /* This function can be used to check to see if any data is available */ 651 return DATA_FLAG; 652} 653 654 655int serialGetChar() 656{ 657 /* Create blocking getchar for serial port... */ 658 int return_char; 659 660 /* loop until data is available */ 661 while(!DATA_FLAG); 662 663 /* get the character to return */ 664 return_char = buffer[CURRENT]; 665 666 /* check for wrap around... */ 667 CURRENT++; 668 if(CURRENT == BUFFER_SIZE) 669 CURRENT = 0; 670 if(CURRENT == INCOMING) 671 DATA_FLAG = 0; 672 return return_char; 673 674} 675 676 677 678 679 680--------------18CC6AC44E2E 681Content-Type: text/plain; charset=us-ascii; name="serial_isr.asm" 682Content-Transfer-Encoding: 7bit 683Content-Disposition: inline; filename="serial_isr.asm" 684 685/* This sets up the serial interrupt service routine */ 686/* First Version: Written by Anton L. Wirsch 20 Nov 1997 */ 687/* Second Version: Written by Tim Gold 27 May 1998 688 BYU Robotics Lab 689 goldt@et.byu.edu 690 691 Really, the only thing left from the original code are a few 692 lines in the .asm file. Everything else I pretty much had to 693 rewrite from scratch to get it to work the way I wanted to. 694 But the orignal code by Anton was a very helpful starting point. 695 696 Needed files: serial_isr.c 697 serial_isr.icb 698 serial_isr.asm (needed to change the buffer size) 699 700 The buffer size here is 32 bytes (probably much larger than it needs 701 to be.) To change the buffer size, do the following: 702 1. Change the BUFFER_SIZE constant in serial_isr.c to the 703 desired number of bytes. 704 2. Edit the line in this fils which contains 705 the word "EDIT" in the comment so that the value 706 matches that of BUFFER_SIZE. 707 3. Recreate the serial_isr.icb file by typing the following: 708 > as11_ic serial_isr.asm 709*/ 710 711 712/* change this line to match your library path... */ 713#include "/usr/local/ic/libs/6811regs.asm" 714 715 ORG MAIN_START 716variable_CURRENT: 717 FDB 00 * ptr to next data to be read by user 718 719variable_INCOMING: 720 FDB 00 * number of bytes received (circular count) 721 722variable_BASE_ADDR: 723 FDB 00 * base address of buffer (to be set by init routine) 724 725variable_DATA_FLAG: 726 FDB 00 * flag set when data is available 727 728variable_buffer_ptr: 729 FDB 00 * pointer to CURRENT buffer 730 731subroutine_initialize_module: 732/* change this line to match your library path... */ 733#include "/usr/local/ic/libs/ldxibase.asm" 734 735 ldd SCIINT,X 736 std interrupt_code_exit+1 737 ldd #interrupt_code_start 738 std SCIINT,X 739 740 rts 741 742interrupt_code_start: 743 ldad variable_INCOMING * store INCOMING into AB 744 cmpb #00 * compare B with 0 745 bhi skip * goto "skip" if (B > 0) 746 ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X 747 inx * SKIP THE FIRST (?) 748 inx * TWO BYTES (?) 749 inx * OFFSET TO THE HIGHER BYTE (?) 750 stx variable_buffer_ptr * SAVE PTR VALUE 751 bra cont 752 753skip: 754 ldx variable_buffer_ptr * load buffer pointer into x 755cont: 756 ldad variable_INCOMING * load INCOMING into AB 757 incb * increment INCOMING 758 cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- 759 beq reset_count * if a=32, goto reset_count 760 bra cont1 761reset_count: 762 ldad #00 * set count to zero 763cont1: 764 stad variable_INCOMING * store AB into INCOMING 765 766 ldab SCSR * load SCSR (SCI status register) into B (why?) 767 ldab SCDR * load SCSR (SCI data register) into B 768 769 stab ,X * store data in array 770 inx * increment by two bytes 771 inx 772 stx variable_buffer_ptr * save the pointer value 773 ldad #01 * load 1 into AB 774 stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) 775interrupt_code_exit: 776 jmp $0000 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793--------------18CC6AC44E2E-- 794 795 796 797number: 3 798line: 789 799offset: 24094 800bytes: 2688 801From aarone@sirius.com Wed Jul 1 02:44:06 1998 MEST 802Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 803 id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 804Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 805 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 806 for <handyboard@media.mit.edu>; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) 807Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) 808 by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 809 for <handyboard@media.mit.edu>; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) 810From: "Aaron Edsinger" <aarone@sirius.com> 811To: "handy" <handyboard@media.mit.edu> 812Subject: Serial Interface 813Date: Wed, 1 Jul 1998 02:06:39 +0100 814X-Msmail-Priority: Normal 815X-Priority: 3 816X-Mailer: Microsoft Internet Mail 4.70.1162 817Mime-Version: 1.0 818Content-Type: text/plain; charset=ISO-8859-1 819Content-Transfer-Encoding: 7bit 820 821Hello, 822 I've been having some problems using my HandyBoard to talk directly to my 823PC via the serial interface. I disable Interactive C and then Poke() and 824Peek() as has been described on this list. I send short character strings 825from my PC to the HandyBoard under Windows 95. If I send strings longer 826than 2 characters, it seems that some of the characters get lost. This 827behavior seems to be affected by repositioning or slightly modifying the 828code, suggesting perhaps a timing issue. 829 830Why might this be? Is there any way to check for an error situation? 831 832Thanks for any help, 833 Aaron 834From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 835Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 836 id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 837Received: from hq.freegate.com ([208.226.86.1]) 838 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 839 for <handyboard@media.mit.edu>; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) 840Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 841Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) 842 by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 843Date: Wed, 15 Jul 1998 23:21:14 -0700 844From: Chuck McManis <cmcmanis@freegate.com> 845Reply-To: cmcmanis@freegate.com 846Organization: Freegate Corporation 847X-Mailer: Mozilla 4.04 [en] (Win95; I) 848Mime-Version: 1.0 849To: David Rye <rye@mech.eng.usyd.edu.au> 850Cc: handyboard@media.mit.edu 851Subject: Re: Handyboard/RWP without p-code 852References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> 853Content-Type: text/plain; charset=us-ascii 854Content-Transfer-Encoding: 7bit 855 856Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the 857handyboard library from their site. 858 859--Chuck 860 861number: 4 862line: 849 863offset: 26782 864bytes: 5890 865From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 866Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 867 id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 868Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) 869 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 870 for <handyboard@media.mit.edu>; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) 871Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 872Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 873 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 874Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 875 id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 876Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) 877From: Scott Seaton - Systems Consultant - ESG <Scott.Seaton@Aus.Sun.COM> 878Reply-To: Scott Seaton - Systems Consultant - ESG <Scott.Seaton@Aus.Sun.COM> 879Subject: Re: Handyboard/RWP without p-code 880To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au 881Mime-Version: 1.0 882Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 883X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc 884 885--Troop_of_Baboons_752_000 886Content-Type: TEXT/plain; charset=us-ascii 887Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== 888 889Hi 890 891I suggest that you contact ImageCraft. 892http://www.imagecraft.com/software/index.html or info@imagecraft.com 893 894They have a C compiler for 68HC11 CPU's that will do what you want, including a 895library for the HandyBoard (see attached e-mail) ! 896 897I have no affiliation with ImageCraft (other than as a satisfied customer). 898 899Hope this helps 900Scott 901============================================================================== 902 ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant 903/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com 904\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 905 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 906============================================================================== 907 908--Troop_of_Baboons_752_000 909Content-Type: MESSAGE/rfc822; name=Mailbox 910Content-Description: Mailbox 911 912From someone@imagecraft.com Fri Jul 10 18:59:26 1998 913Return-Path: <icc11-list-errors@lists.best.com> 914Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 915 id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 916Received: from earth.sun.com by Aus.Sun.COM id SAA24238 917 (SMI-8.6/SMI-4.1 for <<scott.seaton@aus.sun.com>>); Fri, 10 Jul 1998 18:59:48 +1000 918Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 919 by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 920 for <scott.seaton@aus.sun.com>; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 921Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for <sseaton@iise.csiro.au>; Fri, 10 Jul 1998 18:49:31 +1000 922Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 923Message-Id: <199807100804.BAA15320@lists1.best.com> 924From: Christina Willrich & Richard Man <someone@imagecraft.com> 925Subject: icc11 Handyboard library available 926Date: Fri, 10 Jul 1998 00:58:49 -0700 927BestServHost: lists.best.com 928MIME-Version: 1.0 929Content-Type: text/plain; charset="us-ascii" 930Sender: icc11-list-errors@lists.best.com 931Errors-To: icc11-list-errors@lists.best.com 932Reply-To: icc11-list@lists.best.com 933To: icc11-list@lists.best.com 934content-length: 399 935Status: RO 936X-Status: $$$$ 937X-UID: 0000000001 938 939At long last, I dusted off Chuck McManis Handyboard library and ported it 940to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 941out, point your browser to 942 943ftp://ftp.imagecraft.com/pub/libhb.zip 944 945Chuck really did a great job with the LCD. There are commands to scroll, 946move etc. Make sure you try the lcdtest2.c test. 947 948// richard 949someone@imagecraft.com http://www.imagecraft.com 950 951From someone2@imagecraft.com Fri Jul 10 18:59:26 1998 952Return-Path: <icc11-list-errors@lists.best.com> 953Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 954 id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 955Received: from earth.sun.com by Aus.Sun.COM id SAA24238 956 (SMI-8.6/SMI-4.1 for <<scott.seaton@aus.sun.com>>); Fri, 10 Jul 1998 18:59:48 +1000 957Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 958 by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 959 for <scott.seaton@aus.sun.com>; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 960Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for <sseaton@iise.csiro.au>; Fri, 10 Jul 1998 18:49:31 +1000 961Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 962Message-Id: <199807100804.BAA15320@lists1.best.com2> 963From: Christina Willrich & Richard Man <someone@imagecraft.com> 964Subject: icc11 Handyboard library available 2 965Date: Fri, 10 Jul 1998 00:58:49 -0700 966BestServHost: lists.best.com 967MIME-Version: 1.0 968Content-Type: text/plain; charset="us-ascii" 969Sender: icc11-list-errors@lists.best.com 970Errors-To: icc11-list-errors@lists.best.com 971Reply-To: icc11-list@lists.best.com 972To: icc11-list@lists.best.com 973content-length: 399 974Status: RO 975X-Status: $$$$ 976X-UID: 0000000001 977 978At long last, I dusted off Chuck McManis Handyboard library and ported it 979to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 980out, point your browser to 981 982ftp://ftp.imagecraft.com/pub/libhb.zip 983 984Chuck really did a great job with the LCD. There are commands to scroll, 985move etc. Make sure you try the lcdtest2.c test. 986 987// richard 988someone@imagecraft.com http://www.imagecraft.com 989 990 991--Troop_of_Baboons_752_000-- 992 993number: 5 994line: 977 995offset: 32672 996bytes: 2103 997From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 998Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 999 id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 1000Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) 1001 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 1002 for <handyboard@media.mit.edu>; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) 1003Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) 1004 id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 1005Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) 1006 by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; 1007 Tue, 30 Jun 1998 22:34:32 -0400 (EDT) 1008Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) 1009From: David Kott <dakott@alpha.delta.edu> 1010Sender: dakott@kott.my.domain 1011To: brian-c@technologist.com 1012Cc: handyboard@media.mit.edu 1013Subject: Re: microcontroller 1014In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> 1015Mime-Version: 1.0 1016Content-Type: TEXT/PLAIN; charset=US-ASCII 1017 1018On Mon, 29 Jun 1998 brian-c@technologist.com wrote: 1019 1020> -I'd like to say thanks to all the folks who replied 1021> to my question on the microcontroller speeds. 1022> 1023> Here's another general question about them though. 1024> Should any unused pins be left open or should they 1025> be grounded? 1026> 1027 1028Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 10294.7K resistor... presuming, of course, that a Logic 0 on that input won't 1030generate adverse effects, e.g. a grounded active low interrupt line 1031might be a problem. Such inputs should be taken to +5 with a 4.7K 1032resistor. 1033 1034Floating CMOS inputs have a tendency to oscillate with the merest whisper 1035of a voltage. 1036 1037TTL inputs may be left floating. 1038 1039Driving an output externally will just heat up your CPU.. or worse. 1040 1041 -d 1042 1043-- 1044 The box said "Requires Windows 95/NT or better"... 1045 So I got Unix. 1046 1047Free the Source. Free your Computer... http://www.FreeBSD.org 1048 http://www.NetBSD.org 1049 http://www.OpenBSD.org 1050 1051number: 6 1052line: 1031 1053offset: 34775 1054bytes: 7625 1055From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 1056Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1057 id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 1058Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) 1059 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 1060 for <handyboard@media.mit.edu>; Sun, 22 Mar 1998 01:08:09 -0500 (EST) 1061Received: from localhost by cyber.sfgate.com with smtp 1062 (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) 1063Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) 1064From: Richard <rshirk@sfgate.com> 1065X-Sender: rshirk@cyber 1066To: handyboard@media.mit.edu 1067Subject: Frob nobs and IR 1068Mime-Version: 1.0 1069Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" 1070 1071 This message is in MIME format. The first part should be readable text, 1072 while the remaining parts are likely unreadable without MIME-aware tools. 1073 Send mail to mime@docserver.cac.washington.edu for more info. 1074 1075---559023410-1804928587-890546857=:21628 1076Content-Type: TEXT/PLAIN; charset=US-ASCII 1077 1078OK...Im now pretty happy with states of things but I still have a few 1079questions I hope you can help me answer. The code attached works and 1080everything, but only when i take the bit about playing the songs out. 1081 1082problem 1) 1083 It 1084keeps saying that play is undefined. I saw that before and fixed it by 1085changing the names of the labels of the songs. I tried it this time and 1086it didnt work...i was wondering if anyone out there knows why it does this 1087and how to correct it.... 1088 1089problem 2) 1090 1091I figured out (thanks to you guys) how to work the built in IR sensor to 1092detect and act upon 4 signals. One is for behing hostile, 3 is for 1093seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores 1094it. 1095The signal for being Hostile responds quickly and prints H on the screen 1096but the others lag and i was wondering if you knew why this was. 1097 1098-Richard 1099 1100---559023410-1804928587-890546857=:21628 1101Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" 1102Content-Transfer-Encoding: BASE64 1103Content-ID: <Pine.SOL.3.96.980321220737.21628D@cyber> 1104Content-Description: 1105 1106LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg 1107bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 1108ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy 1109ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz 1110YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj 1111M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm 1112ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh 1113ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg 1114M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN 1115ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg 1116bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 1117dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg 1118ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g 1119ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg 1120IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg 1121ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg 1122IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 1123DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg 1124ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg 1125ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 1126PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF 1127TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM 1128KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU 1129XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv 1130biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg 1131YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 1132ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g 1133ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg 1134IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg 1135Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl 1136ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg 1137ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 1138cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg 1139KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q 1140IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi 1141ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg 1142ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo 1143ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl 1144cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg 1145ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg 1146KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy 1147ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy 1148b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv 1149biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp 1150Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh 1151IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g 1152ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp 1153Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg 1154ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs 1155ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg 1156ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl 1157dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g 1158ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg 1159ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl 1160Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg 1161ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg 1162ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg 1163ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg 1164ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg 1165MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly 1166X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg 1167ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g 1168cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN 1169ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i 1170b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi 1171ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN 1172ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt 1173ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg 1174ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q 1175R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk 1176KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg 1177ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl 1178Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi 1179KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg 1180ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs 1181ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u 1182b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg 1183ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg 1184ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp 1185Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg 1186ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw 1187KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg 1188ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj 1189ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp 1190Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg 1191IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 1192IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg 1193ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw 1194KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg 1195ICB9DQ0gICB9DX0N 1196---559023410-1804928587-890546857=:21628-- 1197 1198number: 7 1199line: 1174 1200offset: 42400 1201bytes: 3044 1202From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 1203Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1204 id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 1205Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) 1206 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 1207 for <handyboard@media.mit.edu>; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) 1208Received: from localhost (wallace@localhost) 1209 by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 1210 for <handyboard@media.mit.edu>; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) 1211Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) 1212From: Mark Wallace <wallace@theory.phys.vt.edu> 1213To: handyboard@media.mit.edu 1214Subject: sonar.c for the handyboard 1215Mime-Version: 1.0 1216Content-Type: TEXT/PLAIN; charset=US-ASCII 1217 1218Hello, 1219 I have a handyboard and 6500 series poloroid ultrasonic ranging 1220system. I have downloaded the sonar.c programs used to drive the 1221transducer for distance measurements. There appears to be a problem, or 1222atleast I think there is, with it. The sonar device is supposed to give 1223distances of up to 35ft but the TCNC time register is 16 bit and in the 1224program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has 1225elapsed and it returns -1. Therefore as soon as about 32700 counts goes 1226by, that value will go negative. I believe hex goes from 0 to 32768 then 1227-32768 to -1. In this case the difference will be < 0 if the object 1228is greater then about 9 ft. I have taken this out of the program and can 1229get accurate measurements up to atleast 30 ft but I have to look at the 1230value given and add multiples of 2^16 to it to figure out where it is. 1231Taking this out of the program also can get you stuck if you really are 1232out of range. 1233 I have looked on the motorola web pages to see about this clock 1234and it says that the clock goes till it reachs $ffff and then flags 1235somewhere that there is an overflow and then starts over. I don't know 1236how to find out were in the chip this information might be stored. I know 1237the TCNT time register is at 0x100e from the notes on Simplified Sonar for 1238the Handy Board but I don't know where that overflow flag is stored. I 1239thought that maybe by setting this flag and using it in the loop you might 1240be about to get a greater distance out of you measurement. 1241 Another question I have is about IC. I would like to display 1242numbers greater then 32000 and right now there are several int type 1243variables and normal C comands don't seem to work to make a "long" or any 1244other type that are larger then 32000. How does IC handle larger numbers? 1245 I am only a student and don't have much experience with this stuff 1246so I would appreciate any feedback I can get on either of these problems. 1247Thanks. 1248 1249Mark Wallace 1250 1251 e-mail mawalla3@vt.edu 1252 wallace@astro.phys.vt.edu 1253Web page http://sps1.phys.vt.edu/~mwallace/index.html 1254 1255"What a waste it would be after 4 billion tortuous years of evolution if 1256the dominant organism contrived its own self-destruction" 1257 Carl Sagan 1258 1259 1260number: 8 1261line: 1232 1262offset: 45444 1263bytes: 3216 1264From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 1265Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1266 id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 1267Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) 1268 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 1269 for <handyboard@media.mit.edu>; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) 1270Received: from localhost (mwallace@localhost) 1271 by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; 1272 Mon, 3 Aug 1998 11:16:50 -0400 1273Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) 1274From: Mark Wallace <mwallace@sps1.phys.vt.edu> 1275To: alf.kuchenbuch@usa.net 1276Cc: handyboard@media.mit.edu 1277Subject: Re: Polaroid trouble again 1278In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> 1279Mime-Version: 1.0 1280Content-Type: TEXT/PLAIN; charset=US-ASCII 1281 1282 I had this same problem when I got mine a few weeks ago. I ended up 1283putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. 1284I also had to take out the 1k resistor from the BINH. It kept 1285BINH at 1 V instead of Zero and that seamed to cause problems. 1286 As for the 6 ft problem, it should be closer to 9 ft. I think 1287the problem there is the IC code you used. If you used the code for 1288SONAR.C from the HB web site then there is a problem with it. What that 1289program does is take the difference in time from the internal clock. the 1290problem is that in the code it says that if the difference between start 1291time and currnet time is negative too much time has elapsed. Well, this 1292has a 16 bit counter so when the difference is greater the about 32,700 it 1293becomes negative. If you do the math, that means at about 9 ft that 1294happens so it tell you you are out of range. 1295 The way I fixed this was to slow the clock down. 1296 1297I looked up information on the motorola web page and found where the 1298prescalers were for the clock. 1299 If you want to slow it down by a factor of four you can just add 1300this line to you program in sonar_init() 1301 1302 bit_set(0x1024, 1); 1303 1304I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and 1305bit_set(0x1024, 3); will slow it down by a factor of 16. 1306 There are better ways of fixing this problem but they appear much 1307more complicated. For example the motorola chip has an overflow flag that 1308says when the internal clock flips. You could incorporate that into your 1309code instead of slowing the clock down. Good luck and I hope this helps. 1310 1311Mark Wallace 1312 1313 e-mail mawalla3@vt.edu 1314 mwallace@sps1.phys.vt.edu 1315Web page http://sps1.phys.vt.edu/~mwallace/index.html 1316 1317"What a waste it would be after 4 billion tortuous years of evolution if 1318the dominant organism contrived its own self-destruction" 1319 Carl Sagan 1320 1321On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: 1322 1323> Hi! 1324> I am having trouble with my Polaroid sonar: 1325> When I keep my HB hooked up 1326> to external power, I will only get correct readings up to 20 inches. As 1327> soon as I use battery power without hooking it up to external power, the 1328> readings are correct up to 6 feet, not more! This sound like EMI, I 1329> guess. I tried all the capacitor tricks from HB mailing list, but in 1330> vain. Do you know a fix that works? 1331> 1332> Alf H. Kuchenbuch 1333> 1334 1335 1336number: 9 1337line: 1304 1338offset: 48660 1339bytes: 1867 1340From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 1341Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1342 id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 1343Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) 1344 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 1345 for <Handyboard@media.mit.edu>; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) 1346Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) 1347 by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 1348 for <Handyboard@media.mit.edu>; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) 1349Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) 1350 by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 1351 for <Handyboard@media.mit.edu>; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) 1352X-Sender: mawalla3@mail.vt.edu (Unverified) 1353X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) 1354Date: Wed, 12 Aug 1998 12:13:45 -0400 1355To: Handyboard@media.mit.edu 1356From: Mark Wallace <mawalla3@vt.edu> 1357Subject: serial library for C++ 1358Mime-Version: 1.0 1359Content-Type: text/plain; charset="us-ascii" 1360 1361Hello, 1362 I have a handy board with poloroid transducers and I am trying use the 1363results of my distance measurments in a C++ program on the computer. I 1364have found programs on the handyboard web page that should alow the 1365handyboard to transmit information over the serial line. What I am looking 1366for is if anyone knows were I could find a serial for Microsofts 1367Visual C++ 5.0. I would like to find one that is free or sharware but any 1368information on any serial that will work would be appreciated. 1369Thanks. 1370Mark Wallace 1371 1372 e-mail mawalla3@vt.edu 1373 mwallace@sps1.phys.vt.edu 1374web page http://sps1.phys.vt.ede/~mwallace 1375 1376"What a waist it would be after 4 billion tortuous years of evolution if 1377the dominant organism contrived its own self-distruction" 1378 Carl Sagan 1379 1380 1381number: 10 1382line: 1345 1383offset: 50527 1384bytes: 1407 1385From aarone@sirius.com Wed Sep 30 12:35:05 1998 1386Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) 1387 id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 1388Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 1389 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 1390 for <handyboard@media.mit.edu>; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) 1391Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) 1392 by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; 1393 Wed, 30 Sep 1998 07:46:49 -0700 (PDT) 1394From: "Aaron Edsinger" <aarone@sirius.com> 1395To: "Keith - Lui" <luikeith@egr.msu.edu> 1396Cc: "handy" <handyboard@media.mit.edu> 1397Subject: Re: output to file 1398Date: Wed, 30 Sep 1998 10:47:58 -0700 1399Mime-Version: 1.0 1400Content-Type: text/plain; 1401 charset="iso-8859-1" 1402Content-Transfer-Encoding: 7bit 1403X-Priority: 3 1404X-Msmail-Priority: Normal 1405X-Mailer: Microsoft Outlook Express 4.72.2106.4 1406X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 1407 1408Yes, 1409 Write a dos/windows client that reads the serial line and then 1410writes it to file using the C stdio library. 1411 1412 1413-----Original Message----- 1414From: Keith - Lui <luikeith@egr.msu.edu> 1415To: handyboard@media.mit.edu <handyboard@media.mit.edu> 1416Date: Wednesday, September 30, 1998 6:55 AM 1417Subject: output to file 1418 1419 1420>Dear all, 1421> 1422>I would like to output some HB data to a file, is that possible? 1423> 1424>Keith 1425> 1426 1427 1428 1429number: 11 1430line: 1389 1431offset: 51934 1432bytes: 2195 1433From aarone@sirius.com Wed Aug 12 13:42:19 1998 1434Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1435 id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 1436Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 1437 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 1438 for <handyboard@media.mit.edu>; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) 1439Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) 1440 by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; 1441 Wed, 12 Aug 1998 09:48:24 -0700 (PDT) 1442From: "Aaron Edsinger" <aarone@sirius.com> 1443To: "Mark Wallace" <mawalla3@vt.edu> 1444Cc: "handy" <handyboard@media.mit.edu> 1445Subject: Re: serial library for C++ 1446Date: Wed, 12 Aug 1998 12:53:41 -0700 1447Mime-Version: 1.0 1448Content-Type: text/plain; 1449 charset="iso-8859-1" 1450Content-Transfer-Encoding: 7bit 1451X-Priority: 3 1452X-Msmail-Priority: Normal 1453X-Mailer: Microsoft Outlook Express 4.72.2106.4 1454X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 1455 1456 1457 Check out this site. It works well. The only problem I had was timing 1458issues when trying to read and write to the port too quickly. 1459 1460http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml 1461 1462 1463-----Original Message----- 1464From: Mark Wallace <mawalla3@vt.edu> 1465To: Handyboard@media.mit.edu <Handyboard@media.mit.edu> 1466Date: Wednesday, August 12, 1998 9:25 AM 1467Subject: serial library for C++ 1468 1469 1470>Hello, 1471> I have a handy board with poloroid transducers and I am trying use the 1472>results of my distance measurments in a C++ program on the computer. I 1473>have found programs on the handyboard web page that should alow the 1474>handyboard to transmit information over the serial line. What I am looking 1475>for is if anyone knows were I could find a serial library for Microsofts 1476>Visual C++ 5.0. I would like to find one that is free or sharware but any 1477>information on any serial librarys that will work would be appreciated. 1478>Thanks. 1479>Mark Wallace 1480> 1481> e-mail mawalla3@vt.edu 1482> mwallace@sps1.phys.vt.edu 1483>web page http://sps1.phys.vt.ede/~mwallace 1484> 1485>"What a waist it would be after 4 billion tortuous years of evolution if 1486>the dominant organism contrived its own self-distruction" 1487> Carl Sagan 1488> 1489 1490number: 12 1491line: 1446 1492offset: 54129 1493bytes: 4017 1494From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 1495Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1496 id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 1497Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) 1498 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 1499 for <handyboard@media.mit.edu>; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) 1500Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 1501Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 1502 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 1503Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 1504 id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 1505Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) 1506From: Scott Seaton - Systems Consultant - ESG <Scott.Seaton@Aus.Sun.COM> 1507Reply-To: Scott Seaton - Systems Consultant - ESG <Scott.Seaton@Aus.Sun.COM> 1508Subject: Re: Handyboard/RWP without p-code 1509To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au 1510Mime-Version: 1.0 1511Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 1512X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc 1513 1514--Troop_of_Baboons_752_000 1515Content-Type: TEXT/plain; charset=us-ascii 1516Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== 1517 1518Hi 1519 1520I suggest that you contact ImageCraft. 1521http://www.imagecraft.com/software/index.html or info@imagecraft.com 1522 1523They have a C compiler for 68HC11 CPU's that will do what you want, including a 1524library for the HandyBoard (see attached e-mail) ! 1525 1526I have no affiliation with ImageCraft (other than as a satisfied customer). 1527 1528Hope this helps 1529Scott 1530============================================================================== 1531 ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant 1532/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com 1533\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 1534 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 1535============================================================================== 1536 1537--Troop_of_Baboons_752_000 1538Content-Type: MESSAGE/rfc822; name=Mailbox 1539Content-Description: Mailbox 1540 1541From someone@imagecraft.com Fri Jul 10 18:59:26 1998 1542Return-Path: <icc11-list-errors@lists.best.com> 1543Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 1544 id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 1545Received: from earth.sun.com by Aus.Sun.COM id SAA24238 1546 (SMI-8.6/SMI-4.1 for <<scott.seaton@aus.sun.com>>); Fri, 10 Jul 1998 18:59:48 +1000 1547Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 1548 by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 1549 for <scott.seaton@aus.sun.com>; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 1550Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for <sseaton@iise.csiro.au>; Fri, 10 Jul 1998 18:49:31 +1000 1551Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 1552From: Christina Willrich & Richard Man <someone@imagecraft.com> 1553Subject: icc11 Handyboard library available 1554Date: Fri, 10 Jul 1998 00:58:49 -0700 1555BestServHost: lists.best.com 1556MIME-Version: 1.0 1557Content-Type: text/plain; charset="us-ascii" 1558Sender: icc11-list-errors@lists.best.com 1559Errors-To: icc11-list-errors@lists.best.com 1560Reply-To: icc11-list@lists.best.com 1561To: icc11-list@lists.best.com 1562content-length: 399 1563Status: RO 1564X-Status: $$$$ 1565X-UID: 0000000001 1566 1567At long last, I dusted off Chuck McManis Handyboard library and ported it 1568to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 1569out, point your browser to 1570 1571ftp://ftp.imagecraft.com/pub/libhb.zip 1572 1573Chuck really did a great job with the LCD. There are commands to scroll, 1574move etc. Make sure you try the lcdtest2.c test. 1575 1576// richard 1577someone@imagecraft.com http://www.imagecraft.com 1578 1579 1580--Troop_of_Baboons_752_000-- 1581 1582number: 13 1583line: 1534 1584offset: 58146 1585bytes: 7697 1586From brian-c@technologist.com Mon Jul 6 11:54:19 1998 1587Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1588 id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 1589Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) 1590 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 1591 for <handyboard@media.mit.edu>; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) 1592From: brian-c@technologist.com 1593Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) 1594Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) 1595Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" 1596Mime-Version: 1.0 1597To: Terri A Mortvedt <terrim@iastate.edu>, handyboard@media.mit.edu 1598Subject: Re: Steppers 1599 1600--0-0-0-0-0-0-0-0-____====$%& 1601Content-Type: text/plain 1602Content-Transfer-Encoding: quoted-printable 1603X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 1604 1605Dear Terri, 1606 1607If the motors turn sparatically, that means the coils 1608are probably not hooked up in the correct order. Try 1609swapping them around and see if anything improves. 1610 1611The motors you are using are the bipolar type. There=20 1612is a decent way of hooking up unipolar steppers to 1613the HB at http://www.cctc.demon.co.uk/stepper.htm 1614A basic difference between bipolar and unipolar is 1615that unipolar motors have additional wires are=20 1616connected to the power supply. Bipolars also have more 1617torque. 1618 1619Using fd(); and bk(); commands to power steppers is 1620probably a lot to handle. I recommend trying the=20 1621method found on that link. There's even sample coding. 1622You will have to modify some variables for the turn 1623functions because your turning radius varies according 1624to your distance between motors. 1625 1626I modified the step(); function to produce a gradual=20 1627increase in speed, and a gradual decrease in speed once 1628the specified steps are almost complete.=20 1629 1630I will attach my motors.c file as is. 1631 1632 1633 1634_________________________________________________ 1635=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= 1636=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF 1637Brian Carvalho [ brian-c@ieee.org ] 1638DeVRY Institute 1639New Jersey 1640_________________________________________________ 1641=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= 1642=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF 1643--------------------------------------------------- 1644Get free personalized email at http://www.iname.com 1645 1646--0-0-0-0-0-0-0-0-____====$%& 1647Content-Type: application/octet-stream 1648Content-disposition: inline; filename=Motors.c 1649Content-Transfer-Encoding: base64 1650 1651 1652 1653LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg 1654PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj 1655dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg 1656ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV 1657QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg 1658ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 1659Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt 1660b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog 1661DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm 1662IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 1663MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n 1664IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv 1665bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN 1666CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 1667KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp 1668DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 1669ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z 1670dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 1671ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg 1672IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS 1673RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln 1674aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y 1675X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu 1676dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 1677DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl 1678ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu 1679Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 1680DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk 1681ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp 1682DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT 1683KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs 1684ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG 1685VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo 1686Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp 1687Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q 1688IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv 1689ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS 1690RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo 1691KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk 1692IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy 1693biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS 1694TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf 1695c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM 1696T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg 1697ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ 1698CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB 1699UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 1700DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs 1701IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr 1702KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v 1703dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg 1704ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K 1705ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs 1706b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw 1707PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk 1708aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z 1709dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo 1710Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl 1711cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 1712ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls 1713ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 1714DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf 1715c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg 1716IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp 1717Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K 1718 1719 1720--0-0-0-0-0-0-0-0-____====$%&-- 1721