send binary data through serial port 
Author Message
 send binary data through serial port

Hi,

i've build a parallel port with 8 bit input and 8 bit output, designed by
Richard Evans   http://www.*-*-*.com/ ~rjevans/macpp/macpp.html
This circuit connects to the mac serial port.

if i send 1 byte which sets the output bits, the circuit reads the input
port and sends back 1 byte of binary data.
Reading inputdata and converting to binary data is no problem, but
writing data to the output port doesn't give the proper result.

I tried  serial1.write chr(1) chr(2) chr(4) etc. to set individual bits of
the parallel output port, but this sets multiple bits in a sequence i can't
explain.

I suspect this has to do with the fact that i am not sending binary data.

Is it possible, one way or the other to send binary data through the serial
socket ?

Any help is very much appreciated.

Andr Schaap



Mon, 15 Nov 2004 05:43:06 GMT  
 send binary data through serial port
Make sure you have set up the serial port for No Parity, 1 stop bit and 8
bit data.  If this is not set up right it would change the data.

Steve



Quote:
> Hi,

> i've build a parallel port with 8 bit input and 8 bit output, designed by
> Richard Evans   http://www.btinternet.com/~rjevans/macpp/macpp.html
> This circuit connects to the mac serial port.

> if i send 1 byte which sets the output bits, the circuit reads the input
> port and sends back 1 byte of binary data.
> Reading inputdata and converting to binary data is no problem, but
> writing data to the output port doesn't give the proper result.

> I tried  serial1.write chr(1) chr(2) chr(4) etc. to set individual bits of
> the parallel output port, but this sets multiple bits in a sequence i can't
> explain.

> I suspect this has to do with the fact that i am not sending binary data.

> Is it possible, one way or the other to send binary data through the serial
> socket ?

> Any help is very much appreciated.

> Andr Schaap



Mon, 15 Nov 2004 07:23:28 GMT  
 send binary data through serial port
Hi,

With the settings given by Stephens you transmit :

  1 Start bit (always 0)
+ 8 Data bits
+ 1 Stop Bit (always 1)
------------------------
= 10 transmitted bits.

If I suppose that you have used a serial-to-parallel shift register in your
electronics, you have to strip the first and last bit of every sequence.

For instance, chr(1) would give 0100000001 as serial sequence on an
oscilloscope (LSB is transmitted first).

Hope this helps.
Christian



Quote:
> Make sure you have set up the serial port for No Parity, 1 stop bit and 8
> bit data.  If this is not set up right it would change the data.

> Steve



>> Hi,

>> i've build a parallel port with 8 bit input and 8 bit output, designed by
>> Richard Evans   http://www.btinternet.com/~rjevans/macpp/macpp.html
>> This circuit connects to the mac serial port.

>> if i send 1 byte which sets the output bits, the circuit reads the input
>> port and sends back 1 byte of binary data.
>> Reading inputdata and converting to binary data is no problem, but
>> writing data to the output port doesn't give the proper result.

>> I tried  serial1.write chr(1) chr(2) chr(4) etc. to set individual bits of
>> the parallel output port, but this sets multiple bits in a sequence i can't
>> explain.

>> I suspect this has to do with the fact that i am not sending binary data.

>> Is it possible, one way or the other to send binary data through the serial
>> socket ?

>> Any help is very much appreciated.

>> Andr Schaap



Mon, 15 Nov 2004 14:20:57 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Sending pure binary out a serial port

2. Sending data over serial port with USB adapter...

3. Binary data over Serial Port

4. Using Serial Port to send mouse actions to remote computers mouse port

5. REQUEST: Serial port code for processing serial mouse data

6. Tk 8.2 send of binary data to Tk 7.6 application corrupts data

7. Redireting data sent to a data port

8. sending and receiving from serial Port Com1 Com2

9. SEND PULSES TO SERIAL PORT

10. Sending ASCII-set to Serial Port

11. Using serial port to send AT commands

12. How do i Send 8 and 16 bit unsign int througth the serial port

 

 
Powered by phpBB® Forum Software