assembly programming an LCD display and a kbd

I'm programming an Arduino Uno32 in MIPS assembly and I need some I/O suitable for human interaction.

Basically I would need a keyboard and an LCD display easy to interface in assembly. Maybe I could reverse engineer peripheral C libraries function calls for a display and call C code from my assembly, but I would rather write my own assembly code for an easy to interface LCD display (I did write this kind of code for Hitachi LCD displays and 8 bit microprocessors many years ago).
I wonder if anybody has done something similar in assembly and/or could suggest a simple-to-interface LCD display.

Concerning the keyboard, maybe someone might have used some simple device which would be an improvement on my bare bones idea of putting a few pushbuttons in a matrix and testing final status after a key-bouncing delay.

Thanks

Pierrealexis

I wonder if anybody has done something similar in assembly and/or could suggest a simple-to-interface LCD display.

Have you tried a Google search for something like LCD Assembly examples ?

Don

Thanks. I know there is plenty on the web and full interface details in the specifications for any LCD display. Also, I could probably use one of my old displays and rewrite my 8 bit assembly code into MIPS, but it would be nice to know whether anyone has done something similar with a specific LCD on an Arduino compatible platform, as I still have to decide which LCD to buy.

Pierrealexis

I have used assembly language to drive LCDs for several decades on several processors. I went through the trouble to fully document the entire process and post the results for all to see.

You really should take a look at the first link (at least here in the US) that pops up with the Google search I recommended.

Don

Thanks! I was looking at your pages, they are very comprehensive indeed, including the hardware details.
I had been considering an LCD display with an UART or I2C interface but it is not as straightforward as directly driving the display.

Pierrealexis

@pierrealexis

LCDs are slow and C compilers create compact code so it is hardly worth writing the code in assembler these days except for self education. If you need a fast loop for some reason then you can embed assembler in your C code.

The driving of the LCD I/O lines is simple but your code will spend a lot of time waiting, so there is no speed benefit of writing the interface code in assembler. When you start wanting to interface with internal processor peripherals like the UART or I2C, interface with sensors or print floating point values then things rapidly start getting complicated... so consider what you end goal is. If you use Arduino libraries you can get stuff up and running in minutes with little effort.

Similarly with switches, C code works fine and you will have to include debounce delays anyway. If you want a quick response to a key press than you can use interrupts and again the handlers can be embedded in your sketch.

I know there is little point in self-inflicting paint by programming LCDs and other peripherals in assembly, but the core part of my project just has to be in assembly. With MPLAB's compiler I could call C code library functions for peripherals from assembly but I would have to reverse engineer the parameter passing into registers and I reckon that writing my own code for simple peripherals is probably easier. And as the assembly has to be in very specific control of program and data memory I don't want to use inline assembly that the compiler can relocate. Maybe I could exercise more control over the compiler but again, with libraries written by others to compile and keep out of the way of my assembly, I suspect it would be more of a hassle than writing code for an LCD and a kbd.

Thanks!

Pierrealexis

pierrealexis:
I'm programming an Arduino Uno32 in MIPS assembly and I need some I/O suitable for human interaction.

No offense, but why the heck code in assembly??? Its such a pain when you could just code it in C++ with the IDE.

No offense, but if no one learns to program in assembly who will be there to create your compilers?

Don