
ADSP-BF59x Blackfin Processor Hardware Reference
12-49
Two Wire Interface Controller
MCOMP will be set when Count reaches zero
***********************************************************/
M_COMP:
R1 = W[P1 + LO(TWI_INT_STAT)](z);
CC = BITTST (R1, bitpos(MCOMP));
if ! CC jump M_COMP;
M_COMP.END:
W[P1 + LO(TWI_INT_STAT)] = R1;
/* load the pointer with the address of the transmit buffer */
P2.H = TX_file;
P2.L = TX_file;
/***********************************************************
Pre-load the tx FIFO with the first two bytes: this is necessary
to avoid the generation of the Buffer Read Error (BUFRDERR) which
occurs whenever a transmit transfer is initiated while the trans-
mit buffer is empty
***********************************************************/
R3 = W[P2++](Z);
W[P1 + LO(TWI_XMT_DATA16)] = R3;
/***********************************************************
Initiating the Write operation
Program the Master Control register with:
1. the number of bytes to transfer: TWICount(x)
2. Repeated Start (RESTART): optional
3. speed mode: FAST or Standard
4. direction of transfer:
MDIR = 1 for reads, MDIR = 0 for writes
5. Master Enable MEN. Setting this bit will kick off the transfer
***********************************************************/
R1 = TWICount(0xFE) | FAST | MEN;
W[P1 + LO(TWI_MASTER_CTL)] = R1;
SSYNC;
/***********************************************************
loop to write data to a TWI slave device P3 times
***********************************************************/
Содержание ADSP-BF59x Blackfin
Страница 64: ...Development Tools 1 22 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 74: ...Processor Specific MMRs 2 10 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 204: ...Unique Information for the ADSP BF59x Processor 5 104 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 244: ...Programming Examples 6 40 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 345: ...ADSP BF59x Blackfin Processor Hardware Reference 9 9 Core Timer Unique Information for the ADSP BF59x Processor None...
Страница 346: ...Unique Information for the ADSP BF59x Processor 9 10 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 398: ...Unique Information for the ADSP BF59x Processor 11 42 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 622: ...Unique Information for the ADSP BF59x Processor 15 38 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 700: ...Programming Examples 16 78 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 738: ...Boundary Scan Architecture B 8 ADSP BF59x Blackfin Processor Hardware Reference...