AN1924 Motorola / Freescale Semiconductor, AN1924 Datasheet

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
Semiconductor Application Note
Interfacing Serial LCDs to
a DSP56F805’s SCI and
Porting Code Using the
Embedded SDK
Joseph R. Pasek
1.
© Motorola, Inc., 2001
MOTOROLA
This application follows an earlier application note (“Some
General DSP568xx Interface Examples using the
Embedded SDK”, AN1921/D) that focused on interfacing
the DSP56824 with an LCD, keypad and an SPI-based
device, an 11-channel, 12-bit A/D converter (TLC2543). That
note described interfacing via the SPI port, either directly, or
with the MAX3100 chip that converts SPI signals to a
compatible RS-232 format.
This note will show the relative ease of interfacing either
NetMedia’s LCD+, including a keypad, or Crystalfontz’s 634
Intelligent Serial Display to the Serial Communication
Interface (SCI) port of a DSP56F805. The demonstration
code will be written in C and will use Motorola’s Embedded
SDK libraries.
The SCI is a three-line interface, consisting of a transmit line
(TXD), a receive line (RXD), and a ground line (GND). The
interface allows for asynchronous communication with
peripheral devices and other MCUs. The protocol is very
similar to an RS-232-based interface, except that the voltage
range is that of TTL.
This note will also show the modifications required to
convert the program for the DSP56824 featured in
Application Note AN1921/D to the DSP56F805, using the
Embedded SDK. The modifications are relatively minor and
made only to the respective processor’s SDK-supported
interface code.
Introduction
1. Introduction.....................................1
2. Interface Description.......................2
3. Descriptions of the Intelligent
4. Interfacing the LCDs to the
5. Converting SDK-Based Code .......10
6. Conclusions...................................15
7. References.....................................15
Appendix A. NetMedia’s Serial
3.1 Crystalfontz’s 634 Intelligent
3.2 NetMedia’s LCD+ Serial LCD
4.1 Connecting the 634 LCD to the
4.2 Software for the 634 LCD and the
4.3 Connecting the LCD+ to the
4.4 Software for the LCD+ and the
LCD Modules ............................3
Serial LCD Module .........................4
Module.............................................5
DSP56F805................................5
DSP56F805......................................5
DSP56F805......................................6
DSP56F805......................................7
DSP56F805......................................8
LCD+ ......................................16
Contents
(Motorola Order Number)
Order by AN1924/D
Rev. 0, 4/2001

Related parts for AN1924

AN1924 Summary of contents

Page 1

... DSP56824 featured in Application Note AN1921/D to the DSP56F805, using the Embedded SDK. The modifications are relatively minor and made only to the respective processor’s SDK-supported interface code. © Motorola, Inc., 2001 Order by AN1924/D (Motorola Order Number) Rev. 0, 4/2001 Contents 1. Introduction.....................................1 2. Interface Description.......................2 3 ...

Page 2

Interface Description 2. Interface Description Motorola’s DSP56F80x processors are DSP/MCU hybrids, which not only have the expected capabilities of a DSP, but also the features that allow the processor to perform the functions of a microprocessor. Additionally, the DSP56F80x family ...

Page 3

Figure 1. Motorola’s DSP56F805 EVM Board Figure 2. The J17 Header (SCI1 Port) on the DSP56F805 EVM Board 3. Descriptions of the Intelligent LCD Modules Specifications of the two intelligent serial LCD devices which will be interfaced to the DSP56F805’s ...

Page 4

Descriptions of the Intelligent LCD Modules 3.1 Crystalfontz’s 634 Intelligent Serial LCD Module This LCD module has attracted attention for its capability of interfacing as either an RS-232 device SPI device comes from the factory, ...

Page 5

Among the features of the LCD+ : • Serial I/O: RS-232 or Inverted TTL (2400 to 57600 Baud (8,N,1)) • Keypad input: 4x4 matrix type • Power requirements 15V DC at 9mA (200mA maximum with the backlight on) ...

Page 6

Interfacing the LCDs to the DSP56F805 Code Example 1. LCD634_sci_test.c // LCD634_sci_test.c program tests the interface between a DSP // 56805 using its SCI port and a LCD (Crystalfontz // 634 Intelligent serial display - March 1, 2001 ) #include ...

Page 7

