ADSP-BF50x Blackfin Processor Hardware Reference
16-51
Two-Wire Interface Controller
Prescale = 10 (0xA) for an SCLK = 100 MHz (CLKIN = 50MHz)
Prescale = SCLK / 10 MHz
P1 points to the base of the system MMRs
***********************************************************/
R1 = TWI_ENA | 0xA (z);
W[P1 + LO(TWI_CONTROL)] = R1;
/***********************************************************
Set CLKDIV:
For example, for an SCL of 400 KHz (period = 1/400 KHz = 2500 ns)
and an internal time reference of 10 MHz (period = 100 ns):
CLKDIV = 2500 ns / 100 ns = 25
For an SCL with a 30% duty cycle, then CLKLOW = 17 (0x11) and
CLKHI = 8.
***********************************************************/
R5 = CLKHI(0x8) | CLKLOW(0x11) (z);
W[P1 + LO(TWI_CLKDIV)] = R5;
/***********************************************************
enable these signals to generate a TWI interrupt: optional
***********************************************************/
R1 = RCVSERV | XMTSERV | MERR | MCOMP (z);
W[P1 + LO(TWI_INT_MASK)] = R1;
/***********************************************************
The address needs to be shifted one place to the right
for example, 1010 001x becomes 0101 0001 (0x51) the TWI
controller
controller actually sends out 1010 001x where x is either a 0
for writes or 1 for reads
***********************************************************/
R6 = 0xBF;
Summary of Contents for EZ-KIT Lite ADSP-BF506F
Page 50: ...Contents l ADSP BF50x Blackfin Processor Hardware Reference ...
Page 92: ...Development Tools 1 30 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 110: ...Interface Overview 3 12 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 236: ...Internal Flash Memory Control Registers 6 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 650: ...Programming Examples 15 56 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 804: ...Programming Examples 17 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1194: ...Programming Examples 24 90 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1256: ...ACM Registers A 50 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1264: ...Boundary Scan Architecture B 8 ADSP BF50x Blackfin Processor Hardware Reference ...