Datasheet

ADuC7033
Rev. B | Page 120 of 140
An example code segment configuring the STI port to transmit five bytes and then to transmit two bytes follows:
T4LD = 267; // Timer4 Reload Value
T4CON = 0xC0; // Enable T4, selecting core clock in periodic mode
STIKEY0 = 07; // STICON start write sequence
STICON = 0x11; // Enable and transmit 5 bytes
STIKEY1 = 0xb9; // STICON complete write
STIDAT0 = 0xAABB; // 5 bytes for
STIDAT1 = 0xCCDD; // Transmission
STIDAT2 = 0xFF;
while(STICON != 0x09) // Wait for transmission to complete
{}
STIKEY0 = 07; // STICON start write sequence
STICON = 0x05; // Enable and transmit 2 bytes
STIKEY1 = 0xb9; // STICON complete write
STIDAT0 = 0xEEFF; // 2 bytes for transmission
while(STICON != 0x09) // Wait for transmission to complete
{}