Hi Taylor, what means R-M-W ?
Follow the LCD pins setting:
Define LCD_DREG PORTD 'set LCD data bus port
Define LCD_DBIT 4 'set data bus start
Define LCD_RSREG PORTD 'set LCD Register Select port
Define LCD_RSBIT 2 'set RS bit
Define LCD_EREG PORTD 'set LCD Enalble port
Define LCD_EBIT 3 'set Enable bit
Define LCD_BITS 4 'set LCD bus size
Define LCD_LINES 4 'set number of lines of LCD
DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
DEFINE LCD_DATAUS 70 ' Set data delay time in us
and for the SPWM
ASM
SPWM_LIST macro ; Define PIN's to use for SPWM
SPWM_PIN PORTB, 5, _DutyVar1 ; RED
SPWM_PIN PORTB, 4, _DutyVar2 ; GREEN
SPWM_PIN PORTB, 3, _DutyVar3 ; BLU
SPWM_PIN PORTB, 2, _DutyVar4 ; WHITE
SPWM_PIN PORTB, 1, _DutyVar5 ; SYNK
endm
SPWM_INIT SPWM_LIST ; Initialize the Pins
ERRORLEVEL -306 ; Avoid Crossing page boundary "Message[306]"
ENDASM
and this is the main loop that work correctly for tree or four seconds, then seems that the display go out of sink and I see scrambled data as for the attached images.
Forever:
Lcdout $fe, $80, "MMMMMMMMMMMMMMMMMMM" ' move cursor to beginning of firt line
Lcdout $fe, $c0, "VVVVVVVVVVVVVVVVVVV" ' move cursor to beginning of second line
Lcdout $fe, $94, "HHHHHHHHHHHHHHHHHHH" ' move cursor to beginning third line
Lcdout $fe, $d4, "YYYYYYYYYYYYYYYYYYY" ' move cursor to beginning of fourth line
hSerout ["|"]
pause 400
Lcdout $fe, $80, "1111111111111111111" ' move cursor to beginning of firt line
Lcdout $fe, $c0, "2222222222222222222" ' move cursor to beginning of second line
Lcdout $fe, $94, "3333333333333333333" ' move cursor to beginning third line
Lcdout $fe, $d4, "4444444444444444444" ' move cursor to beginning of fourth line
pause 400
GOTO Forever
Also I have connected to ground the unused 4 input bit of the Optrex DMC20481 display and added a capacitor between VSS and VDD of the LCD, without visibile effect.
Also consider that I have changed the display with other different brand and the symptom remain the same.
Ciao
Leo
Bookmarks