Videopac / Odyssey2 forum
January 23, 2020, 09:35:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Al lot of attachments from Nov 2011 till april 2012 are damaged. Please ask the original poster to re-upload if you need them.
 
   Home   arcade Help Login Register links videopac.nl  
Pages: [1] 2   Go Down
  Print  
Author Topic: Videopac to mbed connection, first steps  (Read 7697 times)
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« on: March 05, 2011, 12:41:19 PM »

This is the first attempt to connect the mbed processor board to a Videopac. http://www.mbed.org
I choose the C7420 method for this first setup so there is an EPROM in the cartridge and the two TTL chips generate the signals INT, RESET, OutputEnable and LatchEnable for the double latch (HC646 register) on the mbed protoype board.
So far the handshaking seems to work, now I need to figure out the protocol for sending for example a character to the Videopac screen. If this works it should, for example, be possible to emulate the Z80 on the mbed and use it as an original C7420 basic system but with the mbed you can do lots and lots more.

« Last Edit: March 07, 2011, 12:22:22 PM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Seob
Give this man a Jopac!
******
Posts: 1385



« Reply #1 on: March 06, 2011, 08:09:34 AM »

sound great, but i still don't know what the possibilities are of this setup.
Logged

8 bits of fun
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #2 on: March 07, 2011, 07:30:01 AM »

With the mbed I am trying to mimic the basic programming module or maybe even the chess module.
The next step is to emulate the cartridge rom too with the mbed so it can be anything (to the Videopac) you want: rom, ram, multicart etc.
All that would essentially be needed then is a cartridge casing, an mbed and a few latches.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #3 on: March 08, 2011, 01:47:22 AM »

Wow... Communication between two era's :-)

A small addition to what this screen is.. The mbed is mimicking the protocol of the C7420 here and generates the ram buffer for the plus screen. After sending the command 'send videodata' the Videopac awaits a block of data which is transferred by the 8048 to the plus graphics system. The cartridge is made identical to the cartridge of the original C7420. The only difference is that a different 'engine' is on the other side of the cable coming out of the cartridge (the mbed instead of a Z80..) The Videopac itself runs the original cartridge software.
« Last Edit: March 09, 2011, 12:42:13 AM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Janzl
Administrator
I'd sell my mother for a Videopac
*****
Posts: 2336


I now can cross that bloody street...


facebook@janzl.com
WWW
« Reply #4 on: March 08, 2011, 08:13:10 AM »

With the mbed I am trying to mimic the basic programming module or maybe even the chess module.
The next step is to emulate the cartridge rom too with the mbed so it can be anything (to the Videopac) you want: rom, ram, multicart etc.
All that would essentially be needed then is a cartridge casing, an mbed and a few latches.

I have been checking the mbed website and this is very interesting. The way I understand it, the mbed is something of an allround communicator between your pc and whatever device you install the mbed in. So this could turn into a ramcart for Videopac, or if you got the skills even for other systems like Colecovision or Atari. But there are lots of other possibilities.

Very nice Smiley
Logged

Ne tirez pas sur le administrator!
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #5 on: March 08, 2011, 06:31:35 PM »

According to the datasheet of the mbed CPU it should respond within 120 ns (!) to an interrupt so technically it should be able to generate a data byte in time for the 8048 to be recognized. Another neat feature is that you can set up a 'bus' on whatever port pins you want. Just make a list of 8 pins and define them as a bus. Same goes for interrupts, just assign a pin to an interrupt, then define if it should respond to rise or fall signal and point it to an interrupt routine.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #6 on: March 13, 2011, 02:06:06 PM »

Next step, trying to get a Z80 emulator to run on the mbed so the original basic rom can be used:

After trying to compile libz80 I gave up because of this emulator taking far too much ram. Next try was with a z80 emulator from  Marat Fayzullin (portable z80 emulator) which prove to be much more friendly on the ram... After some minor adjustments it finally ran.

So far the startup screen displays! (yeah!)

Only problem is now the basic module is registering constant keypresses so I can not type in anything, it just beeps away for itself... Something to do with my input latch I guess but I did not notice this problem before with my own routines. Just need to dig a bit further.
It seems the emulation code is not efficient enough: IRQ overruns seem to be the problem.. Oh well, time to try another z80 emu (yaze seems promising simple)
« Last Edit: March 13, 2011, 09:58:11 PM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
ccc---
Post Axe Pete!
*****
Posts: 839



WWW
« Reply #7 on: March 14, 2011, 08:16:42 AM »

Awesome.
Logged

gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #8 on: March 19, 2011, 05:24:49 PM »

I have inserted a modified z80 emu from the z81 Linux project but after fixing a bug in the INI instruction emulation it is beeping just as the other emu's... Weird. I thought it was a timing problem or IRQ overrun but by installing a small test program on the mbed which had huge delays in the communication with the 8048 of the Videopac, it did'nt matter at all.. The output of the $01 command (send 10 bytes of keyboard/joystick data from the 8048 to the z80) works as it should. Still the Basic emulation on the mbed thinks someone is holding a key and beeps constantly...   
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Janzl
Administrator
I'd sell my mother for a Videopac
*****
Posts: 2336


I now can cross that bloody street...


facebook@janzl.com
WWW
« Reply #9 on: March 19, 2011, 08:17:14 PM »

I really wish I could help you but this is beyound me Roll Eyes
Logged

Ne tirez pas sur le administrator!
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #10 on: March 20, 2011, 04:15:19 PM »

tada!

Three z80 emulators and all did the INI instruction wrong: register HL was incremented after storing the data instead of before.. I found out by writing the keyroutine bufferdata on the screen and noticed that the key code was in $87b6 instead of $87b7...
 
update: well that would be too easy...  Smiley Seems I loose the first byte sent by the 8048... (the first byte is joystick data for stick 0 up/down) need some more diggin' ...
« Last Edit: March 24, 2011, 07:20:56 AM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
manopac
Game & App Development
Give this man a Jopac!
*
Posts: 1124



« Reply #11 on: March 20, 2011, 06:11:03 PM »

cool ! cool ! cool !!
Logged

sex, lies, and videopac
Rene_G7400
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2519



WWW
« Reply #12 on: March 23, 2011, 11:59:04 PM »

Three z80 emulators and all did the INI instruction wrong: register HL was incremented after storing the data instead of before.

Are you sure about that? This is what the Z80 datasheet says about the INI instruction:

The contents of register C are placed on the bottom half (A0 through A7) of
the address bus to select the I/O device at one of 256 possible ports.
Register B may be used as a byte counter, and its contents are placed on the
top half (A8 through A15) of the address bus at this time. Then one byte
from the selected port is placed on the data bus and written to the CPU. The
contents of the HL register pair are then placed on the address bus and the
input byte is written to the corresponding location of memory. Finally, the
byte counter is decremented and register pair HL is incremented.

Logged
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #13 on: March 24, 2011, 07:24:49 AM »

You are right, the INI instruction emulation was allright: HL should be incremented after writing but somehow there is a some kind of race condition where I loose the first byte sent by the 8048.. My INI modification proofed to be only a cure for the symptom and not for the problem... Smiley
 
« Last Edit: March 28, 2011, 10:29:54 PM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #14 on: March 24, 2011, 11:11:36 PM »

For anyone interested in the (C) source of the mbed part...
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!