about LCD12864's spi communication

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

LCD12864's datasheet says the fosc is between 470Khz to 5920Khz when using serial communication.
i just want to ask ,is it SCLK of AVR has to be set about 500khz? datasheet does't tell me what fosc is.
if LCD does't work well , our intention to invade earth will be lost, and we will lost in the solar dark lonely space.

Attachment(s): 

Our Martians are beginning to learn AVR

Last Edited: Fri. Oct 19, 2007 - 05:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Our Martians are beginning to learn AVR
I have known that for a long time, you lot use the C language!
Perhaps you can start by downloading the data sheet for the intended AVR and read it (is there a BabelFish translator to Martian?), then reveal to Earthlings the oscillator frequency you intend to use and perhaps do some calculations based on that and the SPI clock divider as describel in the datasheet. :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I use several SPI IC in the same port. But others can run in high speed , if this one can run as high as 4Mhz, that will be fine. if not , when i use lcd12864, i have to reset SPCR and SPSR to make SCLK become 500khz, and after finished, reset them to high speed status again.
so , if lcd12864 can work finely in nearly 4Mhz, that will be much easy for us.
this is a small question. never laugh at our Martian's intelligence.
(by the way , "our Martian" and "our Martians" ,which is right?)

Our Martians are beginning to learn AVR

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

Quote:
if lcd12864 can work finely in nearly 500khz, that will be much easy for us.
Maybe something is being lost in translation. Do you have the data sheet for the LCD? Maybe the fosc is the internal module clock and not the SPI speed the module will accept. This seems a graphic LCD module, correct?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js, i have edited your quote.
it is really a graphic LCD module "128*64"
nowaday, i did really find our Martian English is so bad.
i think this is a very common LCD that you must have used that before, so datasheet will be no need to show, there are lots of such datasheet in the earth.

to thank those mankind who have helped me ,i share my delay functions with you.

void delay_init(void)
{
TCCR2=(1<<CS20)|(1<<CS21); //prescaler=64
TCNT2=0;
TIMSK=(1<<TOIE2); //overflow interrupt enable
}

void delay_us(uint time) //4us to 1024us(1ms)
{
sbi(TIFR,TOV2);
TCNT2=256-(time>>2); // 1/(16000000/64)=4us time>>2 is faster than time/4
loop_until_bit_is_set(TIFR,TOV2);
}

void delay_ms(int time)
{
for(;time>0;time--)
delay_us(1000);
}

this is a hardware delay function , it is much better than the wholly software one.
the wolly software one's delay time will be a little bit erring when interrupt function occured.

Our Martians are beginning to learn AVR

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

Now I'm confused even more, your topic says it's an SPI LCD ie with a serial input. I have a 240*128 graphics LCD but it uses a parallel data bus (8 bits + 4 control lines)

Quote:
i think this is a very common LCD that you must have used that before, so datasheet will be no need to show,
Not very common for me, I have only used text LCD so far, just started with a graphics unit, so data sheet would be good :)
Microcarl has started to work on a graphics lcd
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=55159&highlight=mega644 and https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=54217&highlight=mega644 but looks like he is busy making some money at the present :)
There is also a graphic lcd driver with avrlib in C.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Ive got that GDM12864H graphics LCD from Sparkfun Electronics and it's parallel. They do offer the same display with an RS-232 serial backpack for $40.00 (US) more. No SPI on that thing, though...

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

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

Quote:
They do offer the same display with an RS-232 serial backpack for $40.00 (US) more.
Doesn't "someone else" offer a backpack? :)
I got a 240x128 lcd from Futurlec, also parallel, a while ago as I had a prospective job that never eventuated. I did get the wrong size as I didn't realise how big it was :( , a 128x64 would have been enough for that project.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
Doesn't "someone else" offer a backpack? :)

I've seen sever different serial backpack out there for the HD44780 based controller. But, Sparkfun is the only place that I've seen them for graphics displays.

But Sparkfun doesn't sell the graphics display serial backpack as a stand alone product. You can only purchase the pre-assembled pair - backpack attached to the graphics display.

And, I think it only goes up to 19.2K BAUD, not 115.2K BAUD. Plus it has a very limited control set.

It seems to me that the graphics control over the RS-232 connection is column/page/side oriented, not individual pixel oriented. Though, I guess at the end of the day, it resolves down to the same thing.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

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

i have added our Martian LCD12864 datasheet which is based on ST7920 controller. maybe the language is little bit trouble for you

Our Martians are beginning to learn AVR

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

Ok so the Martian language gets me, but it looks like the LCD can be either standard parallel or serial input. The serial input has a 400ns rate which is about 2.5MHz clock cycle, not too sure about the other ~500khz clock but it could be some refresh clock for the lcd.
So try and run the SPI at the lowest rate possible to start off with and then go up in frequency, a 2MHz SPI clock would be reasonable anyway.
The company has an English website so you could ask them for an English data sheet, they may have one already.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly