I am a beginner and want to address NCD devices with a “USB to I2C Converter with Virtual COM Port FT230XSNCD Sensor”.
You write about it:
“Plug in our USB to I2C converter into any available USB port on your PC and it mounts as a COM port, start sending commands at 115.2K Baud.”
Is there any tutorial which commands are available?
Maybe you can tell me where I can find some help.
The resources for the USB to I2C converter can be found on it’s product page: https://store.ncd.io/product/usb-to-i2c-converter-adapter/#tab-resources_tab.
In particular this guide will show you example write/read commands: https://ncd.io/serial-to-i2c-conversion/.
To talk to a particular I2C sensor or controller you’ll need to check the resources of that sensor to know what commands it expects over I2C and send that over serial wrapped in the NCD API outlined in the above resources.
Additionally you can check out the AnyI2C software which can be used to glean commands sent to I2C devices over serial: https://ncd.io/anyi2c-i2c-communications-quick-start-guide/.
Thanks for your help!
I’ve been to the Resources page and had read a lot of stuff there - except the “Serial to I2C Conversion”. That was my mistake.
Thanks a lot!
No problem. I haven’t written a library specifically for the USB to I2C converter, but that wrapper API we use for a lot of things. I generally create an API wrapper function/method I can pass raw commands to so I don’t have to enter header bytes and calculate checksums when I define functionality.
Example API wrapper in Python:
def wrap_in_api(self, data):
bytes_in_packet = len(data)
data = self.add_checksum(data)
def add_checksum(self, data):
data.append(int(sum(data) & 255))
command = wrap_in_api([254, 140, 1, 1])