I am trying to set up a function call that will send 6
packets
of information. (a packet is 8 bits) I then need to turn
around
and read the packet information that is returned. Each set of
8 bits should be stored in a file register for latter use. I
would
like to call this routine, send the packets and return to wait
for
the responce, store the data and return to the original
calling
function. I have wrote this myself and find that I am using
to
much memory and bad programming techniques. I should be
able to set up the packets and call this
routine.
Please Help a very sleepy man who is getting no ware
fast.
Thank you.
Gordon Varney
MCPU = 16F84
VDI = S164 DSP Core
MHS = Master Hand Shake (MCPU Pin 2, RA3)
SHS = Slave Hand Shake (MCPU Pin 12, RB6)
DATA = Data Bit (MCPU Pin 13, RB7)
Data is transfered one bit at a time with full handshaking as
described below.
1) When the MCPU has data to Transmit to the VDI, the MCPU
sets DATA
to the data value, verifies that SHS is in the high state, then sets MHS to the
low state to request a transfer.
2) The VDI senses the low state of MHS and reads DATA, which
then sets
SHS to the low state to acknowledge the DATA.
3) The MCPU senses the low state of SHS, and sets MHS to the
high state
to Indicate that DATA is no longer valid, and at the same
time sets DATA
high (releasing it).
4) The VDI then sets SHS to the high state to indicate that
the cycle is complete.
Both devices are now ready to tranffer the next data
bit.