simple peripherals/hardware simulation

Bug #579331 reported by Onkar Shinde
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnusim8085
New
Wishlist
Aanjhan Ranganathan

Bug Description

it would be good if there was some sort of generic way to model simple peripherals such as for example I/O hardware, i.e. by mapping a certain region of memory to a corresponding grid on screen to simulate an LCD or even simple VGA screen, something like this would preferably be pretty flexible and allow for different types of hardware to be modeled,possibly using a scripting language such as lua.

gpsim provides similar facilities in the form of binary plugins

Tags: sim-engine
Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

there is another freeware sim that supports 7 segment led displays: http://freenet-homepage.de/softwehrpage/8085.htm

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

check out http://www.edsim51.com/ for another free 8085 simulator that features basic peripherals simulation, i.e. an LCD display

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

gpsim supports loadable modules (libraries or scripts) that can be connected to uC I/O pins, so that modules can simulate arbitrary hardware, for example check out http://www.dattalo.com/gnupic/lcd.html which is a module simulating a simple liquid crystal display.

Maybe, this would also be the best approach for gnusim8085?
One could embed a scripting interpreter such as lua, python or angelscript which allows users to provide scripts that simulate hardware.

For most cases, it would already be sufficient to be able to define pretty simple I/O peripherals:

- switches
- LEDs (i.e. multi-color, tri-state)
- 7 segment LED display
- LCDs (possibly using configurable dimensions x*y)
- keypads

If implemented in a scripted fashion, users could easily provide and use their own scripts without having to recompile the simulator.

Many commercial simulators also feature support for simulation of basic I/O hardware, at school we used:
http://www.simsoft.de/8051baut.htm

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

I would personally also love to see basic support for peripherals such as simple RAM or EEPROM chips, preferably an implementation would be generic enough so that users can be provided with some sort of "library" of available peripherals, so that they can pick arbitrary peripherals, which in turn would trigger peripheral-specific wizards facilitating ways to set up/customize each selected peripheral (i.e. connect to certain ports in its simplest form)

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

simulating visual output hardware could probably be rather easily accomplished by providing simple output windows/tabs with a setPixel routine controlled via ports or memory

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

regarding the simulation of LCDs, you might want to check out the following two open source projects that already contain LCD emulations:
http://freshmeat.net/projects/lcdemu/
http://freshmeat.net/projects/palmorb/

lcdemu looks particularly appealing, and being programmed in C, it seems feasible to embed it directly into gnusim8085.

Boris

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

> http://www.esden.net/lcdemu

this does indeed look very promising, however in its current form it seems to be restricted to *nix systems, as illustrated by the gmake based build system, as well as the /dev/lcd device being used to access the devices, however it might be possible to generalize the program somewhat more and only use the UI part

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

7 segment LED displays could probably be rather easily emulated by using 9 versions of bitmaps containing all possible states of individual segments, so that whatever display state could be simulated by rendering the corresponding segments individually as bitmaps in a fixed location, or maybe there's even some sort of 7-segment LED font or a corresponding GTK widget?

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

Actually, it seems a 7 segment display could assume 2**7 distinct states, i.e. all combinations of segments on/off?
So, rather than only save 10 states for each numeric value, why not simply save only two states:

- segment on
- segment off

Using such images, arbitrary displays could be generated

Revision history for this message
Bug Importer (bug-importer) wrote :

Logged In: NO

well, for what it's worth, I seem to recall that there are also custom GTK controls/widgets available, maybe there's a LED segment display available, too?

Revision history for this message
Bug Importer (bug-importer) wrote :

I think these are really good ideas, I would however like to point out that anyone considering to implement this should take into account the fact that the use of such a facility could be greatly improved by trying to model as closely as possible existing peripherals, so that the code to address and control such virtual peripherals wouldn't become too simulator-specific, preferably it should be generic enough so that it's similar to real peripherals

Revision history for this message
Bug Importer (bug-importer) wrote :

this would be mainly a matter of making the support similar to mainstream LCD controllers, such as the T6963

Revision history for this message
Bug Importer (bug-importer) wrote :

another neat thing to have, would be a way to map the keyboard LEDs to virtual I/O ports in gnusim8085, so that you could optionally control your keyboard LEDs via gnusim, I mean pretty much all keyboards have at least 2-3 LEDs, these are easy to control from any program, so we could just simply map them to virtual I/O ports on the 8085 processor, so that we can use assembler code to animate these LEDs. This seems like a fairly simple but good idea.

Revision history for this message
Bug Importer (bug-importer) wrote :

for emulating an lcd, "lcdemu" might really be a good option, I just downloaded it and checked it out, it's also written using Gtk,so integration should be fairly straight forward, and the only *nix specific code I could find is not required for use in gnusim8085, because it doesn't have to work with "lcdproc", so no fifo support required.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.