LCD 240x64 T6963 & Atmega32 DIP

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

Hello,
I have decided to dust off my books and back into the hobby game.
I am using
a used Hantronics 240x64 LCD,
wired to a Atmega32 DIP, PORT B is 8-bit Data&Command, PORT C is Control using first 5 bits; all NOT: RD, WR, CD, CE and RST.
Atmel Studio 6.1 updated.

I am writing in C and learning it. My goal is to use them both and understand them.
So a Newbie to Studio, Atmega32 & all computer languages.
I have succeeded through SuperBlinky.

I am clearly not understanding what command is used to show one character.
Right now one character is my goal in text only to the LCD.
Right now I am hoping only to send commands for text and avoid graphics commands if at all possible.
I have searched and downloaded data sheets, examples and libraries.
A lot with great information that I was able to learn something from.

If someone could assist me with information or direction to understand a command or sequence of commands that will allow one character in text to be displayed.

Please ask me questions for clarity. I hope someone can help. :cry:

Attachment(s): 

This topic has a solution.
Last Edited: Thu. Jan 30, 2014 - 07:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

240x64 seems an unusual size. You will probably find lots of ready made projects for 128x64. Try them. They should display something.
In fact, CodeVision has library support for your exact module. The Evaluation version comes with some examples built for 240x64 and ATmega128. You need the full licence to use the library with your own code.

The T6963 has an inbuilt font. So you can write text very simply. Of course variable-width fancy fonts require graphics commands.

David.

p.s. If you post your exact PORT connections, I could compile the example for your mega32. And email the HEX file to you.

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

Thank you David for your response.
I have seen a lot of code with great examples. Being a newbie I am looking for the understanding of the command / commands that it takes to display only text and also can the display be set up to only display text. At that point I believe I would be well on the way to play with the other commands and may need to come back to avrfreaks for other answers.

I was not able to figure out how to send the image to the post so I created a PDF of the file and added it to the post.

The code is at home and will not be able to show you right now till I get there to post.

I would be willing to give the HEX code a trying.

Is the PDF in the post helpful to you?

David, Thanks Again

Randy

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

Quote:
Is the PDF in the post helpful to you?

With a lot of effort, I have had to download PDF, magnify it etc. Just so that I could get:

DB0-DB7 = PB0-PB7
/RD = PC0
/WR = PC1
DC = PC2
/CE = PC3
/RES = PC4

Seriously, it is a lot more helpful to just type the connection details in a regular message.

Anyway, I have built the CV "Full Demo" for your ATmega32. Note that you need to disable JTAGEN fuse.

If you have a full CV licence, I could post you source code. If you only have the Evaluation CV, you would have to use avr-gcc.

David.

Attachment(s): 

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

Here is the AVR pin layout for a Mega164 app that used a T6963-based LCD. In the end, I don't know if all the functionality of the connected pins was used.

//=============================================================================
// PORTS (Mega164 Function)
//-----------------------------------------------------------------------------
//	PIN	Mega164 USE		DIR	INIT	DESCRIPTION
//	===	===========		===	====	===========
//
// PA.7 (ADC7)			In	(+)		Membrane keypad, Col 3 (SW3-SW6-SW9-SW12)
// PA.6 (ADC6)			In	(+)		Membrane keypad, Col 2 (SW2-SW5-SW8-SW11)
// PA.5 (ADC5)			In	(+)		Membrane keypad, Col 1 (SW1-SW4-SW7-SW10)
// PA.4 (ADC4)			In	(+)		Membrane keypad, Row 4 (SW10-SW11-SW12)
// PA.3 (ADC3)			In	(+)		Membrane keypad, Row 3 (SW7-SW8-SW9)
// PA.2 (ADC2)			In	(+)		Membrane keypad, Row 2 (SW4-SW5-SW6)
// PA.1 (ADC1)			In	(+)		Membrane keypad, Row 1 (SW1-SW2-SW3)
// PA.0 (ADC0)			In	(z)		Supply voltage monitor, A/D (24VDC raw, divided 18.2k/2.0k)

