UART problems using Dorji LoRa

Which PIC are you using? I’m not familiar with any PICs that have integrated RS232. A MAX232 transceiver has always been necessary. Are you using a module? Rather than 485, you really need the TTL version. The other option is to remove the 232 driver from the module you have and solder links on instead.

As @coverdriven says, RS485 isn’t right. The “RSxxx” protocols are designed to deal with noise and long cable runs in the real world, hence the high voltages (and differential signaling on RS422/485). TTL UART is for signals within a product, connecting subsystems together.

The PIC will be in the process of being fried by the voltages here, if the RXD line from the modem is connected to the RX pin on the PIC. A PIC has no ability to deal with +/-12v - but as I also noted, if you turn on serial inversion (which PICs can do too) then you may see it “work” - this is because when inverted, TTL UARTs idle at 0v, and the -12v from the modem is being clamped to ~ -0.7v by the ESD diodes within the PIC hence close enough to zero. When the modem is transmitting a 1, the +12v from the modem is being clamped to VCC+0.7v (~5.7v) by the ESD diodes within the PIC - again likely close enough.

(note that the frying only applies to the RX line on the CPU - transmitting from a device may work safely, depending on the thresholds used by the receiver - but again, only if inversion is turned on).

I’m working with the PIC18F25K22 for this project. And what you said about inversion applies. I had to do that to communicate with the radio module. Sounds like it is a safe enough way to use it on the PIC. But I’ll have to add some circuitry to use the IMP.

I’m thinking of using the MAX3222E so that I can turn down power consumption between transmissions.

Thanks for all your help on this. I’ll follow up when I have things working.

No, it is NOT safe to use with a PIC (unless you’re doing transmit only).

The RX voltage will be burning out the ESD diodes in the PIC. As to how much it’ll curtail the life of the PIC, who knows - the older/less complex the silicon, the more robust it is. PICs are in 180nm or bigger last time I looked, the imps are either 90nm (imp1/2/3/4) or 45nm (imp5).

That will do for the prototypes. I found that Dorji has a TTL version of the radio module. So I’ll either use that for production, or design a circuit from scratch with the SX1276 chip depending on difficulty. But for now, I’ll leave well enough alone.

Okay. The TTL version of the radio is working splendidly. So we have correctly identified the problem. By the way, if RS232 is a problem that crops up other than just me, I found a simple work-around that eliminates the need for MAX32xx. It’s a simple 2 resistor solution that limits the current and voltage. I implemented it on my PICs and found an added benefit of lower power consumption overall. No need to use it on my IMP because I now have TTL there.

Resistors won’t invert, and won’t deal with negative voltages either (you end up using the ESD diode in the receiver) but resistors + diode + UART that can invert will work for RS232->TTL device, yes.

Glad it’s happy now!