This Question is Answered

22 Replies Last post: Nov 17, 2009 11:29 PM by Allan Joseph Tolentino   1 2 Previous Next
Allan Joseph Tolentino Contributor 31 posts since
Sep 25, 2009
Currently Being Moderated

Nov 3, 2009 12:53 AM

Sensor Communication Problems

Hi guys!

     I have a problem with my MT9V135 sensor. Apparently, when I run the program for interfacing Micron sensors to the BF537 EZ-Kit Lite, the sensor does not recognize the slave address or TWI address that the program designates; an "Address Not Acknowledge" (ANAK) bit occurs in the

twiregisters.jpgTWI_MASTER_STAT register. As a result, the master mode transmit operation does not push through; and register values are not programmed into the sensor registers. Thus, the sensor does not operate.

     Although, I've considered other possible TWI addresses that are specified on the sensor datasheet and the configuration settings for MI354  revision 2 sensors, the problem still persists leaving me with no choice but to ask help from you guys. I just would like to ask two questions: (1) What are the possible problems that make the sensor 'not acknowledge' the TWI address?; and (2) Do you have data for MI354 revision 4 sensor configuration settings? Again, any help will do and will be greatly appreciated.

 

Regards,


     Allan

WassimB Analog Employee   52 posts since
Apr 17, 2009
Currently Being Moderated
1. Nov 4, 2009 5:33 PM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allan,

 

The address you have in TWI_MASTER_ADDR is 8-bits.

Is this because the address already contains the read/write bit? If so, you need to omit that bit when writing the address.

One thing you might want to try is to only use the 7 most significant bits of the ID (i.e. 0x5D instead of 0xBA)

 

Regards,

-Wassim

WassimB Analog Employee   52 posts since
Apr 17, 2009
Currently Being Moderated
3. Nov 5, 2009 12:04 PM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allen,

 

You may have already tried this too, but it's still worth noting that the sensor seems to use a different address depending on the polarity of a particular pin.

Did you try 0x90>1 as well? If that didn't work either, then my suspicion is that there's something wrong other than TWI communication.

 

Are you using an emulator to debug the Blackfin? If so, the tools that you're using (VisualDSP, GDB, etc) should allow you to read the contents of SDRAM. Information on how to read memory can be found in the documentation of those tools. Of course, you need to start out by figuring out the address of the buffer in SDRAM where the program is placing the pixel data.

 

Hope this helps.

 

Regards,

-Wassim

WassimB Analog Employee   52 posts since
Apr 17, 2009
Currently Being Moderated
5. Nov 6, 2009 6:36 PM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allan,

 

What do you mean by "only high transitions"? Does it stay high?

Notice that the SDA (serial data) and SCL (serial clock) pins are open drain and therefore require a pull-up resistor.

 

The example program is based on a system clock of 120MHz.If your system clock is running at a different frequency then you need to change the PRESCALE value in TWI_CONTROL.

 

Hope this helps.

 

Regards,

-Wassim

WassimB Analog Employee   52 posts since
Apr 17, 2009
Currently Being Moderated
7. Nov 10, 2009 5:55 PM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allan,

 

Since you're not getting past the addressing stage, my suspicion is that the problem isn't the TWI communication.

You may want to double-check the circuit connections around the sensor. Verify that the sensor is appropriately powered, that it is not in standby mode, and that the TWI lines have an appropriate pull-up resistor.

 

Regards,

-Wassim

Martin Strubel Contributor 11 posts since
Oct 6, 2009
Currently Being Moderated
9. Nov 12, 2009 5:36 AM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allan,

 

are you using one of those Aptina head boards?

I can't tell about your sensor model, but most of those boards have an extra i2c switch in between, mostly at address 0x70 or 0x73 (7 bit address without R/W bit). You need to write some value (mostly a '1') to this chip in order to be able to access the sensor. But probably you already checked the headboard schematics..

 

There's some sample TWI code to scan for existing i2c devices on the bus:

 

http://www.section5.ch/forum/viewtopic.php?f=2&t=118

 

Unfortunately, it won't run from the box on VDSP, it's rather GNUware. But you could copy the TWI snippets over.

 

Greetings,

 

- Martin

Prasanth Rajagopal Analog Employee   41 posts since
Mar 24, 2009
Currently Being Moderated
10. Nov 12, 2009 6:16 AM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allan,

 

There is a PPT from NXP (who are the original I2C architects) about I2C protocol hardware level debugging (Blackfin TWI port confirms to the I2C standard)

 

http://www.standardics.nxp.com/literature/presentations/i2c/pdf/debug.i2c.oscilloscope.pdf

 

They have explained a number h/w factors to be considered, including the affect of pull-up resistance on the Clock. Take a look at that, and see if you are missing something.

 

Regards

Prasanth.

Martin Strubel Contributor 11 posts since
Oct 6, 2009
Currently Being Moderated
14. Nov 14, 2009 9:09 AM in response to: Allan Joseph Tolentino
Re: Sensor Communication Problems

Hi Allan,

 

I actually found the schematics for the headboard, so this sequence (according to the twi.c from the sample shell code) should allow you to access the sensor:

 

     i2c_init(SWITCH_I2C_ID, 0);
     i2c_write(0x01, 0x01);
     
     // Then we can talk to the sensor
     error = i2c_init(SENSOR_I2C_ID, 0);
     if (error < 0) {
          printf("Sensor not responding\n");
          return ERR_COMM_TIMEOUT;
     }

 

where SWITCH_I2C_ID is 0x73.

Don't knock yourself on the forehead :-) -- if that was the problem.

It wasn't obvious to me either, the Aptina docs didn't explicitely mention.

 

Cheers,

 

- Martin

More Like This

  • Retrieving data ...