AN2320 Freescale Semiconductor / Motorola, AN2320 Datasheet - Page 13

no-image

AN2320

Manufacturer Part Number
AN2320
Description
Interfacing the MCF5272 to a Standalone CAN Controller
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
Transmitting and Receiving over the MCF5272 QSPI Interface
vary between the different accesses (for example, the minimum time for a read access can be three times as
much as a write access), it may be desirable to change the command RAM entries when switching between
a read transfer and a write transfer. QSPI initialisation code:
void
mcf5272_qspi_init()
{
MCF5272_IMM *imm = mcf5272_get_immp();
/*Set QSPI mode register, 5.5Mbit/s, 8 bit, data change on leading, clock idle high*/
MCF5272_WR_QSPI_QMR(imm,MCF5272_QSPI_QMR_CAN);
/*Set delay after transfer and clock delay*/
MCF5272_WR_QSPI_QDLYR(imm,MCF5272_QSPI_QDLYR_CAN);
/*Clear flags and interrupts*/
MCF5272_WR_QSPI_QIR(imm,MCF5272_QSPI_QIR_CAN);
/*Point to top of command RAM*/
MCF5272_WR_QSPI_QAR(imm,MCF5272_QSPI_QAR_Comm);
/*Set each entry for continuous transfer, 8 bit transfer, to use /CS0 and delays*/
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
MCF5272_WR_QSPI_QDR(imm,MCF5272_QSPI_QDR_CR_CONT);
}
Writing to the 82C900 register:
/*The address of 82C900 register and data to be written to it are passed*/
void QSPI_SendByte(uint16 CanRegAddr, uint8 Data)
{
MCF5272_IMM *imm = mcf5272_get_immp();
/*Determine 82C900 register address*/
CAN_SetPageReg((uint8)(CanRegAddr>>7));
/*Point to top of Tx RAM*/
13
Interfacing the MCF5272 to a Standalone CAN Controller
MOTOROLA
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2320