The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

AN1743 Freescale Semiconductor, Inc. Scrolling Message Softw


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



Order this document AN1743/D
AN1743
Freescale Semiconductor, Inc.
Scrolling Message Software
Brad Bierschenk Consumer Systems Group, Applications Engineering Austin, Texas
Introduction
Many applications displays, such panels, provide useful output. Modern displays efficient affordable microcontrollers communicate with outside world. However, limitation such displays amount information that presented time. output message that longer than display, software needs method "scroll" information across display screen. This method should divided into independent tasks, allowing normal paced-loop program execution. This application note documents such technique.
Displays
Many different types displays used applications, most common (liquid crystal display). These come wide variety styles.
Motorola, Inc., 1998
AN1743
More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
most basic styles typical 8-bit applications are: Dot-matrix Displays Dot-matrix character display Segmented character display
Freescale Semiconductor, Inc.
Dot-matrix character displays usually have on-board controllers, which handle character mapping that converts ASCII character input dotmatrix character output. controller also generates driving waveforms display. These displays commonly accessed serial connection, using command data bytes control module. These types displays easy interface, tend larger more expensive. Segmented displays, other hand, generally interfaced parallel fashion. Each numeric alpha-numeric digit composed specific number segments, usually seven digit. Each segment display input line. decrease number input lines required, displays multiplexed. This done multiple backplanes, referred "duty" display (for example, duty implies four backplanes multiplexing). This allows frontplane line control several segments. segmented, multiplexed display controlled waveforms which provide various voltage levels, referred "bias" display. theory behind these waveforms beyond scope this document. control waveforms generated software control pins, separate driver chip, dedicated circuitry. Some Motorola MCUs provide built-in drivers. specific example MC68HC705L16 microcontroller. This useful effectively drive with segments. output drivers controlled data register values. method presented this document assumes segmented display. This method adapted easily other displays, such dot-matrix type modules, with changes software. "intelligent" dot-matrix would decrease
Segmented Displays
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note 68HC705L16 Microcontroller
software complexity memory requirements, would require serial parallel interface.
68HC705L16 Microcontroller
MC68HC705L16 microcontroller especially suited applications. provides internal driver, which supports four backplanes frontplanes, control segments through pins. external resistor ladder provides bias levels waveform. output waveforms generated automatically MCU, which driven data registers. user simply writes data registers control segments.
Freescale Semiconductor, Inc.
Software Method Scrolling
application requires visual output, predetermined "canned" messages will displayed. message shown longer than display, message needs progress across display. pacedloop program structure typical software, tasks executed deliberate order. software technique must allow normal task processing, while appearing scroll message across display continuously. Message Storage software stores messages ASCII character strings memory. message marked special end-of-text character. start each message identified offset from base address. base address group message strings identified with label. This allows beginning particular message string calculated offset from base address. Because message strings their characters referenced using indexed addressing, blocks messages limited bytes. String storage capability
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
extended using multiple base address labels (for instance, ErrorMsgs, WarningMsgs, InputMsgs) label strings categorically. first step displaying message using this method identify string shown. index variables keep track starting current offset message string. index variables base address message group used access character data from string. main loop program where user's normal tasks would carried out. scrolling software should impede execution other system tasks.
Freescale Semiconductor, Inc.
Displaying Messages
routine update display called normal task main loop. This accomplishes goal scrolling string showing successive portions message. After display's worth characters shown, message index incremented. Once string been reached, software continues scroll string display, "padding" unused display positions with blank spaces. Once message scrolled display, software resets message index variables message displayed again from beginning. Message strings stored ASCII character values. There needs relating ASCII character bytes data register values. data register values bitmap segment values particular digit. setting segment values appropriately, characters represented display.
Character Conversion
relationship between ASCII characters segment data handled lookup table. Each entry table contains bytes which represent segment values required display particular character. conversion subroutine called, with ASCII character value converted argument. conversion checks character valid alphabetic, numeric, special character. predefined operation ASCII value converts into offset into lookup table. segment bitmap character then accessed, using offset base address lookup table. After this conversion, character displayed taking data bytes from table
AN1743
More Information This Product, www.freescale.com
MOTOROLA
Application Note Sample Application
placing them appropriate data registers. This process repeated data registers that correspond frontplane outputs being used display. showing display worth characters time, work outputting scrolling message divided into discrete time segments. Incrementing index into current string before updating display gives impression that message scrolling continuously across display.
Freescale Semiconductor, Inc.
Sample Application
this simple application, 8-digit, 15-segment display (PlanarStandish Model 4228) used show text messages. This particular display four backplane pins frontplane pins. Connections made Motorola MC68HC705L16 microcontroller through emulator module. four backplane lines from connected four common backplane pins panel, first frontplane lines from connected frontplane pins display. Table shows connections made between panel. Table Connections between Panels
panel function COM1 COM2 COM3 COM4 panel number
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
Table Connections between Panels (Continued)
FP10 FP11 FP12 FP13 FP14 FP15 FP16 FP17 FP18 FP19 FP20 FP21 FP22 FP23 FP24 FP25 FP26 FP27 FP28 FP29 FP30 FP31 panel function panel number
Freescale Semiconductor, Inc.
connections between frontplane drivers panel determine segment assignments data registers. Figure illustrates meaning this particular application. There data registers each position display. Each data register represents segment position. Therefore, each table entry stores segment values necessary display given character display. Table shows segment bit-mapping this application.
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Sample Application
Freescale Semiconductor, Inc.
Figure Segment Assignments Table Segment Bit-Mapping
Register LDATn LDATn+1
example, display letter segments need lit. This would require data register values corresponding LDATn LDATn+1 registers. resistor ladder connected VLCD1, VLCD2, VLCD3 pins provide voltage levels waveform. variable resistor ladder allows display contrast adjusted. Figure shows circuit diagram relevant connections display. Common connections (power supply, oscillator, etc.) shown.
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
MC68HC705L16 VLCD3 VLCD2 VLCD1
Freescale Semiconductor, Inc.
FP31
COM1 COM4 PINS
FRONTPLANE PINS TABLE
DIGIT
DIGIT
8-DIGIT PANEL
Figure Connections button switch connected line allows triggering external interrupt. external interrupt, service routine loads next message message block. this application, lookup table specified. size lookup table determined flexibility display. Table shows ASCII value converted offset into lookup table this application.
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Sample Application
Table Lookup Table
Character types Special Numeric Alphabetic ASCII value (decimal) Table offset (decimal) Conversion operation ASCII ASCII ASCII
Freescale Semiconductor, Inc.
Once offset calculated, multiplied because there segment data bytes every character. software also checks invalid values 0-31, 58-64, 91-255 (ASCII decimal). These values invalid because they cannot displayed panel. This application intended simple demonstration scrolling message software, could expanded easily provide more functionality. This method also adapted connection smart module. this case, routine ShowChar would modified display character differently, other program flow would remain same. method connection should affect basic scrolling algorithm.
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note Conclusion
Alternatives Trade-offs
There several methods integrating into microcontroller system. Trade-offs cost, complexity, convenience must considered. Table illustrates advantages disadvantages different implementations.
Freescale Semiconductor, Inc.
Table Connection Methods
Method with on-board hardware drivers glass with software drivers glass MCU, driver chip, glass smart module Advantages Fewer components Reliable output Application flexibility Fewer components Wide range MCUs Less software overhead Wide range MCUs Less software overhead Fewer components Wide range MCUs Disadvantages Requires specialized
More software overhead More components
Higher cost
Software Drivers
most basic method drive display panel through software which generates waveforms. advantages this method: implemented with practically MCU. Costs will minimized.
disadvantage: "Smart" Modules requires much more software overhead.
most convenient method connect "smart" module through serial parallel connection. send command data bytes module with minimum amount software hardware overhead.
AN1743
More Information This Product, www.freescale.com
MOTOROLA
Application Note Conclusion
advantages this method are: easy interface with practically MCU. requires less software hardware overhead.
disadvantages are: This method more expensive. functionality might limited capabilities module.
Freescale Semiconductor, Inc.
Driver
wide variety integrated circuit drivers also available. These components used interface between glass panel. MC68HC705L16 provides practical compromise between cost complexity. advantages using 705L16 include: MC68HC705L16's 16,384 bytes EPROM provide large amount storage code message strings. MC68HC705L16's built-in drivers provide reliable autonomous waveform generation. combined with keypad input, MC68HC705L16 display provide large amount user input output with MCU.
705L16
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
START
INITIALIZE
LOAD INITIAL MESSAGE MSGINDEX MSGSTART
Freescale Semiconductor, Inc.
MAIN LOOP
UPDATE
LOAD MSGINDEX
CALL SHOWSTRING
INCREMENT MSGINDEX
DELAY
Figure Main Program Flow
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Conclusion
SHOWSTRING
LCDREG VARIABLE FIRST DATA REGISTER CLEAR COUNT VARIABLE
NEXTBYTE
Freescale Semiconductor, Inc.
LOAD NEXT ASCII CHARACTER FROM MESSAGE STRING
NEXT BYTE STRING MARKER?
CALL SHOWCHAR
PADDING COUNT
INCREMENT MSGINDEX INCREMENT COUNT
COUNT MAXCHARS?
RESET RESET STRING COUNT MAXCHARS?
INCREMENT COUNT
CALL BLANKSPACE
DONE RETURN
Figure ShowString Subroutine
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
SHOWCHAR
ASCII VALUE CALL CONVERT
CONVERT
TABLE OFFSET
Freescale Semiconductor, Inc.
TRANSFER
SPECIAL CHARACTER?
INVALID CHARACTER?
SEGMENT DATA BYTES FROM TABLE
NUMERIC CHARACTER?
STORE DATA BYTES DATA REGISTERS, POINTED LCDREG
INVALID CHARACTER?
INVALID CHARACTER RETURN OFFSET SPACE CHARACTER
INCREMENT LCDREG
SUBTRACT
SUBTRACT
RETURN
MULTIPLY BYTES ENTRY RETURN TABLE OFFSET
Figure ShowChar Subroutine
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Code Listing
Code Listing
SCROLL.ASM Brad Bierschenk, 03/23/98 Applications Engineering Motorola Software written demonstrate scrolling long text messages across display. This written MC68HC705L16, which provides built-in drive capabilities. used Planar-Standish Model 4228 Multiplex 15-segment, 8-digit panel. (1/4 duty, bias) external interrupt provided button switch IRQ1' selects message displayed. Although this software written 705L16 interface glass, easily modified with smart module serial interface with another MCU. *-$BASE ;Default assembler number base Memory Equates *-RAMSPACE $0040 ;Start user ROMSPACE $1000 ;Start user RESETVEC $FFFE ;Reset vector IRQVEC $FFFA ;IRQ' vector Register Equates Registers MISC ;Miscellaneous register TBCR1 ;Time base control register LCDCR ;LCD control register LCDDR ;First data register location INTCR ;Interrupt control register INTSR ;Interrupt status register locations LCDE SYS0 SYS1
Freescale Semiconductor, Inc.
;LCD enable LCDCR ;SYS0 MISC ;SYS1 MISC
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
IRQ1E IRQ1S IRQ1F RIRQ1 ;IRQ1 enable INTCR ;IRQ1 sensitivity ;IRQ1 flag INTSR ;Reset IRQ1 flag
Equates *-MAXCHARS ;Maximum characters line ;End string marker (ASCII EOT) Variables *-ORG RAMSPACE ;Start user TempX ;Temporary register storage TempA ;Temporary register storage TempData ;Temp storage segment data LCDReg ;8-bit address pointer Count ;Counter variable MsgIndex ;Index counter variable MsgStart ;Stores starting point string Start program code *-ORG ROMSPACE ;Start user EPROM Start BCLR SYS0,MISC ;Setup f_op f_osc/2 BCLR SYS1,MISC #$20 ;XOSC time base TBCR1 ;LCD clock XOSC/128 256Hz BSET LCDE,LCDCR ;Enable BSET IRQ1S,INTCR ;Set edge-level sensitivity BSET IRQ1E,INTCR ;Enable IRQ1 interrupts BSET RIRQ1,INTSR ;Clear IRQ1 flag ;Enable interrupts Initialize string initially displayed. When message desired, same offset, LoadMsg steps should followed. *-LDA #Msg1 ;Load offset desired string LoadMsg ;Initialize message variables Main loop UpdateLCD might many tasks necessary paced-loop structure. more tasks were implemented main loop, delay would adjusted eliminated) provide desired scroll rate. *-AN1743 More Information This Product, www.freescale.com MOTOROLA
Freescale Semiconductor, Inc.
Application Note Code Listing
MainLoop
UpdateLCD #!250 Delay MainLoop
;Update display ;Wait 250ms ;Repeat
SUBROUTINES Initialize message variables desired output string. Register contains offset desired message. *-LoadMsg MsgIndex ;Setup message index MsgStart ;Store start message ;Return
Freescale Semiconductor, Inc.
Update with current portion string displayed. *-UpdateLCD MsgIndex ;Start current index into message ShowString ;Show current portion string MsgIndex ;Increment index ;Return Show current string portion display. When called, register contains index offset. *-ShowString #LCDDR ;First data register LCDReg ;LCDReg First data register Count ;Clear counter variable NextByte Msgs,X ;Load ASCII byte string #EOT ;Check string Padding ;Last character reached ShowChar ;Display character INCX ;Increment index Count ;Increment counter Count ;Check counter #MAXCHARS ;for display length Done ;End display line reached NextByte ;Ready next byte Padding Count ;Pad rest display with spaces #$00 ;See string scrolled display Reset ;Need reset string #MAXCHARS ;Check display Done ;Finished displaying padding spaces Count ;Increment counter BlankSpace ;Put space current display position Padding ;Repeat Reset BlankSpace ;Show final space first position MsgStart ;Load start message index DECX ;Compensate INCX UpdateLCD after MsgIndex ;Record message index Done ;Return
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
ShowChar converts ASCII character value Register offset into character table. bytes offset location table define segment values displaying character display. Then offset offset into data table bytes position store them appropriate data registers. *-ShowChar TempX ;Save register Convert ;Convert ASCII byte into table offset ;Put offset into Table+1,X ;Get second data byte TempData ;Store temporarily Table,X ;Load with first data byte LCDReg ;Point current data register ;Store first byte data register TempData ;Load with second data byte ;Store second data register LCDreg ;Increment LCDreg pointer LCDReg ;point next position's regs. TempX ;Restore register ;Return Convert ASCII character byte offset value into table segment values. software also checks invalid unusable ASCII character value, shows blank space place. Valid ASCII values (decimal): 32-47, 48-57, 65-90. *-Convert #!48 ;Check "special" character Special #!65 ;Check numeric character Numeric Alpha #!90 ;Check invalid value ConvError #!39 ;Convert table offset ConvDone Special #!32 ;Check invalid value ConvError #!32 ;Convert table offset ConvDone Numeric #!57 ;Check invalid value ConvError #!32 ;Convert table offset ConvDone ConvError CLRA ;Invalid value shows blank space ConvDone ROLA ;Multiply offset bytes data position)
Freescale Semiconductor, Inc.
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Code Listing
BlankSpace shows space ($0000) current display position's data registers. *-BlankSpace LCDReg ;Point current data register ;Clear first data byte ;Clear second data byte LCDReg ;Increment LCDreg pointer LCDReg ;point next position's regs. ;Return Delay ~Accumulator*1ms (fop 1MHz) contains number delays desired *-Delay #$00 ;Check remaining delays DDone ;Done? MsDelay ;Call delay routine DECA ;Decrement count Delay ;Repeat DDone ;Return Delay ~1ms (fop 1MHz) *-MsDelay TempA #$5A MsLoop #$00 MsDone DECA MsLoop MsDone TEMPA Interrupt service routine This allows switch IRQ1 switch between message strings. *-ISR MsgStart ;Start current message #Msg1 ;Determine next message Load2 #Msg2 Load3 Load1 #Msg1 ;Load message Load Load2 #Msg2 ;Load message Load Load3 #Msg3 ;Load message Load LoadMsg BSET RIRQ1,INTSR ;Clear IRQ1 flag ;Return AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc. Application Note
Constants *-*-* "Canned" messages Each individual message identified offset into base address labelled Msgs. This limits user bits offset (255 characters worth). more than characters desired messages, some 2-byte variable which contain multiple base addresses. Valid characters 0-9, (UPPERCASE ONLY!), certain special characters defined table valid. *-Msgs ;Base address messages ;-Msg1 *-Msgs ;First message offset MOTOROLA MICROCONTROLLERS ;End text (EOT) marker ;-Msg2 *-Msgs ;Second message offset "SCROLLING MESSAGE DEMONSTRATION" ;End text ;-Msg3 *-Msgs ;Third message offset "705L16 INTERFACE" ;End text ;-EndMsgs *-Msgs ;End messages label
Freescale Semiconductor, Inc.
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Code Listing
Lookup table segment values ASCII character values. Some characters displayed 15-segment LCD, they marked invalid, will displayed blank space. *-Table $0000 $0000 ;'!' INVALID $0201 ;'"' $0000 ;'#' INVALID $A5A5 ;'$' $0000 ;'%' INVALID $0000 ;'&' INVALID $0001 ;''' $000A ;'(' $5000 ;')' $F00F ;'*' $A005 ;'+' $0000 ;',' INVALID $2004 ;'-' $0800 ;'.' $4002 ;'/' $47E2 ;'0' $0602 ;'1' $23C4 ;'2' $2784 ;'3' $2624 ;'4' $21A8 ;'5' $25E4 ;'6' $0700 ;'7' $27E4 ;'8' $27A4 ;'9' $2764 ;'A' $8785 ;'B' $01E0 ;'C' $8781 ;'D' $21E4 ;'E' $2164 ;'F' $05E4 ;'G' $2664 ;'H' $8181 ;'I' $06C0 ;'J' $206A ;'K' $00E0 ;'L' $1662 ;'M' $1668 ;'N' $07E0 ;'O' $2364 ;'P' $07E8 ;'Q' $236C ;'R' $25A4 ;'S' $8101 ;'T' AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc. Application Note
$06E0 $4062 $4668 $500A $9002 $4182 *-Table ;'U' ;'V' ;'W' ;'X' ;'Y' ;'Z' ;End table label
EndTable
Freescale Semiconductor, Inc.
Vector definitions *-ORG RESETVEC ;Reset vector Start IRQVEC ;IRQ vector
AN1743 More Information This Product, www.freescale.com MOTOROLA
Application Note Code Listing
Freescale Semiconductor, Inc.
AN1743 MOTOROLA More Information This Product, www.freescale.com
Freescale Semiconductor, Inc. Application Note
Freescale Semiconductor, Inc.
Motorola reserves right make changes without further notice products herein. Motorola makes warranty, representation guarantee regarding suitability products particular purpose, does Motorola assume liability arising application product circuit, specifically disclaims liability, including without limitation consequential incidental damages. "Typical" parameters which provided Motorola data sheets and/or specifications vary different applications actual performance vary over time. operating parameters, including "Typicals" must validated each customer application customer's technical experts. Motorola does convey license under patent rights rights others. Motorola products designed, intended, authorized components systems intended surgical implant into body, other applications intended support sustain life, other application which failure Motorola product could create situation where personal injury death occur. Should Buyer purchase Motorola products such unintended unauthorized application, Buyer shall indemnify hold Motorola officers, employees, subsidiaries, affiliates, distributors harmless against claims, costs, damages, expenses, reasonable attorney fees arising directly indirectly, claim personal injury death associated with such unintended unauthorized use, even such claim alleges that Motorola negligent regarding design manufacture part. Motorola registered trademarks Motorola, Inc. Motorola, Inc. Equal Opportunity/Affirmative Action Employer.
reach USA/EUROPE/Locations Listed: Motorola Literature Distribution, P.O. 5405, Denver, Colorado 80217, 1-800-441-2447 1-303-675-2140. Customer Focus Center, 1-800-521-6274 JAPAN: Nippon Motorola Ltd.: SPD, Strategic Planning Office, 141, 4-32-1 Nishi-Gotanda, Shinigawa-Ku, Tokyo, Japan. 03-5487-8488 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd., Ping Industrial Park, Ting Road, N.T., Hong Kong. 852-26629298 MfaxTM, Motorola Back System: RMFAX0@email.sps.mot.com; http://sps.motorola.com/mfax/; TOUCHTONE, 1-602-244-6609; Canada ONLY, 1-800-774-1848 HOME PAGE: http://motorola.com/sps/
Mfax trademark Motorola, Inc. Motorola, Inc., 1998
AN1743/D More Information This Product, www.freescale.com

Other recent searches


WNK808A - WNK808A   WNK808A Datasheet
WNK800 - WNK800   WNK800 Datasheet
PIC24 - PIC24   PIC24 Datasheet
dsPIC - dsPIC   dsPIC Datasheet
PE3291 - PE3291   PE3291 Datasheet
J478B - J478B   J478B Datasheet
CZT31C - CZT31C   CZT31C Datasheet
CS5466 - CS5466   CS5466 Datasheet
CD40181BMS - CD40181BMS   CD40181BMS Datasheet
BFG193 - BFG193   BFG193 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive