Debian Codegraph @

t/results/unique_all_2

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