Datasheet

DRV2667
www.ti.com
SLOS751A MARCH 2013REVISED JANUARY 2014
PROGRAMMING EXAMPLES
Single Click or Alert Example
The following programming example shows how to initialize the device and send a simple Mode 3 (Waveform
Synthesis Mode) transaction. If the number of cycles is short (<10), the effect will be a click, and if the number of
cycles is long (> 10) the effect will be a buzz alert.
I2C Address I2C Data Description
Control
0x02 0x00 Take device out of STANDBY mode
0x01 0x00 Set to lowest gain, 50 V
PP
maximum.
0x03 0x01 Set sequencer to play waveform ID #1
0x04 0x00 End of Sequence
Header
0xFF 0x01 Set memory to page 1
0x00 0x05 Header Size - 1
0x01 0x80 Start Address Upper Byte, also indicates Mode 3
0x02 0x06 Start Address Lower Byte
0x03 0x00 Stop Address Upper Byte
0x04 0x09 Stop Address Lower Byte
0x05 0x01 Repeat Count, play waveform once
Data
0x06 0xFF Amplitude for waveform ID #1, full-scale, 50 VPP at Gain = 0
0x07 0x19 Frequency for waveform ID #1, 195 Hz
0x08 0x05 Duration for waveform ID #1, play 5 cycles
0x09 0x00 Envelope for waveform ID #1, Ramp Up = No Envelope, Ramp Down = No Envelope
Control
0xFF 0x00 Set page register to control space
0x02 0x01 Set GO bit (execute waveform sequence)
Library Storage Example
This example loads and plays the six effects shown in Figures 9 to 14 into the waveform RAM. This is a simple
example of how to put multiple waveforms in memory for subsequent low-latency recall. In general, it is a good
practice to put the waveform header in page 1, and the waveform data in the following pages. When new
waveforms are added later, the waveform data will not need to be shifted when this practice is used.
Although this sequence seems long with the verbose descriptions, this example only takes 121 bytes of the
waveform RAM, which is 6 % of the available on-chip memory.
I2C Address I2C Data Description
Control
0x02 0x00 Take device out of STANDBY mode
0x01 0x03 Set to highest gain, 200 V
PP
maximum.
0x03 0x02 Set sequencer to play waveform ID #2 (Figure 17)
0x04 0x01 Set sequencer to play waveform ID #1 (Figure 15)
0x05 0x03 Set sequencer to play waveform ID #3 (Figure 19)
0x06 0x04 Set sequencer to play waveform ID #4 (Figure 16)
0x07 0x05 Set sequencer to play waveform ID #5 (Figure 18)
0x08 0x06 Set sequencer to play waveform ID #6 (Figure 20)
0x09 0x00 End of Sequence
Header
0xFF 0x01 Set memory to page 1
Copyright © 2013–2014, Texas Instruments Incorporated Submit Documentation Feedback 27
Product Folder Links: DRV2667