home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!stl!bnr.co.uk!row
- From: row@bnr.co.uk
- Newsgroups: comp.sys.acorn
- Subject: IOC and IIC serial bus
- Message-ID: <1992Jul21.082331.22460@bnr.co.uk>
- Date: 21 Jul 92 08:23:31 GMT
- Sender: daemon@bnr.co.uk
- Reply-To: row@bnr.co.uk ()
- Organization: BNR Europe Limited, London Road, Harlow, Essex, GB
- Lines: 60
-
- I am currently adding a couple of new devices to the IIC bus
- on my Archimedes and have the hardware working BUT the IIC
- SWI is pretty useless as it stands and I therefore need to
- enhance this module.
-
- Below is a partial disassembly of the IIC module, could someone
- please explain the bits with the questions in the comments please ?
- All the comments shown are my interpretations of what I think the
- code is doing, and the parameters it takes, I maybe completely
- wrong, if so what does it do #?!
-
- ;
- ; This function I think places data on the IIC bus - any comments.
- ; On Entry: (I think)
- ; R0 - status of data line
- ; R1 - status of clock line
- ;
-
- .callD STMDB R13!,{R0-R2,R14}
- BIC R14,R14,#&40000000 ;
- .callC ORR R14,R14,#&08000000 ;
- TEQP R14,#0 ;
-
- ADD R0,R0,R1,LSL #1 ; Value to poke to device
-
- MOV R2,#0 ; What does
- LDRB R1,[R2,#262] ; this bit
- BIC R1,R1,#3 ; do ?
- ORR R1,R1,R0 ; What is at address
- ORR R1,R1,#&C0 ; #262 ?
- STRB R1,[R2,#262] ; Cos I don't know !!
-
- MOV R2,#&03200000 ; IIC device address
- STRB R1,[R2,#0] ; Place data on IIC lines
- .loop1 LDREQB R1,[R2,#0] ; Read IIC lines
- TSTEQ R1,#2 ; Wait for bit 2 (IIC clock)
- BEQ loop1 ; to go high.
- MOV R0,#&0A ;
- BL call3 ; Call delay
- LDMIA R13!,{R0-R2,PC}^
-
- How do the timers used below work ? What is the delay ?
-
- .call3 STMDB R13!,{R14}
- STRB R0,[R2,#76] ; T0 latch command
- LDRB R1,[R2,#64] ; T0 count low
- .loop2 STRB R0,[R2,#76] ; T0 latch command
- LDRB R14,[R2,#64] ; T0 count low
- TEQ R14,R1 ;
- MOVNE R1,R14 ;
- BEQ loop2 ;
- SUBS R0,R0,#1 ;
- BNE loop2 ;
- LDMIA R13!,{PC}
-
-
- Any help would be appreciated.
-
- Reuben Wells
- Reuben O. Wells - BNR Europe Ltd - (+44) 279 403704
-