User manual
502
mikoBasic PRO for PIC32
MikroElektronika
  txt2 as string[21]
main:
 #DEFINE COMPLETE_EXAMPLE
 #DEFINE LINE_DEMO ‘ Uncomment to demonstrate line drawing routines
 #DEFINE FILL_DEMO ‘ Uncomment to demonstrate ll routines
 #DEFINE PARTIAL_IMAGE_DEMO ‘ Uncomment to demonstrate partial image routine
 txt1 = “ EINSTEIN WOULD HAVE LIKED mE”
 txt = “ GLCD LIBRARY DEMO, WELCOME !”
 txt2 = “ Partial image demo! “
 CHECON = 0x32
 AD1PCFG = 0xFFFF  ‘ initialize AN pins as digital
 TRISB8_bit = 1 ‘ Set RB8 as input
 TRISB9_bit = 1  ‘ Set RB9 as input
 TRISB10_bit = 1  ‘ Set RB10 as input
 TRISB11_bit = 1 ‘ Set RB11 as input
 TRISB12_bit = 1 ‘ Set RB12 as input
 TRISB13_bit = 1 ‘ Set RB13 as input
 panel = 0
 i = 0
 curs = 0
 cposx = 0
 cposy = 0
 ‘ If Port Expander Library uses SPI1 module
 ‘ Initialize SPI module used with PortExpander
    SPI2_Init_Advanced(_SPI_MASTER,_SPI_8_BIT,  4,  _SPI_SS_DISABLE,_SPI_DATA_SAMPLE_
MIDDLE,_SPI_CLK_IDLE_LOW,_SPI_ACTIVE_2_IDLE)
 ‘ If Port Expander Library uses SPI2 module
  ‘ SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, _SPI_PRESCALE_SEC_1, _SPI_PRESCALE_PRI_4, 
_SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_IDLE_2_ACTIVE)
‘ * init display for 240 pixel width and 128 pixel height
‘ * 8 bits character width
‘ * data bus on MCP23S17 portB
‘ * control bus on MCP23S17 portA
‘ * bit 2 is !WR
‘ * bit 1 is !RD
‘ * bit 0 is !CD
‘ * bit 4 is RST
‘ * chip enable, reverse on, 8x8 font internaly set in library
‘ Initialize SPI Toshiba 240x128
 SPI_T6963C_Cong(240, 128, 8, 0, 2, 1, 0, 4)
 Delay_ms(1000)
‘ * Enable both graphics and text display at the same time










