hemnath
Advanced Member level 3
- Joined
- Jun 24, 2012
- Messages
- 702
- Helped
- 61
- Reputation
- 120
- Reaction score
- 57
- Trophy points
- 1,308
- Location
- Chennai
- Activity points
- 6,589
Hi, i dont get any answers for my previous thread. thats y i have created this new thread.
sample code:
nothing on the display .Please help
sample code:
HTML:
#include "18F2520.h"
#fuses INTRC_IO // Internal oscillator
#use delay(clock = 1000000) // 1Mhz clock
// PIN Definitions
#define A0 PIN_B3
#define CS1 PIN_B4
#define CS2 PIN_B5
#define R_W PIN_C0
#define RST PIN_C1
const unsigned char data[] = {0x00, 0x00, 0xE7, 0xE7, 0xE7, 0xE7, 0x00, 0x00}; // invert of H
// Function definitions
void glcd_data(unsigned char z);
void glcd_cmd(unsigned char c);
unsigned int i,j;
void main()
{
output_high(CS1); // CS1 = 1
output_high(CS2); // CS2 = 1
output_high(RST); // RESET = 1
output_low(R_W); // Write mode
glcd_cmd(0xe2); //software Reset
glcd_cmd(0xAF);
glcd_cmd(0xc0); //Set Start Line 0(C0H)~31(DFH)
glcd_cmd(0xa4); //Static Drive OFF
glcd_cmd(0xa9); //Select Duty = 1 /32
glcd_cmd(0xa0); //Select ADC = 0
glcd_cmd(0xEE);
glcd_cmd(0xb8); //Set Page Address 0(B8H)~3(BBH)
glcd_cmd(0x00); //Set segment Address 0(00H)~(4FH)
glcd_cmd(0xaf); //Set Display ON
while(1)
{
glcd_cmd(0xC0); // display start line
glcd_cmd(0xB8); // Page address
for(j = 0; j < 64; j = j+8)
{
// glcd_cmd(66 + j);
for(i = 0; i < 8; i++)
{
glcd_data(data[i]);
}
}
}
}
void glcd_cmd(unsigned char c)
{
output_low(A0); // Command mode
output_high(CS1);
output_high(CS2);
output_a(c); //
output_low(CS1);
output_low(CS2);
}
void glcd_data(unsigned char z)
{
output_high(A0); // Data mode
output_high(CS1);
output_high(CS2);
output_a(z); //
output_low(CS1);
output_low(CS2);
}
nothing on the display .Please help