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 Tue Sep 17, 2019 10:27 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: I2C baud rate
PostPosted: Wed Aug 13, 2014 4:36 pm 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Hi,

How can I change I2C baud rate permanently?

Default is 400kHz.

I tried:
sudo modprobe i2c_bcm2708 baudrate=100000
sudo bash -c "echo options i2c_bcm2708 baudrate=100000 > /etc/modprobe.d/i2c.conf"

But this doesn't work. After reboot, baud rate is set to 400kHz again.

Thank you.

BR
Zdenko.


Top
   
 Post subject: Re: I2C baud rate
PostPosted: Wed Aug 13, 2014 6:45 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3450
Hi Zdenko,

you need to change this in:

/etc/init.d/codesyscontrol

snippet:

Code:

        make_mknod

        killall codesyscontrol.bin > /dev/null;

        export PlcConfigFile=/etc/CODESYSControl.cfg

        echo bcm2708_i2c.0 > /sys/bus/platform/drivers/bcm2708_i2c/unbind
        echo 400000 > /sys/module/i2c_bcm2708/parameters/baudrate
        echo bcm2708_i2c.0 > /sys/bus/platform/drivers/bcm2708_i2c/bind


BR
Edwin


Top
   
 Post subject: Re: I2C baud rate
PostPosted: Thu Aug 14, 2014 6:39 am 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Thank you Edwin! It works :D .

BR,
Zdenko.


Top
   
 Post subject: Re: I2C baud rate
PostPosted: Mon Sep 29, 2014 10:14 pm 
Offline

Joined: Fri Aug 03, 2012 2:00 pm
Posts: 11
Hello
I'm trying to change the i2c baud rate to 100kHz following the example above. I have copied the code in to the "codesyscontrol" file but when restarting the pi, codesys does not work.
Is this how the change was intended? see attached picture.

Thank


You do not have the required permissions to view the files attached to this post.


Top
   
 Post subject: Re: I2C baud rate
PostPosted: Fri Nov 07, 2014 10:15 am 
Offline

Joined: Fri Apr 18, 2014 5:36 pm
Posts: 70
Hi,

it looks ok.

You don't have to copy anything.
Just change parameter in /etc/init.d/codesyscontrol:
echo 400000 > /sys/module/i2c_bcm2708/parameters/baudrate
to:
echo 100000 > /sys/module/i2c_bcm2708/parameters/baudrate

and save file, then do reboot.
It should work.

Best regards,
Zdenko.


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 6 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