CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Feb 23, 2020 6:41 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Jan 19, 2020 9:02 pm 
Offline

Joined: Fri Oct 11, 2019 9:54 pm
Posts: 4
Hello,
I need to menage an I2C peripheral not present on device libraries : MCP3421 (adc 1ch 18 bit).
I'm not able to create it :(
Is there a simple way to read/write configuration or data bytes (according to MCP3421 data sheet) by step by step ST instructions, without creating the device?
something like this:
1) set the device address
2) set number of bytes to write
3) write data bytes
4) set number of bytes to read
5) read data

Can you help me?
Thank you!


Top
   
PostPosted: Mon Jan 20, 2020 1:34 am 
Offline

Joined: Tue Mar 26, 2019 4:28 pm
Posts: 93
Hello!
When you say you can't create it, do you mean you found the documentation for creating I2C devices and weren't able to follow?
If yes, I would like to fix the documentation so it is easier for you and others to follow. So where are you stuck?
If not, then just follow the documentation here, and let us know if you get stuck.
https://forge.codesys.com/drv/io-drivers/doc/I2C/


Top
   
PostPosted: Mon Jan 20, 2020 6:44 am 
Offline

Joined: Tue Mar 26, 2019 4:28 pm
Posts: 93
It also looks like Fab can give you a heard start..

viewtopic.php?t=6174#p12190


Top
   
PostPosted: Mon Jan 20, 2020 1:31 pm 
Offline

Joined: Fri Oct 11, 2019 9:54 pm
Posts: 4
Thank you for your answer.
I would use Raspberry for a hobby application, on my (very short) free time.
I'd like To program It by Codesys (instead of Phyton or something else) because I'm able to program plc's...so my idea is: ''I spend 60 euro (vat included) for Codesys  Runtime licence in order to avoid wasting time to learn...make test....experiment...etc.

The answer to your question is yes...I'm not able also with correct  instructions...or probably I would be able after a lot of time...and after that I would spend 60 euro for runtime...

For the same chip I know the Fab work...I installed It...but Codesys gives an error when I add the device and It is build for temperature sensor...I just need to read a voltage value with high resolution...


Top
   
PostPosted: Tue Jan 21, 2020 9:42 pm 
Offline

Joined: Fri Oct 11, 2019 9:54 pm
Posts: 4
Following your guide, I modified the Fab library: viewtopic.php?t=6174#p12190 , in order to adapt it to my application.
It works...very good! (and thanks :) )


Top
   
PostPosted: Tue Jan 21, 2020 11:15 pm 
Offline

Joined: Tue Mar 26, 2019 4:28 pm
Posts: 93
Fantastic news! I hope you are seeing interesting things at 15.625 µV resolution :D

I would be very pleased were you to release it as open source on the forge. Let me know if I can be of any help in that regard.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited