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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/14/08 17:20
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#159061 - Misunderstanding
Responding to: ???'s previous message
Jorge, I previously mentioned that you likely cannot ready from an EEPROM with the default CA code. The reason for this is that every read must start with a write of the address, then transmit a repeated start condition. However in your latest example you are still trying to receive from the EEPROM without first writing the address to receive from. Unless your EEPROM works differently from what I expect.

As I previously suggested, your first step is to just write to the EEPROM and get that working. Don't worry about trying to read. What you are looking for is a completed transfer with no errors.

I also suggested going through the CA code line by line and understand what each register does and how everything fits together. I2C is a bit different from many of the other peripherals on a microcontroller in that you must understand the operation of I2C to be able to use it, even with generated code from CA. There is so much flexibility and so many aspects to consider that this is essential.

I think that Keil's uVision allows you to simulate the I2C bus. I haven't tried it but I recommend looking into it.

Erik's advice of toggling a pin every time the ISR is executed is a good one and you should do that. At a minimum the ISR should execute at least once when the start condition is transmitted. If that isn't happening then put your scope on the bus and confirm you see the start condition.

So what I want to know: do you see the start condition on the bus. If yes, is the ISR executed at least once?

If you don't see the start condition then check interrupts are enabled. You can step through your code in the Keil uVision simulator and then go to the Debug menu and open the I2C peripheral and confirm the register and interrupt settings - no need to simulate the I2C bus for that simple check.

Andy

List of 51 messages in thread
TopicAuthorDate
Question about I2C code from Code Architect            01/01/70 00:00      
   these functions are like...            01/01/70 00:00      
      Some functions are not necessary ...            01/01/70 00:00      
         yes            01/01/70 00:00      
            Question about I2C (again)            01/01/70 00:00      
               do not fiddle with the SFRs            01/01/70 00:00      
            I2C and code architect            01/01/70 00:00      
               problens with I2C            01/01/70 00:00      
                  what tools do you have?            01/01/70 00:00      
                     Tools            01/01/70 00:00      
                        try smaller resistors            01/01/70 00:00      
                           I2C Code            01/01/70 00:00      
                              Update            01/01/70 00:00      
                              I2C Code            01/01/70 00:00      
   Problens in I2C            01/01/70 00:00      
   The code            01/01/70 00:00      
      other board, same problem            01/01/70 00:00      
         I do not recall, but have a look            01/01/70 00:00      
            Shifted            01/01/70 00:00      
               Issues            01/01/70 00:00      
                  Ok..more questions.            01/01/70 00:00      
                     I2C            01/01/70 00:00      
                        How to write ?            01/01/70 00:00      
   Always get IDLE status in I2C bus            01/01/70 00:00      
   Always get IDLE status in I2C bus            01/01/70 00:00      
      I2C Interrupt doesn't work.            01/01/70 00:00      
   HOW CAN I TEST I2C INTERRUPT?            01/01/70 00:00      
      It seems to me that ....            01/01/70 00:00      
         ok, I removed spy from I2C int            01/01/70 00:00      
            some code            01/01/70 00:00      
               I need baby steps now. I 'm staying crazy with it.            01/01/70 00:00      
                  getting less crazy            01/01/70 00:00      
   where is            01/01/70 00:00      
      I couldn't understand            01/01/70 00:00      
         things            01/01/70 00:00      
         Misunderstanding            01/01/70 00:00      
            if you have ICE or ...            01/01/70 00:00      
         Code            01/01/70 00:00      
   Your note to me            01/01/70 00:00      
   Baby steps again - I2C, the return            01/01/70 00:00      
      Understanding            01/01/70 00:00      
         Because...            01/01/70 00:00      
            Hmmm            01/01/70 00:00      
                I can see something finally !!!            01/01/70 00:00      
                  Breadboard            01/01/70 00:00      
                     solder joints            01/01/70 00:00      
                        by checking EVERY solder joint twice.            01/01/70 00:00      
   I checked all solder joint            01/01/70 00:00      
      look in the datasheet and find out how to make ...            01/01/70 00:00      
         I didn't get yet            01/01/70 00:00      
            Anyone?            01/01/70 00:00      

Back to Subject List