Datasheet 搜索 > UART接口芯片 > NXP(恩智浦) > SC16IS750IPW 数据手册 > SC16IS750IPW 用户编程技术手册 6/9 页


¥ 14.748
SC16IS750IPW 用户编程技术手册 - NXP(恩智浦)
制造商:
NXP(恩智浦)
分类:
UART接口芯片
封装:
TSSOP-24
描述:
NXP SC16IS750IPW 接口, UART, 1通道, 5 Mbps, 2.3 V, 2.7 V, TSSOP, 24 引脚
Pictures:
3D模型
符号图
焊盘图
引脚图
产品图
页面导航:
应用领域在P8
导航目录
SC16IS750IPW数据手册
Page:
of 9 Go
若手册格式错乱,请下载阅览PDF原文件

AN10462_1 © Koninklijke Philips Electronics N.V. 2006. All rights reserved.
Application note Rev. 01 — 1 June 2006 6 of 9
Philips Semiconductors
AN10462
SPI programming for Philips Bridge ICs
case 0x02: // transmit hold register (THR) interrupt
SPI_write(THR, data);
default: break;
}
}
3.3 Bus interface layer
The Bus Interface layer handles the SPI-bus interface between the microcontroller and
the Bridge IC for transmitting and receiving the SPI data. The three functions in the bus
interface layer are:
SPI_send — The microcontroller transmits data to the SPI-bus and waits until the end of
SPI data transmission.
SPI_read — The Bridge IC receives the data from peripherals, then the microcontroller
retrieves the data from the Bridge IC vial SPI-bus and stores the data for further
processing.
SPI_write — The microcontroller writes data to the Bridge IC via SPI-bus, then the
Bridge IC will transmit the data to peripherals.
char SPI_send (char byte) { // mcu sends a byte to spi bus
SPDAT = byte; // data is sent
while(!SPI_tx_completed); // wait end of transmission
SPSTAT &= ~0x80; // clear mcu spi interrupt flag (SPIF)
SPI_tx_completed = 0; // clear transmit spi interrupt flag
return SPDAT; // receive data on spi read
}
char SPI_read (char register) { // mcu reads a register from SC16IS750
SPI_SS = 0; // enable slave chip select
SPI_send((register<<3) | 0x80); // register address is sent
register = SPI_send(0); // dummy data is sent for spi read
SPI_SS = 1; // disable slave chip select
return register; // receive the read data
}
void SPI_write (char address, char data) { // mcu writes data to SC16IS750
SPI_SS = 0; // enable slave chip select
SPI_send (address<<3); // address is sent
SPI_send (data); // data is sent
SPI_SS = 1; // disable slave chip select
}
器件 Datasheet 文档搜索
AiEMA 数据库涵盖高达 72,405,303 个元件的数据手册,每天更新 5,000 多个 PDF 文件