Discussion:
IIC problem
(too old to reply)
Alan Adams
2018-02-14 16:56:33 UTC
Permalink
Hi

I'm attempting to use an IIC to 1-wire interface from Sheepwalk
Electronics, connected to an rPi running RO 5.23. It is a Maxin DS2482
chip.

It *should* have a read and write address of &18, so the address byte
sent should be &30 to write and &31 to read.

I've tried using SWIs OS_IICOp and IIC_Control, of which the latter
simpler.

Both return the content of the interface's status register when the
read address is used. Both return "No acknowledge from IIC device when
I try to send anything to the write address.

In case the write address is not expected to respond I tried using the
X SWI form to write and ignored the error. This made no difference.

The simplest form follows - it tries every possible address and
reports any which produce an acknowledgement. Only one does so - the
read address.

DIM data% 20
DIM errblock% 256

FOR I%=0 TO255
SYS "XIIC_Control",I%,data%,16 TO errblock%;flags%
IF (flags%AND1) <> 1 THEN
A%=I%>>1
readflag%=I%AND1
PRINT "ADDRESS " + STR$~A% + " is valid";
IF readflag% THEN PRINT " for read" ELSE PRINT " for write"
ENDIF
NEXT

Am I misunderstanding something fundamental, or am I looking at faulty
hardware here?
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
druck
2018-02-14 20:18:44 UTC
Permalink
Post by Alan Adams
I'm attempting to use an IIC to 1-wire interface from Sheepwalk
Electronics, connected to an rPi running RO 5.23. It is a Maxin DS2482
chip.
[Snip]
Post by Alan Adams
Am I misunderstanding something fundamental, or am I looking at faulty
hardware here?
Can you establish if it is working using a Raspbian image on the Pi?

---druck
Alan Adams
2018-02-14 21:37:42 UTC
Permalink
Post by druck
Post by Alan Adams
I'm attempting to use an IIC to 1-wire interface from Sheepwalk
Electronics, connected to an rPi running RO 5.23. It is a Maxin DS2482
chip.
[Snip]
Post by Alan Adams
Am I misunderstanding something fundamental, or am I looking at faulty
hardware here?
Can you establish if it is working using a Raspbian image on the Pi?
I've been hoping to avoid diving that far into the unknown. i suspect
it might become necessary however.

Alan
Post by druck
---druck
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
Loading...