I need to interface the spark Photon/Core to Atmel XMega chips that are using the serial one-wire that some (maybe all) XMega devices are capable of. Basically, it puts the serial port TX pin in open collector mode with a pullup, then internally connects it to the RX Pin.
If I can get the TX pin on the Photon/Core to be in open collector mode, I can externally connect them and put a pull-up resistor on them. If I can’t do this, I need to add external parts to accomplish it.
This seems to work quite well. I have more testing to do, but it is working. However, my code won’t build for the Core in the develop branch. So I have to either wait until my Photons arrive, or until the Core is fixed in the develop branch to actually integrate this into the code and do a pull request.
Okay, I got my code compiling in the develop branch. It works significantly better than in the master branch. I also figured out that I could just enable half duplex mode on the serial port and it will do what I needed automatically. It even hooks the pins together internally.
I have a patch for that, but I am waiting for confirmation that how I did it is the best way to do it.