EmbeddedRelated.com
Forums

Looking for dumb terminal software for 8 bit cpu

Started by Unknown January 2, 2005
I am working on using a Z80 core on an fpga for use as an on chip
serial terminal. I have not had much success in finding anything that I
think will fit. Something written in c and compilable with sdcc would
be ideal.

Anyone have any suggestions?

On 2005-01-02, javaguy11111@gmail.com <javaguy11111@gmail.com> wrote:

> I am working on using a Z80 core on an fpga for use as an on chip > serial terminal. I have not had much success in finding anything that I > think will fit. Something written in c and compilable with sdcc would > be ideal. > > Anyone have any suggestions?
I don't really understand what you're looking for. 99% of the "work" in a dumb terminal is interfacing with the display controller chip, scanning the keyboard, and talking to the UART. You specify neither your display hardware nor your keyboard hardware nor your UART. So, we have to assume that the HW interfacing is done. If the HW interface stuff is indeed done, a dumb terminal only consists of about 6 lines of code: while (1) { if (uartStatus.rxData) displayChar(uartData); if (keyPressed()) uartData = keyValue(); } -- Grant Edwards grante Yow! Are you guys lined up at for the METHADONE PROGRAM visi.com or FOOD STAMPS??
The rtl up this point consists of a z80 from opencores.org , memory,
uart, keyboard and memory mapped text console. The while(1) is
basically what I just got through testing when I saw your reply.

The fpga board I am using is a Xess with a XC3S1000 and does not have
an onboard serial connection. It does have onboard keyboard and video
connections.

Basically I am looking for code that would give me a vt100 or
equivalent functionality.  This part of the rtl will interface with an
on chip or32 running ucLinux. I do not have enough available block ram
to run a vga display, so I am  running in text mode. Also just having a
small onchip serial terminal could be useful for other projects.

javaguy11111@gmail.com wrote:

> The rtl up this point consists of a z80 from opencores.org , memory, > uart, keyboard and memory mapped text console. The while(1) is > basically what I just got through testing when I saw your reply. > > The fpga board I am using is a Xess with a XC3S1000 and does not have > an onboard serial connection. It does have onboard keyboard and video > connections. > > Basically I am looking for code that would give me a vt100 or > equivalent functionality. This part of the rtl will interface with an > on chip or32 running ucLinux. I do not have enough available block ram > to run a vga display, so I am running in text mode. Also just having a > small onchip serial terminal could be useful for other projects. >
You may have to create your own terminal emulator from scratch. It isn't hard. A simple one that supports clearing the screen, painting characters as any location on the screen, optional line/wrapping and scrolling should only take about day. Noel
Noel Henson wrote:
> javaguy11111@gmail.com wrote: > >
[...]
> > You may have to create your own terminal emulator from scratch. It isn't > hard. A simple one that supports clearing the screen, painting characters > as any location on the screen, optional line/wrapping and scrolling should > only take about day. > > Noel >
I second that. Porting something such as curses would be a mini-major (or major-mini) project.
Noel Henson wrote:
> javaguy11111@gmail.com wrote: > > >>The rtl up this point consists of a z80 from opencores.org , memory, >>uart, keyboard and memory mapped text console. The while(1) is >>basically what I just got through testing when I saw your reply. >> >>The fpga board I am using is a Xess with a XC3S1000 and does not have >>an onboard serial connection. It does have onboard keyboard and video >>connections. >> >>Basically I am looking for code that would give me a vt100 or >>equivalent functionality. This part of the rtl will interface with an >>on chip or32 running ucLinux. I do not have enough available block ram >>to run a vga display, so I am running in text mode. Also just having a >>small onchip serial terminal could be useful for other projects. >> > > > You may have to create your own terminal emulator from scratch. It isn't > hard. A simple one that supports clearing the screen, painting characters > as any location on the screen, optional line/wrapping and scrolling should > only take about day. > > Noel
It could help to have the following done in your hardware : simplifies code, and also improves performance. ** ClrScreen ** ClrEOL ** HW Cursor ** and maybe ScreenPage select, or long screen HW scroll, since you have a FPGA... -jg
Jim Granville wrote:

> Noel Henson wrote: >> javaguy11111@gmail.com wrote: >> >> >>>The rtl up this point consists of a z80 from opencores.org , memory, >>>uart, keyboard and memory mapped text console. The while(1) is >>>basically what I just got through testing when I saw your reply. >>> >>>The fpga board I am using is a Xess with a XC3S1000 and does not have >>>an onboard serial connection. It does have onboard keyboard and video >>>connections. >>> >>>Basically I am looking for code that would give me a vt100 or >>>equivalent functionality. This part of the rtl will interface with an >>>on chip or32 running ucLinux. I do not have enough available block ram >>>to run a vga display, so I am running in text mode. Also just having a >>>small onchip serial terminal could be useful for other projects. >>> >> >> >> You may have to create your own terminal emulator from scratch. It isn't >> hard. A simple one that supports clearing the screen, painting >> characters as any location on the screen, optional line/wrapping and >> scrolling should only take about day. >> >> Noel > > It could help to have the following done in your hardware : simplifies > code, and also improves performance. > ** ClrScreen > ** ClrEOL > ** HW Cursor > ** and maybe ScreenPage select, or long screen HW scroll, since you have > a FPGA... > > -jg
I went over some old code snippets and found one that occupies about 500 bytes. It was for a bit-mapped display with the character maps in ROM. It did support windowing, or rather, it supported terminal emulation (clearing, scrolling and line-wrapping) on non-overlapping regions of the displayed screen. Since my display was bit-mapped, I didn't get the advantage of any hardware support. Surprizingly, performance wasn't too bad. Noel
I currently have about 8K ram allocated for the Z80. I can bump it up
to 32k if necessary, but I hope I will not need that much.

I was hoping I could avoid having to wade through a bunch of terminal
specifications to create a working display. Probably what I will do is
have the terminal print out any unrecognized escape codes in hex to
reverse engineer any additional functionality I may need. I will also
have to write a key scan code decoder as well.

I do not think speed will be a problem since I am currently running the
Z80 at 25Mhz and can probably bump it up to 50Mhz if necessary. Of
course it is possible I could bottleneck on video memory access, but I
will worry about that if it becomes a problem.

javaguy11111@gmail.com wrote:

> I currently have about 8K ram allocated for the Z80. I can bump it up > to 32k if necessary, but I hope I will not need that much. > > I was hoping I could avoid having to wade through a bunch of terminal > specifications to create a working display. Probably what I will do is > have the terminal print out any unrecognized escape codes in hex to > reverse engineer any additional functionality I may need. I will also > have to write a key scan code decoder as well. > > I do not think speed will be a problem since I am currently running the > Z80 at 25Mhz and can probably bump it up to 50Mhz if necessary. Of > course it is possible I could bottleneck on video memory access, but I > will worry about that if it becomes a problem.
Your speed should not be a problem. It sounds like you have enough program space as well. And don't worry about the keyscan routines, they are quite simple. You'll need just a few simple routines to get going. If you like, it seems like the wonderful people on this thread are willing to advise. Need some help to get started? Noel
Suggestions, links and code snippets are always welcome. And of course
I am willing to share the end result with anyone that is interested.
This is a personal project. Nothing proprietary.