Carrying on with what Art mentioned previously.
I looked pretty closely at the LCD controller and can not find away to disable the line wrapping when you use a shift command.
Looks like that is the way the controller works.
That being said I put together this program that will shift the message from Right to Left.
See if this helps.
Code:'**************************************************************** '* Name : LCDScroll_v1.pbp * '* Author : TABSoft * '* Notice : Copyright (c) 2015 TABSoft * '* : All Rights Reserved * '* Date : 2/6/2015 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** '*****PIC MCU Configuration Fuses (MPASM)***** #IF __PROCESSOR__ = "18F4620" #CONFIG CONFIG OSC = ECIO6 ; EC oscillator, port function on RA6 ;CONFIG OSC = INTIO67 ; Internal oscillator block, port function on RA6 and RA7 ;CONFIG WDT = OFF ; WDT disabled (control is placed on the SWDTEN bit) CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor disabled CONFIG IESO = OFF ; Oscillator Switchover mode disabled CONFIG PWRT = OFF ; PWRT disabled CONFIG BOREN = SBORDIS ; Brown-out Reset enabled in hardware only (SBOREN is disabled) CONFIG BORV = 3 ; Minimum setting CONFIG WDT = ON ; WDT enabled CONFIG WDTPS = 512 ; 1:512 CONFIG CCP2MX = PORTC ; CCP2 input/output is multiplexed with RC1 CONFIG PBADEN = OFF ; PORTB<4:0> pins are configured as digital I/O on Reset CONFIG LPT1OSC = OFF ; Timer1 configured for higher power operation CONFIG MCLRE = ON ; MCLR pin enabled; RE3 input pin disabled CONFIG STVREN = ON ; Stack full/underflow will cause Reset CONFIG LVP = OFF ; Single-Supply ICSP disabled CONFIG XINST = OFF ; Instruction set extension and Indexed Addressing mode disabled (Legacy mode) CONFIG DEBUG = OFF ; Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins CONFIG CP0 = OFF ; Block 0 (000800-003FFFh) not code-protected CONFIG CP1 = OFF ; Block 1 (004000-007FFFh) not code-protected CONFIG CP2 = OFF ; Block 2 (008000-00BFFFh) not code-protected CONFIG CP3 = OFF ; Block 3 (00C000-00FFFFh) not code-protected CONFIG CPB = OFF ; Boot block (000000-0007FFh) not code-protected CONFIG CPD = OFF ; Data EEPROM not code-protected CONFIG WRT0 = OFF ; Block 0 (000800-003FFFh) not write-protected CONFIG WRT1 = OFF ; Block 1 (004000-007FFFh) not write-protected CONFIG WRT2 = OFF ; Block 2 (008000-00BFFFh) not write-protected CONFIG WRT3 = OFF ; Block 3 (00C000-00FFFFh) not write-protected CONFIG WRTC = OFF ; Configuration registers (300000-3000FFh) not write-protected CONFIG WRTB = OFF ; Boot Block (000000-0007FFh) not write-protected CONFIG WRTD = OFF ; Data EEPROM not write-protected CONFIG EBTR0 = OFF ; Block 0 (000800-003FFFh) not protected from table reads executed in other blocks CONFIG EBTR1 = OFF ; Block 1 (004000-007FFFh) not protected from table reads executed in other blocks CONFIG EBTR2 = OFF ; Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks CONFIG EBTR3 = OFF ; Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks CONFIG EBTRB = OFF ; Boot Block (000000-0007FFh) not protected from table reads executed in other blocks #ENDCONFIG #else #ERROR "This program requires a PIC 18F4620 MCU" #endif OSCCON = $60 ' Set PIC to 4Mhz & ECIO Clock Mode DEFINE OSC 4 ADCON0.0 = 0 ' A/D Converter module is disabled ADCON1 = $0F ' %0000 1111 AN2=VSS, AN3=VDD, AN12-0 = Digital ADCON2 = $00 ' %0000 0000 TRISB = %11111111 ' Set PORTB as input INTCON2.7 = 0 ' Enable PORTB pullups TRISC = TRISC & %11011111 ' Set PORTC pin directions (pin5 output to RTC VCC2) '*****Define LCD registers and bits***** define LCD_BITS 4 '8 '4 define LCD_LINES 2 ' Set to number of lines for the LCD Define LCD_DREG PORTD Define LCD_DBIT 4 '0 '4 Define LCD_RSREG PORTE Define LCD_RSBIT 0 Define LCD_EREG PORTE Define LCD_EBIT 1 define LCD_RWREG PORTE define LCD_RWBIT 2 define LCD_COMMANDUS 1500 define LCD_DATAUS 44 ' ' Software Constants ' LastLCDCol con 19 ' number of Columns in your LCD ' ' Software variables ' LCD_Line1 var byte [50] 'Array to hold the Line 1 LCD Message (0 to 49) L1_ArrayLen var byte 'Length of LCD Line 1 Message Array StartPos var byte 'Pointer to start of message in Array idx var byte 'Current index into Message Array MaxCount var byte 'Loop counter max number LoopCount var byte 'Loop Counter i var byte '*****Intialize Variables***** L1_ArrayLen=50 '*****Initialize LCD Line 1 Message Array***** arraywrite LCD_Line1, ["This is a test of the scrolling text screen...... "] '*****Initialize LCD***** Low LATE.2 ' LCD R/W line low (W) Pause 500 ' Wait .5 second for LCD to Initialize ' ' Program ' mainloop: MaxCount = 81 LoopCount = 0 StartPos = 0 do lcdout $FE, $80 LoopCount = LoopCount + 1 for i = 0 to LastLCDCol idx = StartPos + i if idx > (L1_ArrayLen - 1) then idx = (idx // L1_ArrayLen) endif lcdout LCD_Line1(idx) next i StartPos = StartPos + 1 if StartPos > (L1_ArrayLen - 1) then StartPos = 0 endif pause 500 'Adjust for best scrolling appearance loop while LoopCount < MaxCount pause 250 goto mainloop 'Do it forever end 'Got here by mistake




Bookmarks