Go Down

Topic: Disabling UART on Due? (Read 3 times) previous topic - next topic

Bi0H4z4rD

On the 8bit AVR you would use the "UCSR2B &= ~(_BV(RXEN2))"  command to disable a serial port on it (USART2 in this case).

Does anyone know how to do the same thing with Due?

BR

aethaniel

what do you mean by disabling a serial port?

I'm not expert in AVR but I know that all peripherals are clocked by default, so consuming power even if not used.

I know a bit more the SAM3X and in its case the peripherals are not clocked by default.
This means that all pins are dedicated to General Purpose I/O Controller and not to a multiplexed peripheral (like USART).
Thus, the pins need to declared as being used by a peripheral to be used and the peripheral to be clocked before any use.

Am I guessing right what is behind your question?

Bi0H4z4rD

Thanks for your reply aethaniel

What i mean is, that i want to send some data over serial, then disable serial on the pins that it uses for it (lets say 0 and 1 of the Due board for USART0), and enable those pins as digital pins to do some stuff, and after the digital stuff is done, then turn back on the serial.

BR

tuxduino

Sorry for the silly question, but what's connected to those pins ? Doesn't the DUE have enough GPIO pins to avoid going down that (seems to me) overly complicated path ?

Bi0H4z4rD

Trying to do some ISO-9141 (car ECU) communications, and i need to send a 5-baud start sequence which is done with:

Code: [Select]
pinMode(TX0, OUTPUT);
pinMode(RX0, INPUT);

digitalWrite(TX0, HIGH);
....
Serial.begin(10400);


BR

Go Up