Hi All ...Need some help with this issue.
CPU = ATSAM4LC8C
I have a USART that gets configured by mapping the required pins using ...
#define ioport_set_pin_peripheral_mode(pin, mode) \
} while (0)
USART works just fine as expected. No problem here.
After doing its job, I need to put the CPU to sleep until a minute later. The problem is the USART drives the TX pin high .. which is connected to a resistor divider network resulting in 0.5mA current draw.
During sleep, the TX pin remains high.
So need to unmapp the pin most likely (don't know if it is possible to manually set the output to zero while mapped)
I have tried many things ... but the pin never releases its high value.
For example, if I use...
ioport_reset_pin_mode(GPIO_PA16); (this one causes a crash)
It does not work ... as the pin remains high and when I use the USART again with what should be an unmapped TX pin, the USART works fine.
Any clues to solve this problem?