[En-Nut-Discussion] RTC/Eeprom at the SAM7X EK board

Harald Kipp harald.kipp at egnite.de
Tue Nov 28 19:44:18 CET 2006


You can try to change

     --
     -- Simple Interface Drivers.
     --
     {
         name = "nutdev_twbbif",
         brief = "Bit Banging Two Wire",
         description = "Tested on AT91 only.",
         requires = { "HW_MCU_AT91R40008" },
         provides = { "DEV_TWI" },
         sources = { "twbbif.c" }
     },

to

     --
     -- Simple Interface Drivers.
     --
     {
         name = "nutdev_twbbif",
         brief = "Bit Banging Two Wire",
         description = "Tested on AT91 only.",
         requires = { "HW_MCU_AT91" },
         provides = { "DEV_TWI" },
         sources = { "twbbif.c" }
     },

in conf/dev/dev.nut.

Unfortunately the port pins used for the bit-banging
TWI are currently not configurable. You need to
modify dev/twbbif.c as well. Mainly

#ifndef TWI_SDA_BIT
#define TWI_SDA_BIT     16
#endif
#ifndef TWI_SDA_PE_REG
#define TWI_SDA_PE_REG  PIO_PER
#endif
#ifndef TWI_SDA_OE_REG
#define TWI_SDA_OE_REG  PIO_OER
#endif
#ifndef TWI_SDA_OD_REG
#define TWI_SDA_OD_REG  PIO_ODR
#endif
#ifndef TWI_SDA_COD_REG
#define TWI_SDA_COD_REG PIO_CODR
#endif
#ifndef TWI_SDA_SOD_REG
#define TWI_SDA_SOD_REG PIO_SODR
#endif
#ifndef TWI_SDA_PDS_REG
#define TWI_SDA_PDS_REG PIO_PDSR
#endif

#ifndef TWI_SCL_BIT
#define TWI_SCL_BIT     17
#endif
#ifndef TWI_SCL_PE_REG
#define TWI_SCL_PE_REG  PIO_PER
#endif
#ifndef TWI_SCL_OE_REG
#define TWI_SCL_OE_REG  PIO_OER
#endif
#ifndef TWI_SCL_OD_REG
#define TWI_SCL_OD_REG  PIO_ODR
#endif
#ifndef TWI_SCL_COD_REG
#define TWI_SCL_COD_REG PIO_CODR
#endif
#ifndef TWI_SCL_SOD_REG
#define TWI_SCL_SOD_REG PIO_SODR
#endif


Harald


At 17:47 28.11.2006 +0100, you wrote:
>I will add a RTC component to the sam7x dev board
>
>I use the same component as the ethernut3d board X1226
>
>I know that the pinning are different
>
>
>
>Ethernut3
>
>X1226 SCL (pin6) -> AT91R40008 PIO 17
>
>X1226 SDA (pin5) -> AT91R40008 PIO 16
>
>
>
>(My) SAM7X
>
>(soft TWI)
>
>X1226 SCL (pin6) -> SAM7X PIO A 26
>
>X1226 SDA (pin5) -> SAM7X PIO A 29
>
>
>
>In the configurator (I load the sam7x device) I can add the Device
>Drivers X12xx diriver enable on
>
>But the os build not the twi lib file
>
>
>
>How can I config correctly the hardware to solve my problem
>
>How works the config tool to build the os
>
>
>
>Ps at the hardware pins TW I can not connect at this moment the rtc
>device




More information about the En-Nut-Discussion mailing list