Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Giant font function for GLCD 128x64 (OshonSoft Basic)

DogFlu66

Member
I leave the function to generate giant characters on a 128x64 GLCD.

Code:
'Giant characters function for GLCD 128x64.
'***********************************************************
'Pic18F46k22, OshonSoft Pic18 Basic Compiler v8.42
'By COS, 02/2023
'***********************************************************
#define CONFIG1L = 0x00
#define CONFIG1H = 0x28
#define CONFIG2L = 0x1e
#define CONFIG2H = 0x28
#define CONFIG3L = 0x00
#define CONFIG3H = 0x3f
#define CONFIG4L = 0x80
#define CONFIG4H = 0x00
#define CONFIG5L = 0x0f
#define CONFIG5H = 0xc0
#define CONFIG6L = 0x0f
#define CONFIG6H = 0xe0
#define CONFIG7L = 0x0f
#define CONFIG7H = 0x40
'***********************************************************
#define CLOCK_FREQUENCY = 64  'Clock 64Mhz
Define STRING_MAX_LENGTH = 30
Define SIMULATION_WAITMS_VALUE = 1
'***********************************************************
Include "_FuncionesPic18F46K22.bas"
Include "_FuncionGlcdBigFont.bas"
'***********************************************************
MAIN:
    'Clock internal 64Mhz.
    Call _setup_oscillator(_osc_16mhz_hf)
    Call _setup_oscillator_mode(_primary_clock)
    Call _set_pll4(_pll_on)
    Call _interrupts_mode(_disable_priority)
    '*********************************************************
    'PCB configuration
    AllDigital
    TRISA = 0x00
    TRISB = 0x00
    TRISC = 0x00
    TRISD = 0x00
    TRISE = 0x00
    'Configure puerto GLCD
    Define GLCD_DREG = PORTD
    Define GLCD_RSREG = PORTB
    Define GLCD_RSBIT = 4
    Define GLCD_EREG = PORTB
    Define GLCD_EBIT = 5
    Define GLCD_RWREG = PORTB
    Define GLCD_RWBIT = 3
    Define GLCD_CS1REG = PORTB
    Define GLCD_CS1BIT = 1
    Define GLCD_CS2REG = PORTB
    Define GLCD_CS2BIT = 2
    ConfigPin RB0 = Output
    Symbol GLCD_RESET = RB0
    GLCD_RESET = 0
    WaitMs 10
    GLCD_RESET = 1
    GLcdinit  'Initialize Glcd
    '*********************************************************
    'Assign names to the Leds
    Symbol Ledgreen = LATC.0
    Symbol LedOrange = LATC.1
    Symbol LedRed = LATC.2
    Symbol backlight = LATE.2
    '**********************************************************
    Dim _High As Byte
    Dim _Width As Byte
    Dim x As Byte
    Dim y As Byte
    Dim number As Word
    Dim _String As String

    Ledgreen = 0
    LedOrange = 1
    LedRed = 0

    _String = "THE END"
    number = 0

    _High = 4
    _Width = 2

    WaitMs 3000  'Delay in mSec.
  
    x = _glcdwritebig("Number:", 7 * 2, 0, 2, 1)  'Write text
  
    While True
  
        Call _glcdwritebig(#number, 0, x, _High, _Width)  'Write text (number)
      
        number++  'Increase number
      
        If number > 15 Then  'If finish counting Stop
            Call _glcdwritebig(_String, 56, 40, 1, 1)
            While True  'Infinite loop
            Wend
        Endif
        WaitMs 500  'Delay in mSec.
      
    Wend
End

Video:
 

Attachments

  • BigFontGLCD128x64.jpg
    BigFontGLCD128x64.jpg
    38.9 KB · Views: 150
  • _FuncionGlcdBigFont.bas
    10.4 KB · Views: 168
  • _FuncionesPic18F46K22.bas
    32.8 KB · Views: 153
Last edited:
I presume you are aware that the Nokia 5110 IS a graphics screen?.
Hi N,
Thanks for reminding me, that the 5110 is a graphics screen, I'm used to it as only text, though.
I was thinking of this type:
C
 
Hi N,
Thanks for reminding me, that the 5110 is a graphics screen, I'm used to it as only text, though.
I was thinking of this type:
C
No text on a 5110 - it's graphics only, and you have to draw the text yourself, including providing the font :D

The TFT screens are a lot more complicated, and use much more memory - you've also got zero hope of a screen buffer, which is what you usually use on the 5110.
 
No text on a 5110 - it's graphics only, and you have to draw the text yourself, including providing the font :D

The TFT screens are a lot more complicated, and use much more memory - you've also got zero hope of a screen buffer, which is what you usually use on the 5110.
Hi N,
Yes, back around 2017 E wrote me CODE for this very thing, so somehwere here you'll find it all.
Start with: https://forum.allaboutcircuits.com/...l-by-location-pic-in-oshonsoft.148795/page-16 #318
C.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top