Debian Codegraph @

t/results/not_handy

raw
1 From [email protected] Tue Jul 7 20:33:03 1998
2 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM)
3 id AA32480; Tue, 7 Jul 1998 20:33:03 -0400
4 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54])
5 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127
6 for <[email protected]>; Tue, 7 Jul 1998 19:48:43 -0400 (EDT)
7 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)
8 Sender: [email protected]
9 Message-Id: <[email protected]>
10 Date: Tue, 07 Jul 1998 17:48:41 -0600
11 From: "Timothy B. Gold" <[email protected]>
12 X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780)
13 Mime-Version: 1.0
14 To: [email protected]
15 Subject: Interrupt Handler for Serial communication
16 Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E"
17
18 This is a multi-part message in MIME format.
19
20 --------------18CC6AC44E2E
21 Content-Type: text/plain; charset=us-ascii
22 Content-Transfer-Encoding: 7bit
23
24 Here's a bit of code that will buffer incoming serial information so
25 that no information will be lost when transmitting to the handy board.
26 There are two files: serial_isr.c and serial_isr.asm. You'll need to
27 assemble the .asm file using as11_ic, and then both the .c file and the
28 .icb file need to be loaded onto the handy board. I'm sure improvements
29 could be made to the code to clean it up a little, but it's a start (and
30 I haven't had any problems with it yet). Enjoy!
31
32 --------------18CC6AC44E2E
33 Content-Type: text/plain; charset=us-ascii; name="serial_isr.c"
34 Content-Transfer-Encoding: 7bit
35 Content-Disposition: inline; filename="serial_isr.c"
36
37 /* C program to read serial port with interrupt service routine */
38 /* First version: Written by Anton Wirsch 20 Nov 1997 */
39
40 /*
41
42 Second Version: Written by Tim Gold 27 May 1998
43 BYU Robotics Lab
44 [email protected]
45
46 Really, the only thing left from the original code are a few
47 lines in the .asm file. Everything else I pretty much had to
48 rewrite from scratch to get it to work the way I wanted to.
49 But the orignal code by Anton was a very helpful starting point.
50
51 Needed files: serial_isr.c
52 serial_isr.icb
53 serial_isr.asm (needed to change the buffer size)
54
55 The buffer size here is 32 bytes (probably much larger than it needs
56 to be.) To change the buffer size, do the following:
57 1. Change the BUFFER_SIZE constant below to the
58 desired number of bytes.
59 2. Edit the line(s) in the serial_isr.asm which contain
60 the word "EDIT" in the comment so that the value
61 matches that of BUFFER_SIZE.
62 3. Recreate the serial_isr.icb file by typing the following:
63 > as11_ic serial_isr.asm
64
65 */
66
67
68
69
70 #define BUFFER_SIZE 32 /* change buffer size here -- see above */
71
72 /* various constants used by the program... */
73 #define BAUD 0x102b /* baud rate set to 9600 */
74 #define SCCR2 0x102d
75 #define SCCR1 0x102c
76 #define SCSR 0x102e
77 #define SCDR 0x102f
78
79 int buffer[BUFFER_SIZE]; /* this is the actual buffer */
80
81
82 void initSerial()
83 {
84 /* Call this routine to activate the serial interrupt handler. */
85 int i,temp;
86
87 /* clear out buffer */
88 for(i=0; i<BUFFER_SIZE; i++)
89 buffer[i] = 0;
90
91 /* clear vairous flags */
92 DATA_FLAG = 0;
93 INCOMING = 0;
94 CURRENT = 0;
95
96 /* pass address of buffer to interrupt routine */
97 buffer_ptr = (int) buffer;
98 BASE_ADDR = (int) buffer;
99
100 /* activate interrupt routine */
101 temp = peek(SCCR2);
102 temp |= 0x24;
103 poke(SCCR2, temp);
104 poke(0x3c, 1);
105 }
106
107 void closeSerial()
108 {
109 int temp;
110
111 /* deactivate the interrupt routine */
112 temp = peek(SCCR2);
113 temp &= 0xdf;
114 poke(SCCR2, temp);
115 READ_SERIAL = 0x0000;
116 poke(0x3c, 0);
117
118 }
119
120 void serialPutChar(int c)
121 {
122 /* call this function to write a character to the serial port */
123
124 while (!(peek(0x102e) & 0x80));
125 poke(0x102f, c);
126
127 }
128
129
130 int dataAvailable()
131 {
132 /* This function can be used to check to see if any data is available */
133 return DATA_FLAG;
134 }
135
136
137 int serialGetChar()
138 {
139 /* Create blocking getchar for serial port... */
140 int return_char;
141
142 /* loop until data is available */
143 while(!DATA_FLAG);
144
145 /* get the character to return */
146 return_char = buffer[CURRENT];
147
148 /* check for wrap around... */
149 CURRENT++;
150 if(CURRENT == BUFFER_SIZE)
151 CURRENT = 0;
152 if(CURRENT == INCOMING)
153 DATA_FLAG = 0;
154 return return_char;
155
156 }
157
158
159
160
161
162 --------------18CC6AC44E2E
163 Content-Type: text/plain; charset=us-ascii; name="serial_isr.asm"
164 Content-Transfer-Encoding: 7bit
165 Content-Disposition: inline; filename="serial_isr.asm"
166
167 /* This sets up the serial interrupt service routine */
168 /* First Version: Written by Anton L. Wirsch 20 Nov 1997 */
169 /* Second Version: Written by Tim Gold 27 May 1998
170 BYU Robotics Lab
171 [email protected]
172
173 Really, the only thing left from the original code are a few
174 lines in the .asm file. Everything else I pretty much had to
175 rewrite from scratch to get it to work the way I wanted to.
176 But the orignal code by Anton was a very helpful starting point.
177
178 Needed files: serial_isr.c
179 serial_isr.icb
180 serial_isr.asm (needed to change the buffer size)
181
182 The buffer size here is 32 bytes (probably much larger than it needs
183 to be.) To change the buffer size, do the following:
184 1. Change the BUFFER_SIZE constant in serial_isr.c to the
185 desired number of bytes.
186 2. Edit the line in this fils which contains
187 the word "EDIT" in the comment so that the value
188 matches that of BUFFER_SIZE.
189 3. Recreate the serial_isr.icb file by typing the following:
190 > as11_ic serial_isr.asm
191 */
192
193
194 /* change this line to match your library path... */
195 #include "/usr/local/ic/libs/6811regs.asm"
196
197 ORG MAIN_START
198 variable_CURRENT:
199 FDB 00 * ptr to next data to be read by user
200
201 variable_INCOMING:
202 FDB 00 * number of bytes received (circular count)
203
204 variable_BASE_ADDR:
205 FDB 00 * base address of buffer (to be set by init routine)
206
207 variable_DATA_FLAG:
208 FDB 00 * flag set when data is available
209
210 variable_buffer_ptr:
211 FDB 00 * pointer to CURRENT buffer
212
213 subroutine_initialize_module:
214 /* change this line to match your library path... */
215 #include "/usr/local/ic/libs/ldxibase.asm"
216
217 ldd SCIINT,X
218 std interrupt_code_exit+1
219 ldd #interrupt_code_start
220 std SCIINT,X
221
222 rts
223
224 interrupt_code_start:
225 ldad variable_INCOMING * store INCOMING into AB
226 cmpb #00 * compare B with 0
227 bhi skip * goto "skip" if (B > 0)
228 ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X
229 inx * SKIP THE FIRST (?)
230 inx * TWO BYTES (?)
231 inx * OFFSET TO THE HIGHER BYTE (?)
232 stx variable_buffer_ptr * SAVE PTR VALUE
233 bra cont
234
235 skip:
236 ldx variable_buffer_ptr * load buffer pointer into x
237 cont:
238 ldad variable_INCOMING * load INCOMING into AB
239 incb * increment INCOMING
240 cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE--
241 beq reset_count * if a=32, goto reset_count
242 bra cont1
243 reset_count:
244 ldad #00 * set count to zero
245 cont1:
246 stad variable_INCOMING * store AB into INCOMING
247
248 ldab SCSR * load SCSR (SCI status register) into B (why?)
249 ldab SCDR * load SCSR (SCI data register) into B
250
251 stab ,X * store data in array
252 inx * increment by two bytes
253 inx
254 stx variable_buffer_ptr * save the pointer value
255 ldad #01 * load 1 into AB
256 stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available)
257 interrupt_code_exit:
258 jmp $0000
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275 --------------18CC6AC44E2E--
276
277
278
279 From [email protected] Wed Jul 1 05:33:51 1998
280 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM)
281 id AA20653; Wed, 1 Jul 1998 05:33:51 -0400
282 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3])
283 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514
284 for <[email protected]>; Wed, 1 Jul 1998 04:41:22 -0400 (EDT)
285 Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM)
286 id AA31111; Wed, 1 Jul 1998 04:44:45 -0400
287 Received: from kott.my.domain ([email protected] [192.168.0.1])
288 by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239;
289 Tue, 30 Jun 1998 22:34:32 -0400 (EDT)
290 Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT)
291 From: David Kott <[email protected]>
292 Sender: [email protected]
293 To: [email protected]
294 Cc: [email protected]
295 Subject: Re: microcontroller
296 In-Reply-To: <[email protected]>
297 Message-Id: <[email protected]>
298 Mime-Version: 1.0
299 Content-Type: TEXT/PLAIN; charset=US-ASCII
300
301 On Mon, 29 Jun 1998 [email protected] wrote:
302
303 > -I'd like to say thanks to all the folks who replied
304 > to my question on the microcontroller speeds.
305 >
306 > Here's another general question about them though.
307 > Should any unused pins be left open or should they
308 > be grounded?
309 >
310
311 Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a
312 4.7K resistor... presuming, of course, that a Logic 0 on that input won't
313 generate adverse effects, e.g. a grounded active low interrupt line
314 might be a problem. Such inputs should be taken to +5 with a 4.7K
315 resistor.
316
317 Floating CMOS inputs have a tendency to oscillate with the merest whisper
318 of a voltage.
319
320 TTL inputs may be left floating.
321
322 Driving an output externally will just heat up your CPU.. or worse.
323
324 -d
325
326 --
327 The box said "Requires Windows 95/NT or better"...
328 So I got Unix.
329
330 Free the Source. Free your Computer... http://www.FreeBSD.org
331 http://www.NetBSD.org
332 http://www.OpenBSD.org
333
334 From [email protected] Sun Mar 22 01:52:45 1998
335 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM)
336 id AA06355; Sun, 22 Mar 1998 01:52:45 -0500
337 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11])
338 by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676
339 for <[email protected]>; Sun, 22 Mar 1998 01:08:09 -0500 (EST)
340 Received: from localhost by cyber.sfgate.com with smtp
341 (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST)
342 Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST)
343 From: Richard <[email protected]>
344 X-Sender: rshirk@cyber
345 To: [email protected]
346 Subject: Frob nobs and IR
347 Message-Id: <Pine.SOL.3.96.980321212443.21628C-200000@cyber>
348 Mime-Version: 1.0
349 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628"
350
351 This message is in MIME format. The first part should be readable text,
352 while the remaining parts are likely unreadable without MIME-aware tools.
353 Send mail to [email protected] for more info.
354
355 ---559023410-1804928587-890546857=:21628
356 Content-Type: TEXT/PLAIN; charset=US-ASCII
357
358 OK...Im now pretty happy with states of things but I still have a few
359 questions I hope you can help me answer. The code attached works and
360 everything, but only when i take the bit about playing the songs out.
361
362 problem 1)
363 It
364 keeps saying that play is undefined. I saw that before and fixed it by
365 changing the names of the labels of the songs. I tried it this time and
366 it didnt work...i was wondering if anyone out there knows why it does this
367 and how to correct it....
368
369 problem 2)
370
371 I figured out (thanks to you guys) how to work the built in IR sensor to
372 detect and act upon 4 signals. One is for behing hostile, 3 is for
373 seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores
374 it.
375 The signal for being Hostile responds quickly and prints H on the screen
376 but the others lag and i was wondering if you knew why this was.
377
378 -Richard
379
380 ---559023410-1804928587-890546857=:21628
381 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c"
382 Content-Transfer-Encoding: BASE64
383 Content-ID: <Pine.SOL.3.96.980321220737.21628D@cyber>
384 Content-Description:
385
386 LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg
387 bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0
388 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy
389 Z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B7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF
407 TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM
408 KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU
409 XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv
410 biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg
411 YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0
412 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g
413 ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg
414 IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg
415 Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl
416 ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg
417 ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1
418 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg
419 KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q
420 IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi
421 ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg
422 ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo
423 ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl
424 cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg
425 ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg
426 KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy
427 ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy
428 b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv
429 biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp
430 Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh
431 IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g
432 ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp
433 Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg
434 ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs
435 ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg
436 ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl
437 dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g
438 ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg
439 ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl
440 Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg
441 ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg
442 ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg
443 ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg
444 ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg
445 MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly
446 X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg
447 ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g
448 cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN
449 ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i
450 b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi
451 ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN
452 ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt
453 ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg
454 ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q
455 R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk
456 KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg
457 ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl
458 Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi
459 KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg
460 ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs
461 ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u
462 b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg
463 ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg
464 ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp
465 Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg
466 ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw
467 KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg
468 ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj
469 ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp
470 Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg
471 IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7
472 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg
473 ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw
474 KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg
475 ICB9DQ0gICB9DX0N
476 ---559023410-1804928587-890546857=:21628--
477
478 From [email protected] Mon Aug 3 12:05:51 1998
479 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM)
480 id AA15988; Mon, 3 Aug 1998 12:05:51 -0400
481 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53])
482 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381
483 for <[email protected]>; Mon, 3 Aug 1998 11:16:53 -0400 (EDT)
484 Received: from localhost (mwallace@localhost)
485 by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283;
486 Mon, 3 Aug 1998 11:16:50 -0400
487 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT)
488 From: Mark Wallace <[email protected]>
489 To: [email protected]
490 Cc: [email protected]
491 Subject: Re: Polaroid trouble again
492 In-Reply-To: <[email protected]>
493 Message-Id: <[email protected]>
494 Mime-Version: 1.0
495 Content-Type: TEXT/PLAIN; charset=US-ASCII
496
497 I had this same problem when I got mine a few weeks ago. I ended up
498 putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board.
499 I also had to take out the 1k resistor from the BINH. It kept
500 BINH at 1 V instead of Zero and that seamed to cause problems.
501 As for the 6 ft problem, it should be closer to 9 ft. I think
502 the problem there is the IC code you used. If you used the code for
503 SONAR.C from the HB web site then there is a problem with it. What that
504 program does is take the difference in time from the internal clock. the
505 problem is that in the code it says that if the difference between start
506 time and currnet time is negative too much time has elapsed. Well, this
507 has a 16 bit counter so when the difference is greater the about 32,700 it
508 becomes negative. If you do the math, that means at about 9 ft that
509 happens so it tell you you are out of range.
510 The way I fixed this was to slow the clock down.
511
512 I looked up information on the motorola web page and found where the
513 prescalers were for the clock.
514 If you want to slow it down by a factor of four you can just add
515 this line to you program in sonar_init()
516
517 bit_set(0x1024, 1);
518
519 I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and
520 bit_set(0x1024, 3); will slow it down by a factor of 16.
521 There are better ways of fixing this problem but they appear much
522 more complicated. For example the motorola chip has an overflow flag that
523 says when the internal clock flips. You could incorporate that into your
524 code instead of slowing the clock down. Good luck and I hope this helps.
525
526 Mark Wallace
527
528 e-mail [email protected]
529 [email protected]
530 Web page http://sps1.phys.vt.edu/~mwallace/index.html
531
532 "What a waste it would be after 4 billion tortuous years of evolution if
533 the dominant organism contrived its own self-destruction"
534 Carl Sagan
535
536 On Mon, 3 Aug 1998, Alf Kuchenbuch wrote:
537
538 > Hi!
539 > I am having trouble with my Polaroid sonar:
540 > When I keep my HB hooked up
541 > to external power, I will only get correct readings up to 20 inches. As
542 > soon as I use battery power without hooking it up to external power, the
543 > readings are correct up to 6 feet, not more! This sound like EMI, I
544 > guess. I tried all the capacitor tricks from HB mailing list, but in
545 > vain. Do you know a fix that works?
546 >
547 > Alf H. Kuchenbuch
548 >
549
550
551 From [email protected] Wed Sep 30 12:35:05 1998
552 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM)
553 id AA09172; Wed, 30 Sep 1998 12:35:05 -0400
554 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133])
555 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849
556 for <[email protected]>; Wed, 30 Sep 1998 10:46:53 -0400 (EDT)
557 Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129])
558 by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635;
559 Wed, 30 Sep 1998 07:46:49 -0700 (PDT)
560 Message-Id: <[email protected]>
561 From: "Aaron Edsinger" <[email protected]>
562 To: "Keith - Lui" <[email protected]>
563 Cc: "handy" <[email protected]>
564 Subject: Re: output to file
565 Date: Wed, 30 Sep 1998 10:47:58 -0700
566 Mime-Version: 1.0
567 Content-Type: text/plain;
568 charset="iso-8859-1"
569 Content-Transfer-Encoding: 7bit
570 X-Priority: 3
571 X-Msmail-Priority: Normal
572 X-Mailer: Microsoft Outlook Express 4.72.2106.4
573 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4
574
575 Yes,
576 Write a dos/windows client that reads the serial line and then
577 writes it to file using the C stdio library.
578
579
580 -----Original Message-----
581 From: Keith - Lui <[email protected]>
582 To: [email protected] <[email protected]>
583 Date: Wednesday, September 30, 1998 6:55 AM
584 Subject: output to file
585
586
587 >Dear all,
588 >
589 >I would like to output some HB data to a file, is that possible?
590 >
591 >Keith
592 >
593
594
595
596 From [email protected] Mon Jul 6 11:54:19 1998
597 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM)
598 id AA03667; Mon, 6 Jul 1998 11:54:19 -0400
599 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104])
600 by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534
601 for <[email protected]>; Mon, 6 Jul 1998 19:24:28 -0400 (EDT)
602 From: [email protected]
603 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)
604 Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT)
605 Message-Id: <[email protected]>
606 Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&"
607 Mime-Version: 1.0
608 To: Terri A Mortvedt <[email protected]>, [email protected]
609 Subject: Re: Steppers
610
611 --0-0-0-0-0-0-0-0-____====$%&
612 Content-Type: text/plain
613 Content-Transfer-Encoding: quoted-printable
614 X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534
615
616 Dear Terri,
617
618 If the motors turn sparatically, that means the coils
619 are probably not hooked up in the correct order. Try
620 swapping them around and see if anything improves.
621
622 The motors you are using are the bipolar type. There=20
623 is a decent way of hooking up unipolar steppers to
624 the HB at http://www.cctc.demon.co.uk/stepper.htm
625 A basic difference between bipolar and unipolar is
626 that unipolar motors have additional wires are=20
627 connected to the power supply. Bipolars also have more
628 torque.
629
630 Using fd(); and bk(); commands to power steppers is
631 probably a lot to handle. I recommend trying the=20
632 method found on that link. There's even sample coding.
633 You will have to modify some variables for the turn
634 functions because your turning radius varies according
635 to your distance between motors.
636
637 I modified the step(); function to produce a gradual=20
638 increase in speed, and a gradual decrease in speed once
639 the specified steps are almost complete.=20
640
641 I will attach my motors.c file as is.
642
643
644
645 _________________________________________________
646 =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=
647 =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF
648 Brian Carvalho [ [email protected] ]
649 DeVRY Institute
650 New Jersey
651 _________________________________________________
652 =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=
653 =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF
654 ---------------------------------------------------
655 Get free personalized email at http://www.iname.com
656
657 --0-0-0-0-0-0-0-0-____====$%&
658 Content-Type: application/octet-stream
659 Content-disposition: inline; filename=Motors.c
660 Content-Transfer-Encoding: base64
661
662
663
664 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg
665 PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj
666 dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg
667 ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV
668 QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg
669 ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4
670 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt
671 b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQ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Gk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr
713 KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v
714 dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg
715 ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K
716 ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs
717 b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw
718 PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk
719 aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z
720 dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo
721 Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl
722 cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51
723 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls
724 ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7
725 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf
726 c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg
727 IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp
728 Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K
729
730
731 --0-0-0-0-0-0-0-0-____====$%&--