1
\$\begingroup\$

I'm trying to interface with a device via async serial. Here is the power on requirement from the device datasheet:

Power-On Reset Requirements When applying power to the DNT900, the /RESET Pin 39 and the RADIO_TXD Pin 31 must be initially held low. The /RESET pin must be held low until the power supply voltage reaches 3.3 volts for 100 ms, and then set high. The RADIO_TXD must be held low an additional 10 ms after the /RESET pin goes high. RADIO_TXD is weakly pulled down with a 100K ohm resistor to meet the power-on reset requirement, unless this line is driven high by an external signal.

The hardware serial on my arduino (pins 1 & 2) is pulling RX high, thus not meeting the power on requirement of the device. The device goes into bootloader mode and is unusable.

The one solution I have found is using SoftwareSerial, and commenting out two lines of code in the RX init routine:

void SoftwareSerial::setRX(uint8_t rx)
{
  pinMode(rx, INPUT);
  //if (!_inverse_logic)
  //  digitalWrite(rx, HIGH);  // pullup for normal logic!
  _receivePin = rx;
  _receiveBitMask = digitalPinToBitMask(rx);
  uint8_t port = digitalPinToPort(rx);
  _receivePortRegister = portInputRegister(port);
}

This seems to work, but is there a better way? Is there a solution in hardware instead of software? I'm looking for the most robust and reliable solution so that the device does not go into bootloader mode and cease functioning as expected.

Thanks.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Can you maybe configure the pin as a gpio output, drive it low, then pulse the reset an extra time - and only then configure the pin as a UART output? \$\endgroup\$ Sep 25, 2013 at 1:35
  • \$\begingroup\$ you may make use if Serial.end() for this purpose. try it, the documentation suggests you can use pins 0 and 1 , the hardware UART, as general purpose io, if you call end first. \$\endgroup\$ Sep 25, 2013 at 20:17

1 Answer 1

2
\$\begingroup\$

you should be able to maniplate the pin with DigitalWrite, BEFORE you initiate SoftwareSerial instance on that pin. if you want to use the hardware serial port, you may have to add external logic to AND the hardware serial pin with another of Arduinos digital pins and then you can override for the first 100 ms or so, with a digitalwrite to the override pin. make sense?

\$\endgroup\$
2
  • \$\begingroup\$ Yes, sounds like common sense. I was just very confused that my device required a power-on requirement that is not compatible with UART, yet uses UART. \$\endgroup\$
    – sinaptik
    Sep 25, 2013 at 4:21
  • \$\begingroup\$ @sinaptik. it sounds like a classic case of a dual purpose signal line. really, the serial communications should have little to do with whether the device boots in bootloader or not. really, there probably should be a different pin for that, since many Serial controllers may not be able to so finely control the signals on their hardware UARTs. see if arduino can, according to the comment by Chris S. or use software serial. or use external logic to help interface with this somewhat non standard, dual purpose line. \$\endgroup\$ Sep 25, 2013 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.