How to read and write custom protocol on the same wire

Hi,

I have an arduino uno.
I want to use it as a Nintendo gamecube gamepad. To do that i have to use the specific protocol of the console which use the same wire to send and receive datas.

First, i do not understand how its possible to precisely determine when transmission begin ? Cause there is no clock line to refer...

Then, which pin use ? how to generate custom data ? (1µs low and 3µs high for a logic 1 and 3µs low and 1µs high for a logic 0)

thank you! :slight_smile:

Asynchronous serial communication works without a clock.

For sending you can use the SPI output (MOSI) and encode every serial bit in 4 SPI bits sent with 1MHz data rate.

Receiving is a bit more complicated, perhaps you can poll for pulses or read MISO @ 1MHz and decode the result and shift the bits in code.

DrDiettrich:
Asynchronous serial communication works without a clock.

Ok, thank you for the technical terms, i've found some useful things with it on the web.
But, here is a thing, in a usual async data communication, the communication is initiated with one START bit but in this case there is no start bit just a STOP bit. So, how is it possible to read a stream of bytes without anything to say "hey, it start now!"

DrDiettrich:
For sending you can use the SPI output (MOSI) and encode every serial bit in 4 SPI bits sent with 1MHz data rate.

Receiving is a bit more complicated, perhaps you can poll for pulses or read MISO @ 1MHz and decode the result and shift the bits in code.

Ok, thanks. So i have to tied MISO and MOSI together ?

In your RZ encoding no start bit is required.

Sorry, I forgot about the half-duplex issue after answering a question where RS-485 line drivers with such capabilities were used :frowning:

SPI output can be disabled in slave mode, where MISO becomes an output only when the slave device is selected. But that won't help much in your case :frowning:

Questions:
How can you pull the line low? Does the interface include a pullup resistor for the inactive state?
How do you know when it's time to send data? Or do you only want to receive data?

Can you provide a link to the protocol you are trying to implement?