User manual

492
mikoPascal PRO for PIC32
MikroElektronika
begin
{$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
{*
* 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
*}
// If Port Expander Library uses SPI2 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);
{*
* 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_Cong(240, 128, 8, 0, 2, 1, 0, 4);
//Delay_ms(1000);