how to generate the driver for own I2C devices?
Please read attached documentation (this is the product datasheet from the store)
Chapter 10. Connect additional devices via IΒ²C and SPI
Where are the device description files (examples for the other I2C devices which are already in the system
Usually you could get them by:
1. Generate an empty project add all available I2C devices, then save this project as projectarchive
open this as zip (rename it) - you find in the zip all devices which you added to the project -the easies way to grab them
2. location for the device repository is: c:\ProgramData\CoDeSys\Devices\500 (500 are I2C devices, 501 SPI devices) you could copy them from there. (for this you need to know the ID of the device)
3. attached to this post.
As I see you finish PCF8574 library ? Is possible to share it with us in source code? I'd like to see how you write it, so I believe I can write another library for some interesting IC's on I2C.
Regards !
Mladen Bruck
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I like to connect more than one PCF8574 on the same I2C bus, using different address on each one.
What is the best way to integrate different addresses in the same lib?
Best regards,
Zdenko.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
how to generate the driver for own I2C devices?
Please read attached documentation (this is the product datasheet from the store)
Chapter 10. Connect additional devices via IΒ²C and SPI
Where are the device description files (examples for the other I2C devices which are already in the system
Usually you could get them by:
1. Generate an empty project add all available I2C devices, then save this project as projectarchive
open this as zip (rename it) - you find in the zip all devices which you added to the project -the easies way to grab them
2. location for the device repository is: c:\ProgramData\CoDeSys\Devices\500 (500 are I2C devices, 501 SPI devices) you could copy them from there. (for this you need to know the ID of the device)
3. attached to this post.
BR
Edwin
raspberrypi_en.pdf [814.57 KiB]
Devices.zip [17.04 KiB]
Hi,
I am preparing library for I2C PCF8574A (IO expander).
Reading values from PCF8574 works ok.
I have a problem with writing values to PCF8574.
If I put write8 function in Method BeforeWriteOutputs, writing values don't work:
If I put write8 function directly in FB, it works:
What is the right way?
Best regards,
Zdenko.
Please check your device descirption:
The device description must look like this:
The PCF8574 does not have any registers. So you can use
in the "BeforeWriteOutputs" - Method (not in FB)
This should solve the problem.
Best regards,
kdebu
Hi,
yes, the method BeforeWriteOutputs Method have to be defined in the device description also.
it work perfectly now !
Thank you very much!
BR
Zdenko.
Zdenko,
As I see you finish PCF8574 library ? Is possible to share it with us in source code? I'd like to see how you write it, so I believe I can write another library for some interesting IC's on I2C.
Regards !
Mladen Bruck
Hi Mladen,
Enclosed are my PCF8574 lib. This is for PCF8574A type. If you are using PCF8574 you have to change the address (usiAddress).
There are also devicedescription file and sample project.
Best regards,
Zdenko.
PCF8574.zip [240.56 KiB]
Hi Zdenko !
Thank you very much.
Beside investigating your code, I just have to pick some IC's from ebay and try it.
Hi,
I like to connect more than one PCF8574 on the same I2C bus, using different address on each one.
What is the best way to integrate different addresses in the same lib?
Best regards,
Zdenko.
Hi,
the Output worked great, but how is it possible to Read the Inputs with the PCF8574?
Can somebody please post a sample or a picture of the code.
Greatings
Noodles
Does somebody know how i can deinstall I2C devices? I deleted it in the Device Folder (500) but it is still in this window:
it says "Device not found"
Hi,
you need to uninstall your device here:
BR
Edwin
Hi,
Could anyone write to me instruction how generate driver for my I2c device : LCD Panel. ?
I did it.
Hello,
Is the driver for HD44780 LCD with I2C? Is possible to share it with us in source code?
best regards