Display some numbers on display */ nanosleep(&FiveSeconds, NULL); write( SciFD, NewScr for ( I=0; I < 29; I sprintf(astring, "%d " write (SciFD, astring, strlen(astring)); } nanosleep(&FiveSeconds, NULL); write( SciFD, NewScr ...

Page 8

Interfacing the LCDs to the DSP56F805 Code Example 2. LCDplus_sci_test.c // LCDplus_sci_test.c program tests the interface to a DSP56F805 SCI // serial port LCD (NewMedia’s Serial LCD+ ) and keypad #include "port.h" #include "io.h" #include "bsp.h" #include "fcntl.h" #include "sci.h" ...

Page 9

Display some numbers on display */ write( SciFD, NewScr strcpy( bstring, "Input at key (’0000’ to exit) \n"); write( SciFD, bstring , strlen(bstring)); strcpy( bstring, "Hit key to start"); ...

Page 10

Converting SDK-Based Code First, the SDK serial support native to the DSP56824 is not available or needed in the DSP56F805 environment. As shown previously, NetMedia’s LCD+ serial device and its associated keypad work very well with the DSP56F805’s SCI port. ...

Page 11

Code Example 5. Original SDK Code for DSP56824’s SPI0 Port SpiParams.bSetAsMaster = 1; /* Open SPI0 port */ SerialMaster = open( BSP_DEVICE_NAME_SPI_0, 0, &SpiParams ); . . . /* Set bit clock rate */ ioctl( SerialMaster, SPI_PHI_DIVIDER_32, NULL ); /* ...

Page 12

Converting SDK-Based Code #include "io.h" #include "fcntl.h" #include "bsp.h" #include "spi.h" #include "stdio.h" #include "sci.h" #include "string.h" #include "port.h" #include "timer.h" #include "types.h" #include "math.h" #include "lcd.h" #include "TLC2543.h" // Prototype of procedure void BaroAdj( int , Word32 * ); ...

Page 13

SciFD = open( BSP_DEVICE_NAME_SCI_1, 0, &SciConfig ); ioctl( SciFD, SCI_DATAFORMAT_EIGHTBITCHARS, NULL ); /* Set bit clock rate */ ioctl( SerialMaster, SPI_BAUDRATE_DIVIDER_32, NULL ); /* SS can be left low between successive SPI bytes */ ioctl( SerialMaster, SPI_CLOCK_PHASE_NOTSET, NULL); /* TLC2543 ...

Page 14

Converting SDK-Based Code /* process sleeps for 1 msec. */ nanosleep( &OneMillisecond, NULL ); DataStore[i] = Datain; sum += Datain; } Vcount = (sum >> 6); /* Compute Barometric pressure in millibars, the following expression uses 32-bit arithmetic and 10 ...

Page 15

CR[0] ) break (iarray[icount] >= ’0’) && (iarray[icount] < ’9’)) { write( SciFD, &iarray[icount icount++; } } iarray[icount sscanf(iarray, "%d", &temp ); *padj = (Word32)temp Conclusions This application ...

Page 16

NetMedia’s Serial LCD+ Appendix A. The Serial LCD 4x20 LCD display with a built-in bi-directional serial interface. The unit is controlled using standard RS-232 serial signals from a host computer or microcontroller. The LCD+ supports these serial data ...

Page 17

A.3 Power Input The power input section consists of four through holes (Solder pads). The two holes marked GND are grounds. The hole marked +5.5V to +15V is tied to the onboard regulator of the LCD+ module. The hole marked ...

Page 18

NetMedia’s Serial LCD+ Table A-2. LCD+ Keypad Options Table Mode Byte Name B3 “Mask Key Presses” B4 “Auto Backlight” B7 “Delayed Response” Control Code Function Ctrl-A Cursor Home Ctrl-B Set/Adjust Backlight Brightness Ctrl-C Set/Adjust Contrast Ctrl-D Hide Cursor Ctrl-E Underline ...

Page 19

Table A-3. LCD+ Control Codes Control Code Function Ctrl-U Set Baud Rate Ctrl-V Read ADC Inputs Ctrl-W Change Bell/Buzzer Frequency Ctrl-X Set Keypad Modes Ctrl-Y Read Keypad Input as Port Ctrl-Z Get LCD+ EEPROM Settings None Display Custom Character Interfacing ...

Page 20

... ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tao Po, N.T., Hong Kong. 852-26668334 Technical Information Center: 1-800-521-6274 HOME PAGE: http://motorola.com/semiconductors/dsp Ç are registered trademarks of Motorola, Inc. Motorola, Inc Equal MOTOROLA HOME PAGE: http://motorola.com/semiconductors/ AN1924/D ...

Related keywords