AN1924 Motorola / Freescale Semiconductor, AN1924 Datasheet - Page 11

no-image

AN1924

Manufacturer Part Number
AN1924
Description
AN1924 Interfacing Serial LCDs to a DSP56F805s SCI and Porting Code Using the Embedded SDK
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Code Example 5. Original SDK Code for DSP56824’s SPI0 Port
/* Set bit clock rate */
Code Example 6. DSP56824 Adapted to DSP56F805’s SPI
/* Set bit clock rate */
Code Example 7. IntFaceBaro.c for the DSP56F805 Environment
SpiParams.bSetAsMaster = 1;
/* Open SPI0 port */
SpiParams.bSetAsMaster = 1;
SerialMaster = open( BSP_DEVICE_NAME_SPI_0, 0, &SpiParams );
ioctl( SerialMaster, SPI_PHI_DIVIDER_32, NULL );
/* Set Data format for 16 bit */
ioctl( SerialMaster, SPI_DATAFORMAT_RAW, NULL );
/* SS can be left low between successive SPI bytes */
SpiParams.pSlaveSelect = NULL; /* GPIO Pin 5 used for SS */
SpiParams.pSlaveDeselect = NULL;
SpiParams.TransmissionSize = 16;
/* Open SPI0 port */
SerialMaster = open( BSP_DEVICE_NAME_SPI_0, 0, &SpiParams );
ioctl( SerialMaster, SPI_BAUDRATE_DIVIDER_32, NULL );
/* SS can be left low between successive SPI bytes */
ioctl( SerialMaster, SPI_CLOCK_PHASE_NOTSET, NULL);
The code modification in
TLC2543 ADC chip.
The complete details of code ported from the DSP56824 to the DSP56F805 environment using the
Embedded SDK are shown in
.
.
.
ioctl( SerialMaster, SPI_CLK_PHASE_SS_CLEAR, NULL);
.
.
.
/* IntFaceBaro.c - Procedure used to interface to TLC2543 - 12-bit
analog-to-digital
converter with serial control and 11 analog inputs. The DSP56F805
SPI0 port is employed. The software is developed for the DSP56F805
EVM environment. Interface to NetMedia LCD+ serial display device
and keypad is also included - March 1, 2001 */
Code Example 6
Code Example
Interfacing LCDs and Porting Code
/* SPI0 is set as master */
/* SPI0 is set as master */
/* Size of transmission */
permits the DSP56F805’s SPI port to interface with the
7.
Converting SDK-Based Code
11

Related parts for AN1924