Shop OBEX P1 Docs P2 Docs Learn Events
make a big serial LCD display — Parallax Forums

make a big serial LCD display

David BDavid B Posts: 592
edited 2007-01-24 06:26 in General Discussion
Here's a litle trick I just invented that might be useful to someone.

I've been using a beta spinStudio propeller test board to figure out how to operate an IDE hard disk. It's going pretty well - I'm able to read and write individual 512-byte sectors. But the only output device I had was a little 2-line 20 character LCD, which works ok for one-word messages but was getting pretty hard to use when dumping entire 512 byte sectors of information. I wanted a bigger display.

One solution would have been to use the propeller to drive a CRT, for which spinStudio does provide a connection. But I'd already used all the io pins from the CRT socket for running the hard disk, let alone that I didn't have an extra CRT.

A much larger multi-line LCD would have been perfect, but they get really pricey as the rowcount goes up.

But I had probably half a dozen old laptops in the garage, from 386es to pentiums, all with worn-out batteries, most with hard disk problems, some with battered keyboards and cases. But most of them still ran, and have decent screens, and their floppies still worked.

So here's my brainstorm. I used the old DOS DEBUG program to write a little assembly program and save it to the boot sector of a floppy.

Then boot the laptop from that floppy, and voila! a serial input, LCD output, 24-line, 80 character LCD! A piece of junk is transformed into a useful tool, good for SXes as well as the propeller!

The BIOS display routine properly performs returns and line feeds at the end of each line, and scrolls the entire screen up one line when the bottommost line is finished. Also, it properly responds to CR, LF or backspace commands sent over the serial port. In short, it places every incoming character just as it should.

The serial port needs pin 4 tied to pin 6 to satisfy its hardware handshaking, but with that done, this terminal works just as well as the little 2-line LCD!

I spent a little time playing around with assembly, testing the received character for some particular value and performing special processing on it. I also played around with getting characters from the keyboard, which is just as easy as from the serial port, and sending the characters to the screen, and also out the same serial port. I've thought about building some data storage, etc. There's plenty that could be done.

But I like the simplicity of this program just as it is - it's amazing how much usefulness can come from such a small amount of code. No Windows, no DOS! Just BIOS calls.

I tested this on both a 25 mHz 386 and on a 100 mHz pentium laptop, and it worked equally well on both. My propeller filled both screens with "Hello World!"

David


Make up a booteable DOS floppy that contains DEBUG.EXE. Start the laptop from it.

A: debug.exe··········· (don't enter the comments in DEBUG.)

-a·100··················· ;·tell debug to start accepting assembly instructions

mov ax, e7············· ; set COM1 for 9600 baud, no parity, 2 stops
mov dx, 0··············
int 14
mov ah, 2·············· ; wait for incoming serial character
mov dx, 0
int 14
mov bx, 0·············· ; send character to display
mov ah, e··············
int 10
jmp 108················ ; then go back to waiting for a character

(hit CR a couple of times to exit assemble mode back to DEBUG command mode)
(remove your DOS boot floppy and insert·a floppy·you're willing to overwrite)

-w 100 0 0 1··········· ; write chars from offset $100 to drive 0, sector 0, write 1 sector.

reboot and allow it to start from the floppy.
Send RS232 into the serial port. Result - it works!!

·

Comments

  • BeanBean Posts: 8,129
    edited 2007-01-23 12:27
    Great idea David.
    It reminds me of days spent writing DOS device drivers. (*.SYS files).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • PLJackPLJack Posts: 398
    edited 2007-01-24 06:26
    That is just brilliant.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - PLJack - - -



    Perfection in design is not achieved when there is nothing left to add.
    It is achieved when there is nothing left to take away.
Sign In or Register to comment.