Hi.
I am working on a project with USART and Due and I am in the dark. What I am trying to accomplish goes something like that:
Enable Serial
Send some data over Serial
Disable Serial
Enable PIO
Bit bang custom interface
Disable PIO
Problem is, that I do not know how to adjust message length on Serial (USART) interface, so I have to bit bang 14 bits of data to the controller. It is not plausible for me, to break down 14bits to 2 bytes because of the risk of losing data and I do not want add more complexity to whole thing.
Serial works, problem is with bit banging. When used without controller on the other side, bit banging works. But when controller is connected, nothing happens. What I am asking you guys is how to set up PIO to resemble USART configuration or in other words what happens with the PIO when USART is enabled (Pull-Ups?, high impedance?,...)? I was looking into SAM3X8 datasheet and did not find any answers (or I am too tired for datasheets right now...).
This is how I configure PIO right now:
PIOA->PIO_PER = PIO_PA13;
PIOA->PIO_OER = PIO_PA13;
And I use these for controlling the PIO:
PIOA->PIO_CODR = PIO_PA13; // clear PIO
PIOA->PIO_SODR = PIO_PA13; // set PIO
Alternative solution would be to change message length of USART...