Hi David, The output of the PCA9685 can be switched to totem pole or open drain and to invert the output or not. Functions are provided by the library to switch the outputs.
The library is available in the last bee-package including a few sample files to control LED's and Servo's. I also made a video about this library, see: https://youtu.be/3R_2mupvRjM BTW. Have a look at the style guide for writing a library: https://github.com/jallib/jallib/wiki/Jallib-Style-Guide [https://opengraph.githubassets.com/406af2cb3cf8304a0708a13d767b6775857f003e9f3d4af82efae271795a11d5/jallib/jallib]<https://github.com/jallib/jallib/wiki/Jallib-Style-Guide> Jallib Style Guide · jallib/jallib Wiki<https://github.com/jallib/jallib/wiki/Jallib-Style-Guide> Automatically exported from code.google.com/p/jallib - Jallib Style Guide · jallib/jallib Wiki github.com All libraries are validated against the style guide for consistency purposes. Good Luck! Kind regards, Rob ________________________________ Van: jallib@googlegroups.com <jallib@googlegroups.com> namens Pinhead <pinhead...@gmail.com> Verzonden: zaterdag 19 november 2022 14:33 Aan: jallib@googlegroups.com <jallib@googlegroups.com> Onderwerp: Re: [jallib] Small remarks on rtc_ds3231.jal Hi Rob, Yes indeed, a lot of PCAxxx and PCUxxx parts are EOL. I didin't know it, but I have a small bunch laying around, so I will use those. I made a quick functional comparison of PCA9685 ("your" part) and PCA9626 (mine) and spotted major differences: * The outputs of PCA9685 are totem-pole, while PCA9626 has open-drains. PCA9685 supports thus inverted outputs logic while PCA9626 does not (MODE2_INVRT bit) * PCA9626 includes a Chase function * The register map are (almost) completely different * The way to access each output port differs completely * .... and probably other things I didn' see yet. Therefore, I am not sure it would help to base myself on your work for the PCA9685. HOWEVER, it would be useful that I respect the same terminology as you did. For example, using the same naming conventions for the name of the registers, bits, functions....,..... So, if you would be kind enough to send me your lib file for the PCA9685, it will serve me as a good starting point Kr, D. 9626 has open drains. This means that And, indeed, Le 19-11-22 à 13:08, Rob CJ a écrit : Hi David, Update (also for other Jallib users). If I use a 'get function I also need a 'put function but I am not allowed to make a 'put function without a parameter. Nor am I allowed to make to 'put functions (one old and one new). In order to prevent confusion I had to change the 'get to a regular function and replace the put by a clear procedure. This means that I cannot make it backwards compatible so users that are using this library need to make a small addition to their code as already mentioned. So instead of: if rtc_alarm_1_flag then rtc_alarm_1_flag = FALSE You must now use: if rtc_alarm_1_flag then clear_rtc_alarm_1_flag() For all JAL users, sorry for any inconvience . About your next topic. If you have something created I can review it and put it on GitHub for you and add it to the release. I do have the following questions: 1. Is this chip still in production. I thought I saw somewhere that it was end of life. 2. I recently made a library for the PCA9685. There seems to be overlap in the functionality. Would that library help with your project? Kind regards, Rob ________________________________ Van: jallib@googlegroups.com<mailto:jallib@googlegroups.com> <jallib@googlegroups.com><mailto:jallib@googlegroups.com> namens Pinhead <pinhead...@gmail.com><mailto:pinhead...@gmail.com> Verzonden: zaterdag 19 november 2022 12:57 Aan: jallib@googlegroups.com<mailto:jallib@googlegroups.com> <jallib@googlegroups.com><mailto:jallib@googlegroups.com> Onderwerp: Re: Re: [jallib] Small remarks on rtc_ds3231.jal Great. I am glad I could bring something to the group 😁 In the project I start, I will most probably use a PCA9626 from Nxp. >From a software point of view, there are several variants of that ship that >could be defined in that lib also I will try to write a lib and if it sounds good, I will submit it for review and distribution if you want. I will try to stick to the guidelines and document it as needed. If this sparks the interest of someone, I would be delighted to collaborate. Greetings from Belgium David Le 19 nov. 2022, à 12:41, Rob CJ <rob...@hotmail.com<mailto:rob...@hotmail.com>> a écrit: Hi David, Found it. I agree with you that writing a 1 will not do anything. According to the datasheet is does not mess things up but the use may assume that it can set the flag which is not the case. So in order to do it right I should replace this procedure by a clear alarm function like you suggested. So on the sample program it would be: if rtc_alarm_1_flag then clear_rtc_alarm_1_flag() I will make the change and keep the older one with the warning it will be deprecated. Thanks for the feedback. Kind regards, Rob ________________________________ Van: jallib@googlegroups.com<mailto:jallib@googlegroups.com> <jallib@googlegroups.com><mailto:jallib@googlegroups.com> namens Pinhead <pinhead...@gmail.com><mailto:pinhead...@gmail.com> Verzonden: zaterdag 19 november 2022 12:12 Aan: jallib@googlegroups.com<mailto:jallib@googlegroups.com> <jallib@googlegroups.com><mailto:jallib@googlegroups.com> Onderwerp: Re: [jallib] Small remarks on rtc_ds3231.jal Hi, Yes, indeed, we do not use the same version. In your datasheet, it is on page 14. See screenshot attached. Enjoy your day David Le 19 nov. 2022, à 11:50, Rob CJ < rob...@hotmail.com<mailto:rob...@hotmail.com>> a écrit: Hi David, Well spotted, the cosmetic issue. Will fix that. I do not understand the other issue since in page 15 of my datasheet I cannot find what you mention, see attached datasheet that I used. Next to that I tested the alarm functions and it seems to work correctly. Can you send me the datasheet you are refering to? Thanks. Kind regards, Rob ________________________________ Van: jallib@googlegroups.com<mailto:jallib@googlegroups.com> <jallib@googlegroups.com><mailto:jallib@googlegroups.com> namens pinhe...@gmail.com<mailto:pinhe...@gmail.com> <pinhead...@gmail.com><mailto:pinhead...@gmail.com> Verzonden: zaterdag 19 november 2022 01:43 Aan: jallib <jallib@googlegroups.com><mailto:jallib@googlegroups.com> Onderwerp: [jallib] Small remarks on rtc_ds3231.jal Hi, As I am using this library right now, I have small remarks: - Cosmetic: In the comments on lines 254 and 259, reference is made to the SSD1306 - Functionality leading to mistakes: the logic in the "procedure rtc_alarm_2_flag'put(bit in set_flag)" and "procedure rtc_alarm_1_flag'put(bit in set_flag)" allows to set the bit to 1. But on page 15 of the datasheet, it is stated that this bit may only be written to 0. Allowing the user to write it to 1 may lead to mistakes, since the user may believe it actually worked, when it didn't. My suggestion: Deprecate with a WARN at compile time those 2 procedures and replace them with a "procedure clear_rtc_alarm_2_flag'put"(and the same for alarm 1) Just my 2c, hoping to help, and not to critisize the good work done ! Enjoy your week-end. David. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/0ff7bd5b-3f82-4f64-9db1-fde6b7b4ac6b%40gmail.com<https://groups.google.com/d/msgid/jallib/0ff7bd5b-3f82-4f64-9db1-fde6b7b4ac6b%40gmail.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/GVXP195MB1637C8E697DBB65E36FBB9ADE6089%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/jallib/GVXP195MB1637C8E697DBB65E36FBB9ADE6089%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/eea1f948-d4b4-445b-9c72-abfa3f796c7f%40gmail.com<https://groups.google.com/d/msgid/jallib/eea1f948-d4b4-445b-9c72-abfa3f796c7f%40gmail.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/GVXP195MB1637DD12766E5920A5B668EDE6089%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/jallib/GVXP195MB1637DD12766E5920A5B668EDE6089%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com<mailto:jallib+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/a21eb5ed-c165-65f8-3506-102bf582c3d6%40gmail.com<https://groups.google.com/d/msgid/jallib/a21eb5ed-c165-65f8-3506-102bf582c3d6%40gmail.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to jallib+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/GVXP195MB1637E3C752AD8F6A61A1F1FEE6089%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.