Rabbit 6000 User’s Manual
digi.com
394
35.3.4 Master Mode, Data Read
To read 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 SGSAxR.
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. Bit 0 should be high as well.
6. Load the next (data) byte into SGCDxR.
7. Receive the first data byte by clearing bit 4 and setting bit 7 of SGC0R. If this is the final byte, set
bit 5 as well to follow it with a Stop condition.
8. Monitor bit 4 of SGSxR to determine when byte has been received. Bit 1 will also be set if this is the
final byte.
9. Read SGDR to get the data.
10. Repeat Steps 6–8 until all data have been received.
To start communicating with a new slave, restart at Step 2.
35.3.5 Slave Mode, Data Write
To write data in slave mode, perform the following operations.
1. Set the slave address by writing to SGSAxR.
2. Set slave mode by clearing bit 2 and enable the controller by setting bit 1 of SGC0R.
3. Monitor bits 5 and 8 of SGSxR to determine when byte has been received for the correct slave
address. Bits 1 and 2 should also be set, and bit 0 clear.
4. Load the byte to be sent into SGDR and send it by setting bit 7 of SGC0R.
5. Monitor bit 4 of SGSxR to determine when byte has been sent. Bit 0 should also be set.
6. If bits 1 or 7 of SGSxR are set, then an ACK or STOP condition occurred and the slave can go back
to step 1. If not, it should go back to step 5 to send the next byte.
35.3.6 Slave Mode, Data Read
To read data in slave mode, perform the following operations.
1. Set the slave address by writing to SGSAxR.
2. Set slave mode by clearing bit 2 and enable the controller by setting bit 1 of SGC0R.
3. Monitor bits 5 and 8 of SGSxR to determine when byte has been received for the correct slave
address. Bit 2 should also be set, and bits 0 and 1 clear.
4. Set bit 7 of SGC0R to start byte read. Also set bit 6 if this is the final byte to be read.
5. Monitor bit 5 of SGSxR to determine when the byte has been received.
6. Read the data byte from SGDR.
7. If bits 1 or 7 of SGSxR are set, then an ACK or STOP condition occurred and the slave can go back
to Step 1. If not, it should go back to Step 4 to receive the next byte.
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...