Leap Electronics WICE-4M ROM an SRAM EMULATOR
Source files on bitbucket.
* Emulate 8 bit and 16 bit ROM's.
* DB25 Parallel interface.
1. Start with getting a schematic
Follow those traces to find out where they go.
2. Reverse original software MSDOS based.
Used IDA to go through the executable.
3. Write software to work on Windows and Linux via USB to LPT port.
This has kind of gone down a different path.
Look at a small micro with USB to do most of work.
Have been working on getting some routines I had running in spin to work in Propeller Assembly, So far so good, I basic read a byte write a byte, read and write a byte with increment. The speed is still not to my satisfaction as of yet. Might try to do 16 bit and 32 bit read and writes that will get some things moving.
I have knocked up some code on my Linux Mint machine to communicate with the my WICE interface. So far all look good.
But sorry folks, I did not use C code not even Assembly.
I did it in factor, I have been using this language for 5 years now, I like its forthy-ness, interactive interface and the library of functions.
First I need open serial, this took some time work, how to do this on linux environment. I use library "io.serial" use "termios" and "streams" libraries. I had some issue on read operation, transmission was the easiest, only thing to remember is use the "flush" function to send the data out after "write" function.
: wice-start ( -- )"/dev/ttyUSB0"115200 <serial-port>
wice-resetdrop0x55 wice-write-minc drop
wice-resetdrop16 wice-dump drop
] with-serial-port-fix ;
wice-start basically sets up a serial port tuple. The with-serial-port-fix opens the serial port into a stream namespace and then executes all function in the quotation [ ] .
Built a big loop that looks for the first data on serial port. This is the command byte, each command is put through case statement to run a function. Some commands will wait for 1 to 4 bytes for parameters. All commands must return something, this could be 1 to 4 bytes of data this may change if future.
List of current commands
Awake Command will always return $00 manly here to see we get some kind of response.
Get status so far we $01 port A is open and $02 port B open for reading and writing.
Reset the Address Counter. This should always return four $00 bytes 32 bits
Reads the data in memory at the address of counter
Reads the data in memory at the address of counter then increment address counter.
Get the current address from the counter shadow 32 bits
$01 Open port A for reading and writing, $02 open port B for reading writing. Returns the status e.g. command $01
Closes access to all port and goes into ROM Emulation mode.
Write to memory addressed by counter, a read of memory is performed after write and read data is returned.
Write to memory addressed by counter, read of memory after write is returned and address counter is incremented.
Get the shadow value of U30 latch output
Get the shadow value of U4 latch output
Get the shadow value of U5 latch output
Get the shadow value of U6 latch output
Write a value to U30 shadow latch and return the new shadow value
Write a value to U4 shadow latch and return the new shadow value.
Write a value to U5 shadow latch and return the new shadow value
Write a value to U6 shadow latch and return the new shadow value
I was working way with c code "simple IDE" for the propeller and notice the memory space was getting smaller and smaller until I ran out, I must of had optimise setting wrong. I did spend sometime trying work out what when wrong.
I when back to my original spin code. I will get back the c code another time.
I have build basically a spin driver to handle all parallel hardware signals, created "wice" driver handle control of the parallel driver.
The wice driver handles the writing to latches and the reading and writing of wice memory and maintains a shadow memory of all the latches and the address counter.
So far the main code is only utilising one processor and no assembly. Another processor is running serial communication.
Will look at putting parallel driver into a separate processor to get some extra speed.
This is the new Parallel PCB all the level shifters have been changed for better drive of TTL IC for WICE-4M. So far all looks good no issue with talking to WICE-4M. Now time to write code to start communication.
I did not do much research on the TXB0108 series of level shifters, the output pins do not have enough drive to switch a Parallel port with pull up resistors with 1K on the WICE, My bad, a redesign is on the way.