Issues with accessing 4 - 20mA DAC via Ethernet to I2C converter in Python program

Hi,

I am working with the Ethernet to I2C converter (using the NCD5500 ethernet module) and the 1 Channel 4-20ma Current loop Transmitter (DAC). I need to send various values from a python program to the DAC. If I send these values using your AnyI2C program, the DAC changes output values as it should.

When I add the commands to my program the system hangs waiting for a response.

When I test the two way communication in my program it works just fine.

Can someone give me some insight on what I am doing wrong?

Thanks
Heidi

Hi,

Your checksum in the first section is incorrect. You’re transposing the 04 and the be.

I believe you can simplify your code a bit by using something like this:

command = bytearray(my_command_in_hex)
checksum = sum(command)
command.append(checksum & 0xff)

Jacob,

Thanks for finding that. After changing that and simplifying the code so that does not happen again it is still hanging. As you can see in my program comments, I got something to return with a different data string (aa 04 bc 5a a5 43 ac), I think it means Data Write Fail but I am not sure. The DAC output did not change so it did not do what it was supposed to.

Update,

I got my program to talk to the DAC using AA 05 BE 60 40 OD 84 9E! And it actually changes the output of the DAC from 0.48mA to 1.48mA. While it is great that I am now talking to the DAC, I expected the output to go to about 20mA with this string. Again any ideas?

To set the dac to maximum output you should send 0xff 0xff instead of 0x0d 0x84.

It’s been a while since I used this particular chip, but 0xff 0xff is the maximum value for 16 bits.

A DAC value of about 670 will output 4mA of current; similarly, a value of about 3460 will output 20mA of current.

@Bhaskar I was using a hex value of 0x0D84 because it’s decimal value is 3460, so I was surprised when I got a value of 1.48 mA out of the DAC. I am not sure what the values of 670 and 3460 indicate at this point.

@jacob your value of 0xFF 0xFF worked and give an output of 26mA. Thank you! But as stated above I am confused about what the documented values, of 670 and 3460, mean for the DAC.

Thanks both of you for your help.

can you share a picture of your setup?

Basically, I have a 4 - 20mA Current Loop transmitter connected to an NDC Ethernet to I2C converter. Which is connected directly to a Mac (MacOs Monterey) with a static IP address.

quick test –
power cycle everything.
do not send any commands
measure current across the screw terminal
It should read around 12mA.

I get 0.47mA. I am not sure what is in the EEPROM for this particular DAC. But I do get a consistent 0.47mA after power down on this setup.

it should produce 12mA ( if EEPROM was not modified) .
what is the voltage across the screw terminal ?

I get 12.33 V across the screw terminals

sounds like eeprom has a very low dac value stored in it.