// PB.7 (SCK)			Out	(0)		SPI to DS1305 RTC
// PB.6 (MISO)			In	(z)		SPI to DS1305 RTC
// PB.5 (MOSI)			Out	(0)		SPI to DS1305 RTC, AD7376 digital pot
// PB.4 (!SS/OC0B)		Out	(0)		DS1305 RTC CE
// PB.3 (AIN1/OC0A)		Out	(1)		AD7376 digital pot (contrast control) /RS
// PB.2 (AIN0/INT2)		Out	(1)		AD7376 digital pot (contrast control) /CS
// PB.1 (CLKOT1)		Out	(1)		AD7376 digital pot (contrast control) /SHDN
// PB.0 (XCK0/T0)		Out	(0)		LCD COL (high=32; low=40)

// PC.7 (TOSC2)			In/Out		LCD DB7
// PC.6 (TOSC1)         In/Out      LCD DB6
// PC.5 (TDI)			In/Out      LCD DB5
// PC.4 (TDO)			In/Out      LCD DB4
// PC.3 (TMS)			In/Out      LCD DB3
// PC.2 (TCK)			In/Out      LCD DB2
// PC.1 (SDA)			In/Out      LCD DB1
// PC.0 (SCL)			In/Out      LCD DB0

// PD.7 (OC2A)			Out	(1)		LCD /WR
// PD.6 (ICP/OC2B)		Out	(0)		MOTOR driver PWM system output
// PD.5 (OC1A)			Out	(0)		LCD BACKLIGHT PWM system output
// PD.4 (XCK1/OC1B)		Out	(0)		LCD Font size select, 1=6; 0=8 (pixels wide)
// PD.3 (TXD1/INT1)		Out	(1)		LCD /RESET
// PD.2 (RXD1INT0)		Out	(1)		LCD CD (high=Command; low=Data)
// PD.1 (TXD0)			Out	(1)		LCD /CE
// PD.0 (RXD0)			Out	(1)		LCD /RD

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

I looked at the "driver" code. I put no attribution in my source file, so I'd guess it was "freeware", or constructed myself from readily-available code on the Web. I can post it if desired. It looks pretty straightforward.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Thanks David,
Sorry about having you have to go through all that.
I will pay attention to what people are asking for, and not make it any harder than it has to be.

I have never heard of Code Vision or used it. After doing a search for code vision some of the titles has avr. I would not know how to download it. I guess what I will do is go to YouTube and see what they say about that. YouTube has been a good source for information at directions. That is where I found some information about programming the t6963 by toshiba.

I will see what happens with the display with your hex file.

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

Thanks theusch for the pinouts.

I have all that figured out and wired to the LCD.

At this point my ignorance is with understanding the data sheet telling me when the character will be displayed and what command I need to use to display the character.

The data sheet is crazy. There are all kinds of commands to send to the display and always having to perform a status check routine before the LCD will read/write data to/from the data lines.

Then the other thing is that you may have to send one or two data writes for a command to be sent each data check will have to have a status check.
No big deal. Right now it is just a lot to absorb right now.

Like I said I would like to know how to use this display in TEXT Mode and not in Graphics.
If there is a way to set the display to only work in Text, all help is appreciated.

I have spoke to a Greenhouse controller engineer that designed a controller for a company that has been around for about 50 years.
The display that I am using, he uses as well. He was saying he does not do any status checks to see if the LCD is busy. He said the CPU 8088 runs slow enough that a status check is senseless. Interesting enough the controller works fine and he has rolled out two other models with the same display and CPU.
Here is the big kicker, he has written all the programs in F. I really do not even have the desire to look at that. It sounds like a dinosaur nightmare.

If you have any of the code in C that would be great if you could send it my way. If it has a lot of ASM code in there, it would be no use for me.
My goal is to use C and C++ and learn the Atmel processor.

All help is greatly appreciated.

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

Just burn the HEX file to your ATmega32.

The Example program will show what the Display is capable of.

From memory, the driver function is only about 8 lines of C.
Yes, you always check the Status. It costs you 1 line of C.

I have no idea what F is. Nor can I see the sense in writing for an 8088.

Also from memory, writing bog-standard text with the inbuilt 8x6 Font is trivial. I would have to look up some old programs and read the data sheet.

Quite honestly, you just need to install a respected library and learn how to use it. After all, you will end up wanting to have an attractive display that uses a few graphics features.

David.

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

Thank you David,
It worked out pretty good.
I don't know if the complete file loaded.
I noticed that the file was larger that 32Kb. Maybe I am not understanding the capacity of the Atmega32.

What did load on the chip, did show the display mfg and model and different fonts / graphics.

