Download Crystal Touch: Single Touch

Transcript
Crystal Touch: Single Touch
User’s Manual

3.8. Pipelining Multiple Reads
Multiple reads can be pipelined for greater throughput by using the auto increment
command (0xFC) in place of the filler byte (0xFB)
Example: Read the contents of the Position registers (0x14 through 0x16):
A Read is formatted as 101xxxxx (0xAX). When OR’ed with the first register
address, the value is 0xB4
0xA0 |
0x14 = 0xB4
Send 0xB4 followed by 0xFC four times. Then send a single 0xFB to terminate
the sequence. The response to the third 0xFC will be the contents of register
0x14. The response to the fourth 0xFC will be the contents of register 0x15. The
response to the last byte, 0xFB, will be the contents of register 0x16.
Table 6
Byte
Command (MOSI)
Response (MISO)
1
0xB4
Note 1
2
0xFC
0xFB
3
0xFC
0xFB
4
0xFC
Contents of register 0x14
5
0xFC
Contents of register 0x15
6
0xFB
Contents of register 0x16
Note 1: The first response byte may be a filler byte or it may be the response to
a previous command.
3.9. Writing To a Register
Writing to a register requires two SPI exchanges. The host starts by sending the WRITE
command byte. The simultaneous response byte may be data from the previous command
or it may be a filler byte. The host then sends the byte being written to the register. The
simultaneous response byte is 0xFB. Multiple writes must be sent as consecutive single
writes.
Example: Write the value 0x03 to the Control register (0x04):
A Write is formatted as 100xxxxx (0x8X). When OR’ed with the register address,
the value is 0x84
0x80 |
0x04 = 0x84
Send 0x84 followed by 0x03.
Table 7
Byte
Command (MOSI)
Response (MISO)
1
0x84
Note 1
2
0x03
0xFB
Note 1: The first response byte may be a filler byte or it may be the
response to a previous command.
12700 Park Central Drive, Suite 750 • Dallas, TX 75251
Tel: 972.437.3888 Fax: 972.437.2562
[email protected] • www.ocularlcd.com
Page 8 of 16