Subject:
|
interfacing HB w/Mini-SSC
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Wed, 30 Apr 1997 07:43:45 GMT
|
Original-From:
|
Colin Benoit <CCB7@CORNELLnomorespam.EDU>
|
Viewed:
|
866 times
|
| |
| |
Fred (or anyone),
I'm working with a group trying to interface Scott Edward's Mini-SSC II
with the HB. By directly connecting the SSC to a computer and running a
simple QBASIC program, we verified that the SSC works correctly when it
receives proper serial data input. However, when we connect the SSC to the
HB using digital port 9 as a serial data output port, we cannot position
the servos at all. We have determined with the use of a scope that the SSC
is receiving data from the HB, but we think that the serial data it is
sending must be incorrect.
We are using some code Fred had written earlier this year to send serial
data from the HB to the SSC (shown below), but we are unsure if we have it
in its correct or complete form. If someone could look over it, we would
greatly appreciate it. I have also included the icb file we get when the
asm code is compiled, if that helps.
Thanks again,
Colin Benoit
* *
* 9600PA7.asm *
* *
* uses: transmits 9600 baud output on port A bit 7 *
* defines function 'pa7_9600(int n)' which transmits byte 'n' *
* takes full control of CPU until transmitted byte is finished *
* *
* Fred Martin *
* fredm@media.mit.edu *
* 5 February 1997 *
* *
*************************************************************************
BASE EQU $1000 ; register base
PORTA EQU $1000 ; Port A data register
PACTL EQU $1026 ; Pulse Accumulator Control register
ORG MAIN_START
* sends a byte at 9600 N-8-1 over port A, bit 7
subroutine_pa7_9600:
TBA
SEI
LDX #BASE
BSET PACTL,X $80 ; enable PA7 for output
* send start bit
BSR a7_bit0
* send 8 data bits
BSR a7_send8
* send stop bit
BSR a7_bit1
CLI
RTS
* thanks to Brian Silverman for this recursive bit output trick
a7_send8 BSR a7_send4
a7_send4 BSR a7_send2
a7_send2 BSR a7_send1
a7_send1 LSRA
BCC a7_bit0
a7_bit1 BSET PORTA,X $80
BRA bit_delay
a7_bit0 BCLR PORTA,X $80
* take up 0.1042 millisecs
* 208 cycles
bit_delay LDAB #37
bit_loop DECB ; 2 cycles
BNE bit_loop ; 3 cycles
RTS
____________________________________________________________________
***********************************************************************
.......................................................................
ICB code
S1238020170FCE10001C26808D148D048D0B0E398D008D008D004424051C008020031D0075
S10A804080C6255A26FD3914
S9030000FC
S123872B170FCE10001C26808D148D048D0B0E398D008D008D004424051C008020031D0063
S10A874B80C6255A26FD3902
S9030000FC
6811 assembler 10-Aug-91
original program by Motorola.
a few modifications by Randy Sargent (rsargent@media.mit.edu)
BASE 1000 *0003 0014
PACTL 1026 *0006 0015
PORTA 1000 *0005 0031 0033
a7_bit0 8749 *0033 0017 0030
a7_bit1 8744 *0031 0021
a7_send1 8741 *0029 0028
a7_send2 873f *0028 0027
a7_send4 873d *0027 0026
a7_send8 873b *0026 0019
bit_delay 874c *0037 0032
bit_loop 874e *0038 0039
subroutine_pa7_9600 872b *0011
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|