for detecting a start-condition i react on a falling edge at SDA. 

                P2IES |= BIT0;       // Interrupt on falling edge 

When an Interrupt occurs SCL is checked beeing high, if yes start is ok

now i would like to use

i2c_readbyte and i2c_readack

but i can not give answer to my i2c-master. It says "no acknolge"

how to handle interrupts for the entire system? Is it ok to read SCL after 
interrupt on SDA falling edge?

Mathias


-----Ursprüngliche Nachricht-----
Von: Matthew Peters [mailto:matt...@greycloaklabs.ca] 
Gesendet: Montag, 1. Dezember 2003 19:22
An: Hochheim Mathias (ext)
Betreff: Re: AW: [Mspgcc-users] Examples (i2c/hd44780)


now, setting up an i2c slave is realy realy different than a master...
what i would do is set up the i2c interface on P1 or P2 and use the
interupts to do the entire system... that'll allow the cpu to do other
things too... just have a state machine it follows... shouldn't be too
hard...

Here's the I2C code, as well as a simple program that uses it... the i2c.c
and i2c.h are the only things required, well, if you move the hardware.h
info back into i2c.h... you'll see what that all is...

enjoy :)
    Matthew Peters



On Mon, 1 Dec 2003, Hochheim Mathias (ext) wrote:

> Hello Matthew,
>
> i would like to have a view on your I2C Source's.
>
> I am a total beginner in uC-programming. Only some experience in 8085 and now 
> I have to work with MSP430F123. I need I2C Compatibility, MSP should be 
> slave. Would be very nice if I can take a look on your sourcecode.
>
> Greetings
>
> Mathias 
>
>
>
>
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Matthew Peters [mailto:matt...@greycloaklabs.ca]
> Gesendet: Sonntag, 30. November 2003 16:41
> An: mspgcc-users@lists.sourceforge.net
> Betreff: Re: [Mspgcc-users] Examples (i2c/hd44780)
>
>
>
> on the I2C and HD44780 ideas, i made a while back a form of both... i
> tried to make it as open as possible, allowing for all possible devices
> that use the same interface. I don't have a couple things working like
> checking if the display is buisy or not (4-bit interface doesn't seem to
> work, 8 does, but i haven't tested extensively).
>
> I've tested the I2C system with the TMP100 temperature sensor and a 64kbit
> flash device and they work perfectly.
>
> The display code i've tested with two optrex displays, a 1x16 display and
> a 4x20 one. both displays i've tested with both 8-bit and 16-bit
> interfaces.
>
> If people want to take a look at them or anything, i can hand them the
> files and examples.
>
>       Matthew Peters
>
>
>
>

Reply via email to