User manual
mikroC PRO for dsPIC
MikroElektronika
587
unsigned char panel; // Current panel
unsigned int i; // General purpose register
unsigned char curs; // Cursor visibility
unsigned int cposx, cposy; // Cursor x-y position
#dene COMPLETE_EXAMPLE // comment this line to make simpler/smaller example
ADPCFG = 0xFFFF;
TRISB0_bit = 1; // Set RB0 as input
TRISB1_bit = 1; // Set RB1 as input
TRISB2_bit = 1; // Set RB2 as input
TRISB3_bit = 1; // Set RB3 as input
TRISB4_bit = 1; // Set RB4 as input
// If Port Expander Library uses SPI1 module
SPI1_Init(); // Initialize SPI module used with PortExpander
// // If Port Expander Library uses SPI2 module
// SPI2_Init(); // Initialize SPI module used with PortExpander
/*
* 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
*/
SPI_T6963C_Cong(240, 128, 8, 0, 2, 1, 0, 4);
Delay_ms(1000);
/*
* Enable both graphics and text display at the same time
*/
SPI_T6963C_graphics(1);
SPI_T6963C_text(1);
panel = 0;
i = 0;
curs = 0;
cposx = cposy = 0;
/*
* Text messages
*/
SPI_T6963C_write_text(txt, 0, 0, SPI_T6963C_ROM_MODE_XOR);
SPI_T6963C_write_text(txt1, 0, 15, SPI_T6963C_ROM_MODE_XOR);