Jump to content
Yoruk

Simple way to interface EEPROM on a VIC20

Recommended Posts

Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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...

 

 

Share this post


Link to post
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.

Share this post


Link to post
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.

 

 

Share this post


Link to post
Share on other sites

I realized the cell phone camera is better suited at taking closeups of circuit boards than putting it in the scanner. This board is wired to take two 2532 chips (or 2332 ROM, I assume) for a total of 8K going into $A000.

 

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

 

vic20-cartridge-back.thumb.jpg.3d68ce94675772ba5592f440f0c5c069.jpg

 

Share this post


Link to post
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.

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Do you have a treasure box full of 2K EPROM chips? :) I would've thought you would move towards 8K 2764 chips to reduce the number of chips, traces and vias.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Here is the finished board :

 

image.thumb.png.4a82722e99031f2ca0e547a84e4d78c4.png

 

It was not easy due to the chip configuration. I choose to put them like instead of a single row, it was a bit easier to route !🙂

 

  • Like 1

Share this post


Link to post
Share on other sites

Nice. I suppose bank 3 mode would be useful if you want to make your own cartridge with e.g. Programmer's Aid ($7000-$7FFF) and VIC-MON ($6000-$6FFF).

Share this post


Link to post
Share on other sites
Posted (edited)

Well I choose bank 5 to have an autostart feature and 3 to not have it. If this bank can also be used for existing codes that's even better !

Edited by Yoruk

Share this post


Link to post
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 ?

 

Share this post


Link to post
Share on other sites

Yes, that is exactly how it works. A PRG file contains the load address in the format low, high byte and then the data as a binary.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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 😊 )

Share this post


Link to post
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.

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...