Is it possible to make unidirectional serial port via 1 pin with PBP?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    Just for ideas, I believe the DH11 (or whatever it is) temperature & humidity sensor uses 1-wire communication. You might also look at CAN, and I2C for ideas. You would need an Open Drain pin (when in output mode), or configure a transistor/MOSFET/diode to create an OD condition from both ends.

    The basic idea is a pull-up resistor creates an "Idle High" situation. Pulling the line Low is how either side initiates communication. Using INT0 (INT1_2) or IOC you could know when to look for a transmission (ISR). Unless transmitting, the pin would be configured as an Input (TRISx.x = 1), so it is able to look for packets from the other chip. With CAN, if the Sender is attempting to send a High signal, but the line is Low, Arbitration states the other chip is also trying to communicate and the looser (the one unsuccessfully trying to send a High signal) backs out. To transmit, you would first clear the TRISx.x bit, then begin sending. When finished, set the TRISx.x bit so you can then receive on the same pin.

    You would probably have to create your own protocol, but look at how exciting a challenge that might be!

  2. #2
    Join Date
    Feb 2013
    Posts
    1,079


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    Yeah, time to implement GPIB in PBP or FSK

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,824


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    Serin2 already has handshake implemented! Why not use it instead of trying to re-invent the wheel?

    From the manual:

    SERIN2 DataPin{\FlowPin},Mode,{ParityLabel,}{Timeout, Label,}[Item...]

    Receive one or more Items on Pin in standard asynchronous format. SERIN2 is similar to the BS2 SERIN command. DataPin is automatically made an input. The optional FlowPin is automatically made an output. DataPin and FlowPin may be a constant, 0 - 15, or a variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g. PORTA.0).
    The optional flow control pin, FlowPin, may be included to help keep data from overrunning the receiver. If it is used, FlowPin is automatically set to the enabled state to allow transmission of each character. This enabled state is determined by the polarity of the data specified by Mode.


    Ioannis

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,523


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    Because the flow control feature of SERIN/OUT2 uses an aditional pin and CuriousOne specifically specified that there was only one I/O pin available.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,824


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    You are right Henrik. I missed that. Well, it is not guaranteed then...

    Ioannis

  6. #6
    Join Date
    Feb 2013
    Posts
    1,079


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    What about OWIN/OWOUT ?

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,824


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to make unidirectional serial port via 1 pin with PBP?

    As other said too, no guarantee that receiver will hear the transmission.

    Ioannis

Similar Threads

  1. Serial port data pin
    By Michael in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th July 2009, 15:13
  2. Why (or how to) make a port array for OW
    By Roy___ in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd February 2009, 23:30
  3. make a low voltage output from a PIC pin
    By emptyset in forum General
    Replies: 1
    Last Post: - 8th February 2008, 19:20
  4. converting USB to SERIAL port (9 pin)
    By PoTeToJB in forum USB
    Replies: 1
    Last Post: - 29th March 2006, 21:10
  5. Port pin problems
    By sgreelish in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th March 2004, 18:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts