6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Nov 12, 2024 4:57 am

All times are UTC




Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Aug 06, 2014 6:15 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Elsewhere, a question:
Druzyek wrote:
Just out of curiosity, does anything exist that plugs into the ROM socket and connects to a PC over USB so that it can quickly be reprogrammed without removing it?


I'm not aware of anything for the hobbyist. (For €300 you can get something.)

But this seems like a good project. Something like an Arduino Mega might do it - you need 5v interface, some 26 I/Os, and enough speed to obey the bus timing.
http://arduino.cc/en/Main/ArduinoBoardMega2560
At 16MHz clock speed, it should be possible to interface at 1MHz and maybe even up to 4MHz.

Possibly you could hook up a dual-port RAM for a faster solution.

One of OHO's FPGA modules might be useful, but I don't think they offer USB and would be significantly more expensive.

Any ideas?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 06, 2014 7:27 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Quote:
But this seems like a good project.
I had the same thought myself. I'm surprised the market hasn't provided a reasonably-priced solution. BTW thanks for checking availability and for starting the thread. This idea deserves to be nurtured.

Dual-port RAM sounds promising, although capacity might be a problem if it's a high-density ROM you're emulating.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 06, 2014 7:56 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Looks like a 40-pin PIC16 might have enough I/Os and CPU speed to do the trick - and therefore probably some higher-end PICs too. I would expect to find a mini dev board in DIL format, but haven't yet found one. Maybe something like this
http://proto-pic.co.uk/dl40-module-daisylink/

The Teensy 3.1 is a small ARM-based board, about $20, 5V tolerant and with enough I/Os.
https://www.pjrc.com/teensy/teensy31.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 06, 2014 8:11 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8539
Location: Southern California
ROM emulators were common back when software development was commonly done in EPROMs, to get a quicker cycle than removing the EPROM and putting it in the eraser, taking another one, putting it in the programmer, sending your software to the programmer, programming the EPROM, and then moving it to your board. Instead, the PC would just send the software to the ROM emulator, eliminating the plugging and unplugging, erasing, and programming parts of the cycle.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 06, 2014 8:27 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
This would be a neat project which is why I was asking! In my opinion, it would be better to use a parallel SRAM so that it can work close to top speed and only use the microcontroller for programming. I seriously doubt you could get 4MHz out of a 16MHz chip and 1MHz might even be pushing it. You could also add a backup battery to the SRAM. The problem with doing it like this would be isolating the RAM from the bus while the microcontroller was programming it (assuming the system itself is halted but still powered on). Something like a 74AC244 would work but adds about 7ns to propogation delay. I don't know how fast the SRAM would need to be to accomodate the extra delay. Physical switches like dip switches could also work to isolate everything but that might add a lot of bulk to it. In any case, it would be a neat project.

EDIT: Why the dual-port RAM? Those tend to be very expensive. One port for the system and one for programming?
http://www.mouser.com/ProductDetail/IDT/7007S20PF/?qs=sGAEpiMZZMt9mBA6nIyysK6VW3GrAnba8mt%2flbIVCXI%3d
http://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY7C006A-20AXC/?qs=sGAEpiMZZMt9mBA6nIyysIT6PXTPi%2fj%2fCge8OXdnpnw%3d


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 06, 2014 8:40 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Yes, two ports so you don't need to isolate. 16kx8 should be big enough - that's £5.40

Edit: oops, looks like that's only 16kbit. See corrections below.


Last edited by BigEd on Fri Aug 08, 2014 8:40 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 8:05 am 
Offline
User avatar

Joined: Fri Oct 31, 2003 10:00 pm
Posts: 200
I have such an EPROM emulator, a design by the dutch magazine Elektor in the 80ties. Attached to the parallel port of the PC.
Works fine upto 1 or 2 MHz clock speeds.
It is the usual design with TTL and 6116 SRAM.

