This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A question of instruction timings and libraries...

Other Parts Discussed in Thread: ENERGIA

Hello! I'm a total n00b, so please be gentle.

I want to interface a small graphic LCD module (128x128, monochrome) that has a Toshiba T6963C controller in it, to my new Stellaris LaunchPad. (To be specific, the LCD module is a PowerTip PG128128-A.) According to this document, first sentence of the second section (basic R/W ops)...

"For all of the following, so long as your microcontroller takes more than 200ns to do an instruction, you arn’t [sic] going to violate the specs."

It then goes on to point out that if one has a faster microcontroller, one needs to consult the 46-page datasheet for that controller and dig up timings. This leaves me with two questions:

(1) generally, does the microcontroller (Cortex M4F) take 200ns -- or less, or more -- to do an instruction? I am *guessing* less, but given my (profound lack of) experience here, that's not much more than a WAG -- the various datasheets haven't told me anything useful here.

(2) is there a library for this controller (again, Toshiba T6963C) so that (in theory) I don't even have to worry about timings and such?

...note that I don't actually have the LCD module yet, I just want to know how much trouble I'll be in when I get it...

Thanks folks!

  • 1)  " The Stellaris® LaunchPad uses a 16.0-MHz crystal " ( clock divided by 4 for most instructions means roughly 0.00000025 of a second or wicked fast and yea, add wait statements )

    2) doubt it, but libraries are made to be modded/ported over so reading all that can make a difference, so can adding wait statements between commands.

    I had an old 2x16 LCD that I was sending the whole characters to as graphics until i read that I could just send the ASCII value to it so reading the data sheets ahead of time actually can save you issues.  As example, in the first few words on ' talking '  to it,  " 3.1 Before every data read, data write, or command write, the status must be checked. " so you need a whole lot of status reads in your code.

    Hope this helps,

    Eric

  • Regarding your answer to (1)... that's 250ns according to google ;)

    As for (2)... too bad. But I can maybe make it work. I came across mention in the docs somewhere of a 128x128 LCD library... maybe I can tweak that somehow. I dunno. I'm sort of jumping in headfirst -- this is my first microcontroller!

    ...and I did see the part about status checks. No worries.

  • Can anyone else confirm whether or not Eric is correct on (2) -- that there is no library for this particular chip?

    Thanks!

  • Hi,

    Good to know you don't have yet that display - the document you link for is very old, 15 years, and so the display, and is for 5V supply. You don't know when it will not be available. My advice is to take a look at EKS-LM4F232 board - it has an 128x96 color display, it is interfaced with a high speed SPI module, work at 3V AND you have a good graphical library, various fonts to play with.  

    As for CPU instruction cycle time - take into account this microcontroller has also a PLL at 400MHz inside, so the maximum operating frequency is 80MHz - so one cycle time is 12.5 ns .

    Petrei

  • Display was ordered but not shipped at the time I wrote that. I expect it will be shipped out tomorrow and will be at my house a few days later. This is a one-off hobbyist sort of thing, so availability is not an issue. As for the EKS-LM4F232, I can't afford a $150 module. I could barely afford what I got, and it was $6 including shipping (go eBay!).

    As for the display I/O, I can very easily do a voltage-shift with transistors if need be. I thought the Launchpad had 5v GPIOS?

    The cycle time is no big, I can read timing diagrams. Guess I'll be getting familiar with NOPs and wait states.

    Still no conf on the (lack of?) library support for that LCD. I'd like to have the library, but I suppose it's not essential. I've got to learn this stuff somehow, and how better than to jump right in?

  • Hi,

    If this is your choice then OK - by looking at EKS-LM4F232 I meant look at the documentation - is available online (user manual, containing schematics and BOM) - is a useful source of info. 

    All Cortex-M3/M4 at TI (and other brands) works with 3.3V; GPIO is 5V-tolerant for inputs only, not for outputs, so the hardware design will be more complex. 

    Another advise is to download and read something about StellarisWare library - a lot of functions to be used for configuring/programming the micro. Take into account the Cortex-M3/M4 is something special from hardware point of view - wait states does not exists, software delays can be easily implemented.

    Petrei

  • Chris,

    There probably is not a library as such but look at the code for DK-LM3S9B96, which has a color LCD display.Speciifcally the kitronix320x240x16_ssd2119_8bit.c file might be helpful is sending data to your display and getting the timing of the vertical and horizontal pulses correct.

     

    Jay

  • No worries about the voltage -- I'll just make a transistor level shifter.

    I'll look at the StellarisWare stuff as well. I gave the various bits of documentation a glance or two already -- I know that there's a library I can adapt for my display, I was just hoping that I wouldn't have to mess with that.

    For the record, this display is 128x128 pixels and monochrome, so I'm not sure how a library for a color LCD with much higher res is going to be helpful here.

    Gotta start somewhere, though. I'm going to mark this thread "solved" since my questions have been answered in great detail.

    Thanks folks!

  • Take a look at the T6963 library for Arduino.  If you use the code that is "#defined" for the Ardiuno MEGA boards, then it should be fairly easy to port to to the Stellaris (the code for the Arduino Uno was a little weird, if I recall correctly to account for certain details of the Uno's design).  

    If you use the Energia development environment, porting will be a lot easier, since Energia implements a lot of the native Arduino/Wiring library (wouldn't recommend Energia for anything serious, but it works extremely well for simple prototypes)