View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
the smbus directive in #use i2c command |
Posted: Thu Oct 11, 2012 9:43 pm |
|
|
Hi,
What does the Smbus option do in #use i2c directive ?
I am trying to interface a 16F648A mcu to a TSL 2560 light sensor. The sensor runs on 3.3V, so I run the pic on 3V also.
Thanks
a |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19516
|
|
Posted: Fri Oct 12, 2012 12:47 am |
|
|
Basically nothing on your chip.
Some of the newer PIC's with a hardware MSSP, have a hardware option to change the bus interface detection levels to match the SMBUS standard, rather than the I2C standard. If you are using a chip with this option, the SMBUS setting switches the interface.
Best Wishes |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE |
Posted: Fri Oct 12, 2012 1:24 am |
|
|
So that's why I am unable to interface with device..
thanks
a |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19516
|
|
Posted: Fri Oct 12, 2012 3:22 am |
|
|
No.
The 648, should drive the TSL2560 fine.
Key thing though is which pins you are using, and what speed you are trying to work?.
On the PIC itself, some pins have Schmitt input buffers, while others have TTL input buffers. You _must_ be using pins with TTL input buffers to talk to an Smbus device.
Second, the pull up resistors needed with a 3v device, are much lower than those normally used for I2C. Start with something like 2KR.
Then the speed. SMBUS does not support the 400K rates like I2C, so you need to be setting up the I2C at 100KHz.
The basic timings are identical for SMBUS, and I2C, within the speed limitations (except SMBUS adds a timeout).
As a comment, why fiddle with two supply rails?. The 2550, allows operation on 3.3v.
Best Wishes |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
thanks |
Posted: Sat Oct 13, 2012 3:06 am |
|
|
thanks, I managed to get the device working.
The SDA pin was always pulled to about 0.5 V whereas the SCL pin was pulsing correctly, I re-soldered the TSL2560 and got the SDA line back to normal, and I was able to communicate with the device.
I am trying to measure the power of a red laser beam (wavelength 635 nm) using this device, from the datasheet I learnt its possible to calculate the irradiance in lux. I learnt from another forum that a laser power meter would be the ideal choice for a laser light source and not a luxmeter.
Perhaps I should look for another sensor...
thanks anyway for all the help..
a |
|
|
|