I am running into some inconsistencies when addressing I2C for writing strings to LCD screens. The LCD is from NHD and its data sheet can be found here. Below I have listed a list of Hex commands from the datasheet and I have successfully communicated with one LCD. I am now attempting to use the Hex commands found in that Datasheet to change its address to something other than the 7-bit default which is 0x28. I also made sure the LSB was 0 just as the LCD datasheet states. I have been trying to use address 0x2A, which is 00101010 in binary. This VI is suppose to change the address to 0x2A then display the I2C address on the screen. It does this successfully. Then when I go to run the VI addressed to the new address I get error 301742. Which just states the slave did not acknowledge an address and direction bit from the master. So I just need some guidance on correctly changing an I2C address. I will have 12 screens to communicate with at once. Also, I unfortunately am unable to transfer my VI to my network connected desktop so I have done my best to recreate it and attach it below.
Solved! Go to Solution.
Forgot to add some labeling. The blue boxes under the property nodes are all wired into those corresponding properties on those property nodes.
If you are trying to read a register from the device, you should be using the I2C Write Read VI.
The Write Read VI returns a similar error. Error 301713 which says an input parameter, or combination of parameters, is invalid. All I am trying to do is have the LCD tell me what address it currently has and then change it and write to that new address.
It's very possible that the execution of the Change Address command has immediate effect, so you would have to update the address the USB-8452 uses for this resource accordingly before you try to read from the device.
This has actually been very confusing for me. I had an entire VI written after I had wired up my first screen and it wrote and read everything correctly. Then I disconnected that one and wired another to change the address of the 2nd screen. So I initially ran the VI with the default address and changed the address, the LCD correctly displayed this new address with the Hex commands given in the LCD datasheet. Then I tried to talk to them both and I got the Error 301742. Then I tried to communicate to them separately like before and neither are working now and are returning Error 301742. I have reprogrammed, rewired, used multimeter to check all signals, and I do not understand why they are not communicating.
Do you know if the LCD screen can remember its address after a power cycle? I think it does not have an EEPROM to remember the programmed address when power cycled.