Help with T6963C and ATMega128

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I have a 128x64 powertip display connected to an ATMega128 through the external memory bus. Its based on the Toshiba T6963C controller and all efforts to make it display at least a blinking cursor have failed.

I've read nearly every document there is available on the internet and forums and nothing has helped. I get the usual black line on reset and i've tried my code on another identical display and no luck yet.

All the appropriate lines are poking up and down but the LCD does not seem to want to respond....not even a change of contrast.

Is it possible that someone can point out my mistakes in the code and put me on the right track please because it is a major part of my university project which needs to be finished by march :?

The code is written in the demo version of CodeVisionAVR and the Mega is working at 1Mhz

Many thanks

Chris.

#include
#include
#include

void write(int addr, char data); // declare the routine to write data to an address
statuscheck();
setup_AVR(); //setup microprocessor
LCD_initialise();

/* START MAIN PROGRAM */
//********************//
void main(void)

{

setup_AVR();
delay_ms(10000);
LCD_initialise();

while (1)
{
LCD_initialise();
delay_ms(1000000);

};

}

//*********************************************

void write(int addr, char data)
{

pokeb(addr,data); // writes the address and the data supplied to it

}

//******************************************

//*******************************************
statuscheck()
{
char c; // Declare Temp variable
char d;
char loop=0; // loop exit variable

do
{
c=peekb(0x1C00); //Read the LCD status at 1C00h
d=c;
c=c&0x03; // Mask the first two relevant bits

if (c==0x03)
{
loop=1;
};
}
while(loop==0);
PORTF=d;
}
//*******************************************

setup_AVR()
{

MCUCR=0x80; //XMEM ENABLE
// No wait states

// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTA=0x00;
DDRA=0x00;

// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTB=0x00;
DDRB=0x00;

// Port C initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTC=0x00;
DDRC=0x00;

// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0x00;

// Port E initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTE=0x20;
DDRE=0x20;

// Port F initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTF=0x00;
DDRF=0xFF;

// Port G initialization
// Func4=In Func3=In Func2=In Func1=In Func0=In
// State4=T State3=T State2=T State1=T State0=T
PORTG=0x00;
DDRG=0x00;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
ASSR=0x00;
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// OC1C output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
OCR1CH=0x00;
OCR1CL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// Timer/Counter 3 initialization
// Clock source: System Clock
// Clock value: Timer 3 Stopped
// Mode: Normal top=FFFFh
// Noise Canceler: Off
// Input Capture on Falling Edge
// OC3A output: Discon.
// OC3B output: Discon.
// OC3C output: Discon.
TCCR3A=0x00;
TCCR3B=0x00;
TCNT3H=0x00;
TCNT3L=0x00;
ICR3H=0x00;
ICR3L=0x00;
OCR3AH=0x00;
OCR3AL=0x00;
OCR3BH=0x00;
OCR3BL=0x00;
OCR3CH=0x00;
OCR3CL=0x00;

// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
// INT3: Off
// INT4: Off
// INT5: Off
// INT6: Off
// INT7: Off
EICRA=0x00;
EICRB=0x00;
EIMSK=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
ETIMSK=0x00;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

}

LCD_initialise()
{
//******************
//Text Home Address Set
//******************
statuscheck();
write(0x1400, 0x80);

statuscheck();
write(0x1400,0x07);

statuscheck();
write(0x1C00, 0x40);

//******************
//Text Area Set
//******************
statuscheck();
write (0x1400, 0x10);

statuscheck();
write(0x1400, 0x00);

statuscheck();
write(0x1C00, 0x41);

//******************
//Set Graphics Home Address
//******************
statuscheck();
write(0x1400, 0x00);

statuscheck();
write(0x1400, 0x00);

statuscheck();
write(0x1C00, 0x42);

//******************
//Set Graphics Area
//******************
statuscheck();
write(0x1400, 0x10);

statuscheck();
write(0x1400, 0x00);

statuscheck();
write(0x1C00, 0x43);

//******************
//Set Mode
//******************
statuscheck();
write(0x1C00, 0x81);

//******************
//Address Pointer Set
//******************
statuscheck();
write(0x1400, 0x00);

statuscheck();
write(0x1400, 0x00);

statuscheck();
write(0x1C00, 0x24);

//******************
//Display Mode Set
//******************

statuscheck();
write(0x1C00, 0x98);

}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simple example code (test program) using MEGA16/32 and T6963 can be found http://www.metsys.fi/ana/image/m..., LCD is connected to MEGA16 port C (data) and port D (defined beginning of program), so program uses different technique, but its quite easy to follow what and when you have to send to T6963 to get it working.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for the code. I followed the example to the last word and still no use. again, the appropriate lines are working.