With EEPROM and ZIF sockets I do not use it often.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 8:38 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
(Hopefully such a parallel-port connected device doesn't demand much of the parallel port, and will work with a USB-printer adapter, for those of us who no longer have a parallel port.)

But you remind me, richarde had constructed an I2C-connected emulator called ROMBO:
Attachment:
RomboUpgradeMed.jpg
RomboUpgradeMed.jpg [ 41.39 KiB | Viewed 510 times ]

which we used in the beeb816 project.

Also, I see BitWise has found a couple of pointers to contemporary industrial-strength devices:
BitWise wrote:


Last edited by BigEd on Fri Oct 21, 2022 7:16 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 8:45 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
HansO wrote:
I have such an EPROM emulator, a design by the dutch magazine Elektor in the 80ties. Attached to the parallel port of the PC.
Works fine upto 1 or 2 MHz clock speeds.
It is the usual design with TTL and 6116 SRAM.

With EEPROM and ZIF sockets I do not use it often.


Here's the article, from December 1989:
http://techdoc.kvindesland.no/radio/yms ... 510828.pdf

Here's some info on a successor device, from Elector of September 1992:

Image

And another one from 2001 (serial-connected).

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 9:37 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Shouldn't need much to build one.

A RAM chip to hold the data
3x tristate line drivers/buffers to all allow the targets address and data lines to be isolated when changing the RAM contents
A GAL chip to arbitrate target and host access control signals
A micro-controller to load the RAM chip via USB or UART

Definely less than $300. Probably less than $30 on strip board.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 10:18 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Do you think a bare PIC could do it? It needs only to pay attention to OE (and CS) and perform a lookup.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 10:48 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
BigEd wrote:
Do you think a bare PIC could do it? It needs only to pay attention to OE (and CS) and perform a lookup.

Potentially something like ..
Code:
Inactive:
 setf TRISD  ; Tristate data bus
InactiveWait:
 btfsc PORTE,CS  ; Wait for /CS
 bra InactiveWait
 btfsc PORTE,OE  ; And /OE
 bra InactiveWait

Active:
 movf PORTA,W  ; Map address to ROM image
 movwf TBLPTRL
 movf PORTB,W
 andlw h'1f'  ; Mask on ROM size
 addlw high(ROM_BASE)
 movwf TBLPTRH
 tblrd *  ; Fetch data byte
 movf TBLDAT,W
 clrf TRISD  ; Set output
 movwf LATD
ActiveWait:
 btfsc PORTE,CS  ; Wait for /CS or /OE to change
 bra Inactive
 btfsc PORTE,OE
 bra Inactive
 bra ActiveWait

You could do the address mapping while waiting for CS and OE to go LO if the address is stable before these signals change.

Might work at 1Mhz.

It would be easier with a dsPIC 30F but you'd need to use a TQFP package with 64 pins or more. The port bit arrangement on the 40pin DIP 30Fs is not very convenient for mapping the data and address lines. The bigger packages, like 30F6012A, have a better port arrangement and using PSV memory makes the ROM lookup quicker.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 11:18 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
In an ATMega it could look like this:
Code:
wait_cs:                ;#.# = cyles in this section, 62.5ns @ 16MHz
   sbic  cs_port,cs_bit ;5.5 wait for cs loop, 3 latency + 2.5 if cs
   rjmp  wait_cs
   out   dbusddr,allon  ;1 output enable
   in    zl,abuslo      ;2 get address
   in    zh,abushi
   sbi   zh,-offset     ;1 add page offset to ROM/flash address
   lpm   temp,z         ;3 load data from flash
;  ld    temp,z         ;  (2) alternativly load from RAM (limited)
   out   dbus,temp      ;1 data valid at the end of this cycle
;  nop...               ;x add fixed data valid cyles or wait for cs off
;     ...nop
   out   dbusddr,zero   ;1 output enable off
   rjmp  wait_cs
It would take a maximum of 13.5 cycles (almost 850ns@16MHz) for data to become valid after chip select was applied. You could do it only, if you run the target processor at reduced speed.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Last edited by Klaus2m5 on Thu Aug 07, 2014 11:27 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 11:25 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Thanks for the proofs of concept. A pity it takes so many cycles!


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 07, 2014 9:48 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
Wow, you guys are really on the ball. Too bad just a microcontroller is not fast enough.

BigEd wrote:
Yes, two ports so you don't need to isolate. 16kx8 should be big enough - that's £5.40


Can you give us a link?

I think with SMD parts you could almost fit the RAM, microcontroller, and UART chip (like FT232) onto a DIP 40 breakout.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: