I've isolated the problem is somewhere within the "show" call. Not sure what it is, but that's definitely the issue. Also, I'm not totally convinced FILLRECT works properly either. DRAWRECT definitely works better for me.
Troy
I've isolated the problem is somewhere within the "show" call. Not sure what it is, but that's definitely the issue. Also, I'm not totally convinced FILLRECT works properly either. DRAWRECT definitely works better for me.
Troy
post your code and i will have a look
it works ok for me
https://youtu.be/Jxd4a4XmuDo
Code:'**************************************************************** '* Name : UNTITLED.BAS * '* Author : richard * '* Notice : Copyright (c) 2022 caveat emptor * '* : All Rights Reserved * '* Date : 11/10/2022 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** #CONFIG CONFIG FOSC = INTIO67 CONFIG PLLCFG = ON CONFIG PRICLKEN = ON CONFIG FCMEN = OFF CONFIG IESO = OFF CONFIG PWRTEN = ON CONFIG BOREN = SBORDIS CONFIG BORV = 190 CONFIG WDTEN = OFF CONFIG WDTPS = 32768 CONFIG CCP2MX = PORTC1 CONFIG PBADEN = OFF CONFIG CCP3MX = PORTB5 CONFIG T3CMX = PORTC0 CONFIG HFOFST = ON CONFIG P2BMX = PORTB5 CONFIG MCLRE = EXTMCLR CONFIG STVREN = ON CONFIG LVP = OFF CONFIG XINST = OFF CONFIG DEBUG = OFF CONFIG CP0 = OFF CONFIG CP1 = OFF CONFIG CP2 = OFF CONFIG CP3 = OFF CONFIG CPB = OFF CONFIG CPD = OFF CONFIG WRT0 = OFF CONFIG WRT1 = OFF CONFIG WRT2 = OFF CONFIG WRT3 = OFF CONFIG WRTC = OFF CONFIG WRTB = OFF CONFIG WRTD = OFF CONFIG EBTR0 = OFF CONFIG EBTR1 = OFF CONFIG EBTR2 = OFF CONFIG EBTR3 = OFF CONFIG EBTRB = OFF #ENDCONFIG DEFINE OSC 64 DEFINE DEBUG_REG PORTB DEFINE DEBUG_BIT 7 DEFINE DEBUG_BAUD 9600 DEFINE DEBUG_MODE 0 LATB.7=1 #DEFINE colours 1 ;1 mono 2 rg or 3 rgb width con 128 ; height con 64 ; 'use serial i/f #define stserial 1 include "grx.pbpMOD" include "st7920.pbpmod" include "font.bas" include "bignum.bas" include "bigchr.bas" BUFF VAR BYTE[32] OSCCON=$70 OSCTUNE.6=1 while ! osccon2.7 :WEND ;wait for pll ANSELB=0 ANSELC=0 ANSELA=0 ' serial spi pins used ' e is sck latc.3 ' rw is sdo latc.5 ' rs is cs latc.1 'trisc = %11010101 ;cs,sck,sdo are output trisc = %11010101 ;cs,sck,sdo are output TRISB = %11111111 TRISA = %11111111 n var word gosub st7920_init 'graphic mode OSCCON=$70 OSCTUNE.6=1 while ! osccon2.7 :WEND ;wait for pll ANSELB=0 ANSELC=0 ANSELA=0 Pause 500 ' LCD initialize time lcdout $FE,1 gosub st7920_init 'graphic mode gosub grf_clr n=0 SETFONT bignum bgcolour=0 main: n= n+1 colour=1 fillrect 39,29,46,16 ; this is a guess about your font size ARRAYWRITE BUFF,[dec4 n,0] DMDSTR 40,30, Buff,0 colour=0 fillrect 39,9,46,16 ; this is a guess about your font size DMDSTR 40,10, Buff,1 gosub show pause 1000 goto main
Warning I'm not a teacher
Damn, maybe its my display modules. Your latest code doesn't appear to work properly either on mine.
So close... everything appears to display correctly* but craps itself after a few screen redraws
Troy
*with the exception of FILLRECT
i fiddle with the files to suit other projects maybe what you have is out of date
Warning I'm not a teacher
No luck. There is something I should've mentioned though: in post #31 you list the pin connections:
for a 26k22 i used
'spi pins used
'st7920_rst var latc.0
st7920_cs var latc.1
'st7920_sck is latc.3
'st7920_sdi is latc.4
'st7920_sdo is latc.5
Now, I don't have "st7920_sdi is latc.4" connected because I have no idea what to connect it to. Could that be the killer?
Troy
no it has no connection , but its best not to try and use that pin for other purposes the mssp module owns it
the only other conn i have is psb is grounded
are you using my exact code ?
Warning I'm not a teacher
Yeah, started out with the exact code, those latest graphics and LCD controller files and then (after running that) started tweaking the demo code in an attempt to get something working. Can post a video of the output if that helps or happy to send you a module if you're interested in trying one. I've ordered another flavour of st7920 controlled displays from China, so fingers crossed it's better behaved.
Troy
Bookmarks