Jump to content
IGNORED

Simple way to interface EEPROM on a VIC20


Yoruk

Recommended Posts

Hello there,

 

I am learning assembly language, and I was looking for a way to try programs on my physical VIC20. I love designing boards, so I was lookng for a way to create a simple board for the expansion port with a couples of eproms.

 

I'm not sure to fully understand the memory map. Where can I put like, 8kb of ROM ? On any of the blocks 1 to 3 ?

 

  • $2000-$3FFF: 8 KB, Expansion Block 1, accessed by BLK1 line
  • $4000-$5FFF: 8 KB, Expansion Block 2, accessed by BLK2 line
  • $6000-$7FFF: 8 KB, Expansion Block 3, accessed by BLK3 line

 

And so I'll just need to use /BLK1 to enable my chips ?

 

I also don't get how the read and write signals on the port are working...

 

17 V R/W VIC Read - /Write high during read cycle, low during write cycle of the VIC
18 C R/W CPU Read - /Write high during read cycle, low during write cycle of the CPU

 

What is exactly the "read" signal that I should to enable my eproms ?  I don't get the difference between these two signals (VIC and CPUà ?

 

Thanks !

 

Edited by Yoruk
grammar again
Link to comment
Share on other sites

Primarily you want to map your 8K ROM onto BLK5 ($A000) which is the one that autostarts. The other three are meant for RAM expansion but can be used for ROM as well, though you would have to SYS to start your games then.

 

As far as I can tell, V R/W is a misnomer, there is no way for the VIC chip to access the cartridge. I don't know the technical details, but I think you should aim at C R/W only.

Link to comment
Share on other sites

Thanks for this feedback.

 

Great to know that $A000 is an autostart address, it could be very useful. Maybe game cartridges are using this bank too ?

 

Thanks for the explanations about the the read signals, I'll dig into this. Maybe I can put a scope probe on these pins to see the signal...

 

 

Link to comment
Share on other sites

Yes, all games except for the Scott Adams' text adventures are based on block 5, plus usually block 3 for 16K games (a few use blocks 1+5).

 

Without looking for it, I feel there should be documents and discussions online to do exactly what you are asking about, or at least blueprints of typical cartridge PCBs for you to follow. I have a few that take 2 * 4K that I could scan and trace if you have absolutely nothing else.

Link to comment
Share on other sites

Well I found here the schematics of a "text interface" that

 

vic20cvc.gif

 

As we can see the "V R/W" signal is NC and the "C R/W" is driving the "/WE" pin of a 2016 (static ram ?). But I don't understand how the /OE signal of the top 2716 chip is created... The input gate D of the U4 7405 (pin 9) is connected to... nothing ?

 

10 hours ago, carlsson said:

 I have a few that take 2 * 4K that I could scan and trace if you have absolutely nothing else.

Well I can be interested by some scans... I have some time now and I like retro-analyze PCBs so... It could be helpful !

 

Thanks.

 

 

Link to comment
Share on other sites

Some more links unless you already visited them:

8/16K ROM cartridge: http://blog.tynemouthsoftware.co.uk/2019/02/vic20-8k-or-16k-rom-cartridge-pcbs.html

35K RAM cartridge: https://blog.gjmccarthy.co.uk/commodore-vic-20-expansion/

 

Actually TFW8B has lowered the 8/16K ROM PCB from £9.99 to £3.00. I don't know how cheap you can make your own cartridge boards, but £3 + shipping from the UK isn't too bad if you can save hours of work, depending on how many you were planning to manufacture of course.

 

Link to comment
Share on other sites

Thanks for the links. The first one is interesting, but they didn't share schematics. The second one does share one, and it actually uses "V R/W" signal.

 

I asked the guy from Tynemouth Software a question about the "V R/W" and "C R/W" signals. The answer is quite simple : The initial read signal from the CPU is the "C R/W". The "V R/W" is the same but gated with the clock, so this signal is a bit shorter. For normal designs it's better to use the CPU one. But he also says that for a simple ROM access I simply don't need any reading signal at all, since I'll always read the memory. So all my ROM /OE pins should be tied to ground.

 

Yes of course it's quite simpler any maybe cheaper to get an existing board, but I really do this for learning and educational purposes, so it's not a problem to spend a few hours on this. ?

 

Your advices and help are for sure very helpful for me !

 

 

  • Like 1
Link to comment
Share on other sites

On 5/13/2020 at 11:33 AM, carlsson said:

vic20-cartridge-front.thumb.jpg.4f00f038e927f5efce23eb6168cdb9bb.jpg

 

Regarding this board, look like that header pins 17 and 18 (C R/W and V R/W) are nonexistent too, which confirm our analysis.

 

 

This is the result of my reflections :

 

image.thumb.png.3a99896f8bc84654b2c597ed4d28238d.png

 

So I have, if bank 5 chosen :

Chip 1 : $A000-$A7FF, chip 2 : $A800-$AFFF chip 3 : $B000-$B7FF and chip 4 : $B800-$BFFF

 

if bank 3 : $6000-$67FF,  $6800-$6FFF, $7000-$77FF and $7800-$7FFF

  • Like 1
Link to comment
Share on other sites

1 hour ago, carlsson said:

Do you have a treasure box full of 2K EPROM chips? :)

If you call this a treasure, well actually yes ! I've got a lot of them, that's why I use them in my designs. Of course it could be simpler to use a single 8k chip, but again I created this also for learning reasons ?

  • Like 1
Link to comment
Share on other sites

I've found some ROM dumps here...

 

http://www.zimmers.net/anonftp/pub/cbm/vic20/roms/

 

But I'm not familiar with the ".prg" format. The author says that "The files are in PRG format, i.e. the first two bytes contain the starting address.". Looks like this sample starts at $A000 (witch make sense for a game to have the autostart) :

 

image.thumb.png.8dc0f1f24c40a6f580be95d585f6dfd0.png

 

This file length is actually 8194 bytes... So I think that I just have to remove the top two bytes before flashing my eproms ?

 

Link to comment
Share on other sites

  • 5 weeks later...

And.... it's a victory ! ?

 

I manage to finally assemble and test my prototype yesterday. Burning the proms, populating the board...

 

image.thumb.png.13f258936bc0197c498f689b2fc3274d.png

 

First I was a bit afraid because the board was almost completely inside the VIC, so it was not easy to probe signals with my scope. I just managed to check that the 5v and the ground seemed OK and at the good places. Then I checked some addresses contents with some PRINT PEEK and it was ok. Time to install all the chips and put the autoboot... And the game starts !

 

I was a bit confused at first : ok the game screen was here, but the computer was generating a continuous sound... I was afraid that it freezes. But after a couple of seconds the screen changed to an other one.

 

I tried the game file in an emulator, same behavior, so maybe there is a problem with "Amidar".

 

I'll try an other game to be sure, but meanwhile it looks like that my board is working fine. ?

 

A big thanks for everybody !

 

 

  • Like 1
Link to comment
Share on other sites

Ok I manage to burn chips with the 8k game "Droids", and it's a success. Sounds, music, gameplay, it works great. Absolutely same behavior between the computer and the emulator (event if I didn't exactly understand how to play ? )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...