CN0359 UART issue

Hi

I need to send conductivity data via UART RS485 to external device. My external device have its own communication frame via RS485 so I modified the code to read the frame that is comming to CN0359 EC device and send the answer with conductivity data back.

Read function works perfectly but when I want to send data, on serial monitor I see that data is corrupted (lots of random ?|:&*^23##$). What is strange that in debug mode (via Jlink) the CN0359 EC meter send data perfectly without errors and I dont know why it happens. I have tried to block interrupts but without change. Source code below.source.zip



source code added
[edited by: KoRba88 at 10:33 AM (GMT 0) on 7 Dec 2018]
Parents
  • Hi KoRba88,

    This is nice work modifying the CN0359 code to send conductivity data as response to a command through RS485.

    I think the issue, however, is with the RS485 communications. The CN0359 uses the ADM3483 which doesn't have true fail-safe receiver inputs. The schematic though has a 10k ohm termination resistance.

    Does your external device have pull-up and pull-down resistors in its RS485 lines? Without these pull-up and pull-down resistors, random data is received to the UART when the bus is in idle condition since the receiver output is undefined. Can you show me the RS485 connection diagram of your external device and the CN0359

    Regards,

    Nikko

Reply
  • Hi KoRba88,

    This is nice work modifying the CN0359 code to send conductivity data as response to a command through RS485.

    I think the issue, however, is with the RS485 communications. The CN0359 uses the ADM3483 which doesn't have true fail-safe receiver inputs. The schematic though has a 10k ohm termination resistance.

    Does your external device have pull-up and pull-down resistors in its RS485 lines? Without these pull-up and pull-down resistors, random data is received to the UART when the bus is in idle condition since the receiver output is undefined. Can you show me the RS485 connection diagram of your external device and the CN0359

    Regards,

    Nikko

Children