Rabbit 6000 User’s Manual
digi.com
393
35.3 Operation
35.3.1 32-bit Interface
The I
2
C peripheral is actually a 32-bit interface, so special handling is required when reading or writing all
registers other than SGDR and SGMCR.
When writing a 32-bit register, the value is written to the peripheral only when the most-significant byte
(uppermost) is written. The three lower bytes will be buffered until that final write occurs. For proper oper-
ation, all four bytes in the 32-byte register should be written every time a change to a bit is required.
When reading a 32-bit register, the read of the least-significant (lowest) byte will latch the peripheral’s reg-
ister value for all four bytes. Those values will remain until the next read of the lowest byte, so to avoid
stale data all four bytes should be read whenever a a 32-bit register is accessed.
35.3.2 Interrupts
To enable interrupts for the I
2
C peripheral, the following steps should be taken before performing any
other actions.
1. Write the vector to the interrupt service routine to the internal interrupt table.
2. Configure SGMCR to select the I
2
C interrupt priority and SGC1R to select which interrupts will
occur.
In the interrupt service routine, read SGC1R to identify the reason for interrupt and clear the pending sta-
tus.
All of the sequences below can be used as interrupt-driven routines as well by replacing the polling steps
with responses to interrupts.
35.3.3 Master Mode, Data Write
To write data in master mode, perform the following operations.
1. Set the clock speed by writing to SGCDxR.
2. Set the target slave address and R/W bit by writing to SGDR.
3. Set the master mode and enable the controller by setting bits 1 and 2 of SGC0R.
4. Send the first byte by setting bits 4 and 7 of SGC0R. This can be combined with the previous opera-
tion.
5. Monitor bit 4 of SGSxR to determine when the byte has been sent.
6. Send the next byte by clearing bit 4 and setting bit 7 of SGC0R. If this is the final byte to be sent, set
bit 5 as well to follow it with a Stop condition.
7. Monitor bit 4 of SGSxR to determine when the byte has been sent.
8. Repeat Steps 6–8 until all data have been sent.
To start communicating with a new slave, restart at Step 2.
Summary of Contents for 6000
Page 1: ...Rabbit 6000 Microprocessor User s Manual 90001108_J...
Page 11: ...Rabbit 6000 User s Manual digi com 11 1 3 Block Diagram Figure 1 1 Rabbit 6000 Block Diagram...
Page 43: ...Rabbit 6000 User s Manual digi com 43 4 1 1 Block Diagram...
Page 57: ...Rabbit 6000 User s Manual digi com 57 5 1 1 Block Diagram...
Page 88: ...Rabbit 6000 User s Manual digi com 88 7 2 Block Diagram...
Page 115: ...Rabbit 6000 User s Manual digi com 115 11 1 1 Block Diagram...
Page 127: ...Rabbit 6000 User s Manual digi com 127 12 1 1 Block Diagram...
Page 138: ...Rabbit 6000 User s Manual digi com 138 13 1 1 Block Diagram...
Page 154: ...Rabbit 6000 User s Manual digi com 154 15 1 1 Block Diagram...
Page 163: ...Rabbit 6000 User s Manual digi com 163 16 1 1 Block Diagram...
Page 170: ...Rabbit 6000 User s Manual digi com 170 17 1 1 Block Diagram...
Page 177: ...Rabbit 6000 User s Manual digi com 177 18 1 1 Block Diagram...
Page 186: ...Rabbit 6000 User s Manual digi com 186 19 1 1 Block Diagram...
Page 230: ...Rabbit 6000 User s Manual digi com 230 22 2 Block Diagram...
Page 234: ...Rabbit 6000 User s Manual digi com 234 Figure 22 3 Sample Slow A D Converter Circuit...
Page 287: ...Rabbit 6000 User s Manual digi com 287 25 1 1 Block Diagram...
Page 310: ...Rabbit 6000 User s Manual digi com 310 26 1 1 Block Diagram...
Page 323: ...Rabbit 6000 User s Manual digi com 323 28 1 1 Block Diagram...
Page 351: ...Rabbit 6000 User s Manual digi com 351 31 1 4 Block Diagram...
Page 361: ...Rabbit 6000 User s Manual digi com 361 32 1 1 Block Diagram...
Page 369: ...Rabbit 6000 User s Manual digi com 369 33 2 Block Diagram...
Page 390: ...Rabbit 6000 User s Manual digi com 390 35 1 1 Block Diagram...
Page 408: ...Rabbit 6000 User s Manual digi com 408...
Page 410: ...Rabbit 6000 User s Manual digi com 410...
Page 411: ...Rabbit 6000 User s Manual digi com 411...
Page 420: ...Rabbit 6000 User s Manual digi com 420 Figure 37 1 Memory Read and Write Cycles...