Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/19/10 23:14
Read: times


 
#175141 - A Quick Reply
Responding to: ???'s previous message
Sandu Buraga said:
1) Yes I am doing this by bit bang. The module I am using is an Atmel AT24C1024B. It can run at 400kHz or 1Mhz depending on what voltage you apply, because I am using ~3.3V it should run at 1Mhz.


You should strive to run the interface to the chip as fast as possible for this interface. Have you carefully checked all your bit-bang timing on a scope to make sure that it all looks OK?

How are you accomodating the 5 millisecond write pulse time of the AT25C1024? Are you doing BHUSY polling to ascertain when the devide is done writing? Or have you just done some type of tiemr delay? Do note that if you attempt to try to write the next block of 256 bytes before the current write is complete then that 2ND block will fail. That failure could go unnoticed if your bit-bang I2C routnes are not comprehending any NACK bits that may come back from the device. (Note that ignoring NACKs is a fault with some "free" I2C code you may have found on the web).

Sandu Buraga said:
2) The 8052 that I am using is an Atmel AT89C8131A-M running at 12MHz. I think is powerfull enough for my little OS, which is not so complex afterall. On one task is checking the internal USB stak, and in the second task is doing user-application business logic. In fact everything started from Atmel's sample application that is posted on their product webpage.


This CPU is a pokey 6 clocks / cycle. At your 12MHz clocking you will have difficulty getting the I2C bus even close to the 1MHz rate of you use bit bang methods. Can you post a real link to the Atmel "mini-OS' code you are using so I can look at it and determine just how "light weight" the thing actually is? I have my doubts about a pokey 1-2MHz instruction rate MCU being able to handle overhead of a task scheduling algorithm when you are doing repeatitive tasks that take 28 + 5 milliseconds to perform.

Sandu Buraga said:
3) The on-board I2C periphal or TWI how it is called by Atmel it is faster indeed, but it knows only 8bit addressing which is quite a limitation. Serial EEPROM is deprecated, but is too late now, at that moment my choice was motivated by the fact that I had programmed once upon a time during college and it was somehow easier for me to start with. What is stupid with the serial EEPROM is the 5ms delay after you write something, has no sense to push the memory to 1MHz since you have this 5ms limitation. Your 25-28ms is realistic enough.


The TWI on your MCU is not limited in any way with regard to how the AT24C1024 serial EEPROM is addressed. Each byte of the serial memory module is sent out through the SSDAT register byte by byte. The 8-bit SSADR register of the TWI is would not be used at all when sending Master Mode transactions to the AT24C1024. The SSADR is used when the TWI is setup to respond as a Slave Device on the I2C bus. You should be able to get the I2C interface to run at 400kHz using the TWI.

Sandu Buraga said:
4) The sensor is not I2C, it is something proprietary.


Can you reveal what the proprietary interface is? Are you sure that this sensor device does not have some type of behavior where the software interface to the part gets into some mode that has an occasional long delay that causes some type system behavior that interferes with the long transaftions required of the AT24C1024 memory?

Sandu Buraga said:
5) Sounds a good idea, is a good solution to measure really how much it takes for read date from the sensor and how mouch it takes to write into memory.


Sandu Buraga said:
6) It is correct what you are saying but I really don't think that this is my case. I already checked this aspects.


Before you completely convince yourself that there is not an overlap of control to critical variables in the queue control mechanism you should at least do one of two things... a) use the spare port bits scheme to show when each entity supposedly "owns" the memory pool controls and check on the scope if there is any overlap...b) try EA=0 / EA=1 instructions around critical code sections to make sure you do or do not still see the same problems.

Michael Karas


List of 17 messages in thread
TopicAuthorDate
I2C page write and interrupts            01/01/70 00:00      
   Some Important Things to Consider            01/01/70 00:00      
      Re: Some Important Things to Consider            01/01/70 00:00      
         You just buffer things            01/01/70 00:00      
            ISR + superloop normally enough            01/01/70 00:00      
         A Quick Reply            01/01/70 00:00      
            Re: A Quick Reply            01/01/70 00:00      
            Confirmation            01/01/70 00:00      
               The Atmel Scheduler            01/01/70 00:00      
                  Re: The Atmel Scheduler            01/01/70 00:00      
                     Your times seem quite long            01/01/70 00:00      
                        Re: Your times seem quite long            01/01/70 00:00      
   The problem seems to be different            01/01/70 00:00      
      Time to closely read data sheet.            01/01/70 00:00      
         Re: Time to closely read data sheet.            01/01/70 00:00      
            Write a generic function.            01/01/70 00:00      
         Paged operation very common            01/01/70 00:00      

Back to Subject List