One thing that did cross my mind....does anyone know what voltage (either positive or negative) that has to be applied to Vo of this device?

http://www.powertip.com.tw/produ...
currently, its being supplied with under 5 volts.

??

Chris.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for the code. I followed the example to the last word and still no use. again, the appropriate lines are working.

One thing that did cross my mind....does anyone know what voltage (either positive or negative) that has to be applied to Vo of this device?

http://www.powertip.com.tw/produ...
currently, its being supplied with under 5 volts.

??

Chris.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had a problem with a T6963 LCD regarding voltage. The negative voltage generator from the board was not working properly (or I missed some information from the reduced data available from the datasheet), so I should supply about -13 volts respect to GND (with an external Power Supply from my lab). Adjusting this voltage, I had adjusted the contrast, and It was within an small gap. Once I had that, everything goes fine.

Vcc to GND should be between 4.5V and 5.5V. So 5V is ok.

Have luck.

Guillem.

Guillem.
"Common sense is the least common of the senses" Anonymous.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried to steal -10v from the max232, but it wasnt quite negative enough. Taping an AA battery onto the line did the trick. What a wierd solution.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used Winstar WG12864G display where is negative voltage geneartor and 10 k trimmer to set contrast voltage. Winstar datasheet said VDD-Vo = 9,6 V (Vo = negative). Your data sheet dont tell much about Vop, but I think it should be negative, maybe somebody else knows better.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for the advice. i'll give it a try with a negative voltage on the Vo line w.r.t. ground and let u all know.

i just find it strange that the display is advertised 'operates on a single 5v supply'. It was bought from RS mind you.

The device has two LC7940N 4NR2 chips (not a clue what it is), one LC7942N 3YR0 chip (still not a clue), the controller and 32k of SRAM onboard. I cant see a charge pump IC anywhere. come to think of it..there's two capacitors on the board which are both decoupling so i very much doubt there's a negative voltage anywhere in that circuit.

thanks for the advice.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have code to drive a t6963 from 2 ports on a mega32 using imagecraft iccavr, and it took me a long time to get it to work... prob turned out to be the 'font select' pin that lets you pick 5x7 or 6x8 text in text mode also fiddles with the graphics width in graphics mode.. my test that drew a 128x64 box with an X thru it went from 128 pix to about 100 pix wide because I had left that pin floating. Want to look at it?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The device has two LC7940N 4NR2 chips (not a clue what it is), one LC7942N 3YR0 chip (still not a clue), the controller and 32k of SRAM onboard.

Winstar uses same chips (LC7940N 4RR9 and LC7942 3YSL), negative voltage generator is HT7660

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I measured contrast voltages from Winstar WG12864G:
0 ... -2,6 V no visible chars
-2,5 ...-3,6 good contrast
-3,6 ... -4,8 bad contrast
Max generated voltage is -4,8 V

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you need to generate negative voltages, you can use a free PWM from you'r uC and control contrast this way. Also you can use a 555. All this plus some diodes and caps and yo have a capacitor pump with a very low consumption.

In my case, I use the lab power supply, since I was only evaluating the display with the STK500 and an ATmega16.

Guillem.

Guillem.
"Common sense is the least common of the senses" Anonymous.