On Mon, Oct 20, 2008 at 5:47 PM, Dennis Muhlestein
<[EMAIL PROTECTED]>wrote:

> I've been playing around with reading and writing i2c data on my fx2lp
> board.  Here is the 1st three steps for reading i2c data according to
> the TRM (13.4.4)
>
> 1. Set START=1. If BERR = 1, start timer*.
> 2. Write the 7-bit peripheral address and the direction bit (1 for a
> read) to I2DAT.
> 3. Wait for DONE=1 or for timer to expire*. If BERR=1, go to step 1.
>
> I understand you can get a BERR if another controller on the board is
> trying to send data on the bus.  I'm not quite clear on what do do in
> this case.
>
> Should I
>
> a) set a timer, wait for the timer to go off, and then start over at
> step 1 or
> b) set the timer, write the address to I2DAT, and then wait for the
> timer then check DONE and BERR both.
>
> Thanks for helping noobs!
> Dennis
>

If I recall correctly, you should use option a. set a timer and then start
over at step 1.

-- 
Ori Idan
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to