I concur with you about learning how to use the library.
I definitely would like a more attractive presentation on the display.

Thanks again.
Randy

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

If you use CodeVision, you can simply use the library.

If you don't have CodeVision, you can search out a T6963 library for avr-gcc. e.g. u8glib.

Most graphics libraries will contain the same functionality but probably use different names and API.

David.

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

Hello Everyone,

I need help.

It is almost a year now and ready to write c code through AS6.

For that time I have learned a lot more about programming with C and gained more understanding of functions.

 

So I am back on my project writing code in C to operate an LCD module with the t6963c control chip built into it.

I've learned I have lots of questions about this code with my project and hoping that someone can help me.

I have obtained libraries for this t6963c chip to operate it.

 

I am using an AVR-8 Atmege32 chip.

I know the display works when installing the hex file onto the Atmega32 for testing from david.prentice file he was kind enough to allow me to use.

I have now changed PORTs for Data and Commands from PORTC to PORTA. I have no hex file to test PORTA now or any idea how to test it to see if my data lines are proper.

 

Well I guess I kinda do have an idea but it is not working and all I am doing is checking the status of the display and to turn on a single LED that I have connected to PORTD pin 14 PD0 (RXD).

This LED does turn on and off with my code in a simple program to turn it on and off however I choose. So that works.

 

Using code to turn ON the LED and then turn it OFF after the code finds that that LED STA0 and STA1 are both set (0x03).

Checking STA0 & STA1 on the display pins is a must to send/read commands and data. Documentation of the t6963c says that these to pins must be high to read data or send commands.

 

This code will turn on the LED and will not turn it off.

I am guessing that the do-while loops is in an infinite loop.

 

Help! What can I do? JTAG is disabled for my fuse.

 

 

<

int main(void)

{

    ledInit();                             // initialize PORTC to be an Output port

    ledOn();                             // PINC0 (HI)

    

    do

    {

         // loop till STA0 & STA1 are not 0x03 (0x03 = ready(=)

    }

    while((0x03 & glcd_sget()) != 0x03);

 

    ledOff();                             // PINC0 LOW

 

    return 0;

}

 

int glcd_sget(void)  // get LCD display status byte
{
    ledOff();
    int glcd_status;

    glcd_SET_DATADIR_IN();               

    glcd_cd_high();                             // bring LCD C/D line high (read status byte)
    glcd_rd_low();                              // bring LCD /RD line low (read active)
    glcd_ce_low();                             // bring LCD /CE line low (chip-enable active)

    asm volatile ("nop"::);
    asm volatile ("nop"::);

    glcd_status = glcd_DATA_PIN;      // read LCD status byte

    glcd_ce_high();                             // bring LCD /CE line high, disabling it
    glcd_rd_high();                             // deactivate LCD read mode
    glcd_SET_DATADIR_OUT();           // make 8-bit parallel port an output port

    return(glcd_status);
}//sget1()

>

Last Edited: Sat. Nov 15, 2014 - 10:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I have a 6963 program that compiles up with the imagecraft compiler. I adapted it fro a version that used aparallel printer port. Yikes. Anyway, it has a proper init and cmdput and dataput and texmode works. You read up on the fontsize pin? That messed me up for a while.

 

Imagecraft compiler user

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bobgardner:

Thanks for the heads up.

Found the issues with lower STA 01 & STA 02 (bits 0 and 1) always being zero.

 

1.

Had a 1k Ohm resistor on RST rather than a 10k to have a power up reset as prescribed in the t6963c application notes.

 

2.

Sequence to enable read, data, chip select and reverse the sequence are now in order.

 

3. removed 13 inches of ribbon cable between the LCD and the ATMEGA32.

 

Now I can check status and write characters to the display. 

I just see on glitch on display I may ask about later if I don't get it.

It would be more at the programming end.

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

"I noticed that the file was larger that 32Kb. Maybe I am not understanding the capacity of the Atmega32."

well, *.hex files countains information on where to store data; each byte is encoded in ASCII -ie, it is encoded into two chars -> two bytes-. Therefore, it may be larger than the flash size...

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

Thanks dbrion0606,

That is good to know. I did not know that.

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

Thanks dbrion0606,

That is good to know. I did not know that.

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

Thanks dbrion0606,

That is good to know. I did not know that.

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

Thanks dbrion0606,

That is good to know. I did not know that.