0
\$\begingroup\$

I am using DT6 custom board from Variscite . This board is connect with DART MX6 board. DT6 in below link

http://www.variscite.com/products/single-board-computers/dt6customboard

I need to handle the RTC hardware on DT6 board by Python. This RTC named ISL12057. I google some info and I understand as follows.

  • ISL12057 is same as DS1307. There is a library of Python for DS1307 as link

http://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock

I try this Python library, but I do not understand this library well. So I have some questions as below. Could you answer them? I appreciate your support.

  1. As I list in /dev/, it has i2c-0, i2c-1, i2c-2. I do not know which I2C that connect to my RTC. I tried 3 of them by smbus.SMBus(0), smbus.SMBus(1), smbus.SMBus(2), there are 2 kinds of error.

1.1 IOError: [Errno 16] Device or resource busy

1.2 IOError: [Errno 5] Input/output error

So, firstly, how can I solve 1.1 or 1.2 to talk with my RTC?

  1. I have no experience with Python that can talk with RTC hardware. So, if my usage of DS1307 library for my ISL12057 is not correct, could you tell me another way?

  2. ISL12057 has an interrupt function at each second or each minute. In Python, can we detect that interrupt when it is asserted?

\$\endgroup\$
1
\$\begingroup\$

It seems that there is no answer for this question. Fortunately, I have solved my problem so far. I will share the answer here.
1. Error
- For 1.1 IOError: [Errno 16]: The RTC (I2C slave) is connected to I2C bus (Master side). But there is a driver is controlling the RTC, so the Python can not talk with that RTC. That's why its error is "Device or resource busy".
Solve 1.1: Remove driver controlling RTC
- For 1.2 IOError: [Errno 5] : No I2C slave is connected to I2C bus (Master side).
2. DS1307 library can be used for ISL12057.
3. Connect RTC interrupt port to a GPIO port on DART board and use polling mechanism of Python to detect interrupt via GPIO port.

\$\endgroup\$
  • \$\begingroup\$ This seems to be a Linux or Python programming question rather than a question of electrical engineering. That's why. \$\endgroup\$ – Janka Aug 18 '17 at 3:29
  • \$\begingroup\$ @Janka: Thanks. Previously, I thought this question is for electronic (RTC Hardware accessing). But it seems to be suitable to post this question to Python programming. \$\endgroup\$ – jackbk Aug 21 '17 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.