Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for PCF8591 8-bit 4xADC 1xDAC i2c #813

Closed
gen2thomas opened this issue Mar 21, 2022 · 3 comments
Closed

support for PCF8591 8-bit 4xADC 1xDAC i2c #813

gen2thomas opened this issue Mar 21, 2022 · 3 comments

Comments

@gen2thomas
Copy link
Collaborator

Hello, the PCF8591 seems to be on the roadmap. Has the work already been started? If yes, how can I support it, if no I would start with the work on a new feature branch.

Thanks Thomas

@gen2thomas
Copy link
Collaborator Author

I am too impatient and therefore have started.

@gen2thomas
Copy link
Collaborator Author

@deadprogram please have a look at the PR #814 and possibly close the related roadmap item

@gen2thomas
Copy link
Collaborator Author

gen2thomas commented Apr 8, 2022

When implementing the driver I noticed the Tinkerboard is running in 400kbit mode by default and the i2c clock not slows down when attaching the PCF8591 device, which only supports 100kbit. This causes some problems with the driver, which can mostly solved with more write/read cycles (a "With" function is added for that). For those who want a most stable application, it is possible to switch to 100kbit mode, at least in Tinkerboard. An additional "clock-frequency = 100000" to the command line does not change anything for my device, so I add an device tree overlay in this way:

create a new overlay text file below "/boot/overlays/" by "sudo nano i2c1-100kbit-tinker-overlay.dts" with the content:

// Definitions for i2c1 with 100 kbit
/dts-v1/;
/plugin/;

/ {
	compatible = "rockchip,rk3288-evb-rk808-linux", "rockchip,rk3288";

	fragment@0 {
		target = <&i2c1>;
		__overlay__ {
			status = "okay";
			clock-frequency = <100000>;
		};
	};
};

save and close the editor, than run the device tree compiler:
dtc -@ -I dts -O dtb -o i2c1-100kbit-tinker-overlay.dtbo i2c1-100kbit-tinker-overlay.dts

after that, add "overlay=i2c1-100kbit-tinker-overlay" (without file extension) to the "/boot/config.txt" and reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant