This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sam7x- RTC - DS1307 ---interface

Hello , all
I want to interface a DS1307 to arm7 via TWI .
can anyone help me.
have nice time
Amir

Parents
  • TWI doesn't really require any interfacing with any OS unless you move up to "PC-class" operating systems where your only access to hardware is through a driver.

    In your case, you can use just about any TWI code for your specific processor. For most processors that have hardware support for it, it would be natural to use an interrupt-driven approach where you might have a send buffer and a receive buffer. Then you can use one of the OS primitives to signal a task whenever there is data available in the receive buffer.

    Tasks that needs to send can insert data in the transmit buffer. Then it's required to check if the interface is active (so a future interrupt will draw data from the transmit buffer) or if you need to kick-start the transfer. That can also be done using a separate task that gets a signal everytime data have been added to the transmit buffer. Or it can be done by each calling task if you just have a critical section that protects many tasks from concurrently checking if TWI is active before deciding to kick-start the device.

Reply
  • TWI doesn't really require any interfacing with any OS unless you move up to "PC-class" operating systems where your only access to hardware is through a driver.

    In your case, you can use just about any TWI code for your specific processor. For most processors that have hardware support for it, it would be natural to use an interrupt-driven approach where you might have a send buffer and a receive buffer. Then you can use one of the OS primitives to signal a task whenever there is data available in the receive buffer.

    Tasks that needs to send can insert data in the transmit buffer. Then it's required to check if the interface is active (so a future interrupt will draw data from the transmit buffer) or if you need to kick-start the transfer. That can also be done using a separate task that gets a signal everytime data have been added to the transmit buffer. Or it can be done by each calling task if you just have a critical section that protects many tasks from concurrently checking if TWI is active before deciding to kick-start the device.

Children