[En-Nut-Discussion] Ethernut3.1 RS232 DTR pin

Harald Kipp harald.kipp at egnite.de
Thu Dec 17 15:42:17 CET 2009


Hi Paul

Paul Govers wrote:

> i already tried to set UART_SETSTATUS with UART_DTRENABLED
> _ioctl(_fileno(cd.cd_rs232), UART_SETSTATUS, UART_DTRENABLED);
> but still RS232 DTR pin 0 volt :-(

and earlier

> outb(NPL_RSCR, inb(NPL_RSCR) | NPL_RSDTR);

Sorry for not jumping in earlier.

The UART of the AT91R40008 used on Ethernut 3 doesn't support hardware
handshake. Therefore, these lines are connected to the CPLD. According to

http://www.ethernut.de/en/hardware/enut3/cpld.html

your outb() should have activated the DTR line.

Now the tricky part: You shouldn't get 0V, RS232 is either +12V or -12V.
Theoretically. Practically it may be +7V or -7V and even +3V and -3V is
still OK, but 0V is illegal.

The RS-232 level converter used on Ethernut 3 has an auto power-down
feature. That means, if you remove the cable in order to measure the
voltage, the chip will no longer detect any external voltage and will be
shut down. In this case all outputs are indeed at 0V.

Handshake support for the Ethernut 3 CPLD had been added lately to
Nut/OS 4.9. I assume that it is still missing in 4.8. Thus, setting
NPL_RSDTR via the CPLD register should work and set the DTR pin to a
negative voltage (RS-232 signals are negated).

However, if the connected device monitors DTR, it will also most likely
monitor RTS. Try

 outb(NPL_RSCR, inb(NPL_RSCR) | NPL_RSDTR | NPL_RSRTS);

You may also set NPL_RSFON, which forces the level translator to stay in
power-on mode, even when disconnecting the cable.


 outb(NPL_RSCR, inb(NPL_RSCR) | NPL_RSDTR | NPL_RSRTS | NPL_RSFON);

If that still doesn't work, there may be a problem with the CPLD
configuration. There is no known issue, and the test at egnite includes
hardware handshake testing. You didn't upgrade the CPLD, did you?

In the worst case your hardware is broken, but that's most unlikely.
RS-232 interfaces are very robust.

Another possibility is to use special cable connections

 http://www.ethernut.de/en/documents/rs232primer.html

Are you using the same cable for the PC-Heater connection and the
Ethernut-Heater connection?

Harald



More information about the En-Nut-Discussion mailing list