[En-Nut-Discussion] twi -problem with EEPROM programming

uprinz2 at netscape.net uprinz2 at netscape.net
Mon May 25 14:54:54 CEST 2009

 Hi Ole!

In short words... I try my very best :)
The interrupt handler got stuck in several conditions. Mainly the problem was, that it tried to cover all things at once together with the single big transfer function that tried the same too. And there was another problem in big discrepancies between the datasheet of the SAM7 units and their real-live behaviour. (Yes Harald and I read the app-notes and erratas :) )
I started with splitting the sender and receiver routine to get them working part by part. Harald jumped in and we managed to put everything together working very smoothly now. The biggest change is, that besides the master_transact() there are now master_regread and master_regwrite functions that fully support register adderssing inside the target chips (slaves).
Then I added a EEPROM driver upon these master_reg* functions that includes page handling and ACK-polling. The driver is easily configurable and any kind of EEPROM or FRAM chips can be attached by only adapting or adding a single small configuration struct. The struct is send to the functions call via pointer so one could add as many chips as needed, all can be accessed 'virutally the same time'.

What I didn't do until yet is to glue the at24c driver into the standard config memory handler. And I didn't port the code to the AVR or other devices as I actually do not have any ATmega128 device with any kind of I2C device attached. 

I now have to port closed source code to NutO/S 4.9.x but then I get back to p
ort and add some open source again. But I appreciate any comment on the I2C or EEPROM code at any time.

Regards, Ulrich


-----Original Message-----
From: Ole Reinhardt <ole.reinhardt at embedded-it.de>
To: Ethernut User Chat (English) <en-nut-discussion at egnite.de>
Sent: Mon, 25 May 2009 1:07 pm
Subject: Re: [En-Nut-Discussion] twi -problem with EEPROM programming

Hi Ulrich,

> Äh, why is the hardware TWi Driver still considered as broken? I mean, 
> we two spent a lot of time whith it and on my AT91SAM7X256-EK it works 
> pretty charmin.
> Ok, the new one is in 4.9.x / trunk not in the older ones. But it can be 
> merged from the nwe into the older releases without any problem.

Sorry I did not noticed yet the work you've spend into this driver. A
very big sorry and thanks for the work! I'll test it in my applications
soon and will try to follow what you've changed :) Could you perhaps
explain me what was wrong in some short words?



|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |

| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |



More information about the En-Nut-Discussion mailing list