Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Arduino-based 1541 emulator. Possible?
2013-04-22 10:47
Flavioweb

Registered: Nov 2011
Posts: 463
Arduino-based 1541 emulator. Possible?

Talking about Arduino with an hw-hacker father of a friend, i started to thinking about on how to build a full-compatible 1541 clone (6510, cia, ram, etc...) using Arduino hw.
I found this 6502 emulator:
http://www.df.lth.se/~richard/6502emu2.pde

May be possible to build a full sd card reader fully 1541 compatible (for low level drive programming)?
2013-04-22 11:51
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
anything is possible, if the Arduino has possibility for interfacing to the C64. (user/serial ports)

i suspect it has not, and you have to solder a usb interface to the c64 no ?
2013-04-22 13:12
lft

Registered: Jul 2007
Posts: 369
Quoting Flavioweb

I found this 6502 emulator:
http://www.df.lth.se/~richard/6502emu2.pde


This 6502 emulator is not cycle-exact. You would probably have to write a 6502 emulator in assembly language. This could very well be possible on a 20 MHz AVR, but don't forget you also have to emulate four 16-bit latched timers that are updated every microsecond.

SIDwave: Whatever the problem is, it's not the electrical interfacing.
2013-04-22 13:13
Fierman

Registered: Feb 2002
Posts: 85
interfacing is the least of your problems. timing and speed are, and you can just forget about using an older atmel based arduino for this purpose. it won't do.
2013-04-22 17:55
Krill

Registered: Apr 2002
Posts: 2980
I also doubt that it's possible at all with 20 MHz.
There will be lots of issues concerning updating all internal state (as lft said) while operating in a very tight serial input-to-output response time frame.
We're talking about less than 20 AVR cycles per 6502 cycle for emulation of not only the 6502 but also a few other chips and glue logic here.
Better go for something faster.
2013-04-22 18:49
chatGPZ

Registered: Dec 2001
Posts: 11386
<Post edited by chatGPZ on 22/4-2013 21:19>

ppl have tried it with faster (100mhz) embedded systems - with little success. the problem is that the timing must be cycle exact in relation to the "outside world" - which is close to unpossible unless you have virtually "unlimited" resources.

or if you just want to hear that it can be done, easily - ask jim drew on lemon =)
2013-04-22 18:50
WVL

Registered: Mar 2002
Posts: 902
I've got some experience with AVR's and there's no way you could do an emulation of the 1541 hardware on an Arduino (with AVR chips). You could probably do an IEC emulation and support generic load/save/getbyte commands, but that would be about all. Another problem is the amount of memory that's available : the Nano and Uno only have 2KB of memory, the Mega still only has 32KB... Having no memory means you have to read really fast from SD at the same time when you have to be really precise with your timing to communicate with your 64, impossible.

I even doubt it would be possible with the new Due that has a cortex M3 @ 84MHz, and that one also only has 96KB, still not even close enough to hold a single .d64..

Forget it.

It's not for nothing that the ultimate and chamelon are FPGA based..
2013-04-22 19:05
Krill

Registered: Apr 2002
Posts: 2980
Quoting Groepaz
the timing must be cycle exact in relation to the "outside world" - which is close to unpossible unless you have virtually "unlimited" resources.

This sounds a bit funny. Care to elaborate?
2013-04-22 19:24
chatGPZ

Registered: Dec 2001
Posts: 11386
"This sounds a bit funny. Care to elaborate?"
just a failed attempt to say "We're talking about less than 20 AVR cycles per 6502 cycle for emulation of not only the 6502 but also a few other chips and glue logic here. Better go for something faster." :=)

PS: http://www.forum64.de/wbb3/board65-neue-hardware/board284-masse..
2013-04-22 19:53
Skoe
Account closed

Registered: Jan 2008
Posts: 34
I started to do it with an XMOS at about 400 MIPS shared among 8 Hardware-Threads some years ago (This one: XS1-L6A-64-TQ48). It was a mixture of C Code and Assembly. The I/O-Timing was sub-cycle accurate (+/- 100 ns AFAIR, compared with a logic analyzer to the real thing) and many fast loaders worked already. But only the ones that used the subset of the VIAs I implemented ;)

When I started another refactoring of my code I lost the patience and suspended the project - possibly forever.

What I can say today: I used less than 50% of the processing power and the code wasn't well optimized. So it is quite sure that it is doable on that controller. But I am sure it is not possible on < 100 MIPS with a compatibility of e.g. a 1541U. Today I think the cheapest solution that would be no pain in the ass to implement (compared to the evilness of sub-µs realtime on a controller) with > 99% compatibility could be based on a low-cost ARM controller (e.g. LPC13xx) for high-level tasks and a very small FPGA for CPU/VIAs/Head etc.

But as there is the 1541U/Chameleon for high compatibility and the sd2iec/arm2iec for low cost I'm not interested in another solution anymore.
2013-04-22 20:22
Krill

Registered: Apr 2002
Posts: 2980
Quoting Groepaz
if you just want to hear that it can be done, easily - ask jim drew on lemon =)

Trying to ignore that guy, he uses to claim having done all sorts of drive feats but _always_ fails to deliver code or details, taking forever to find lost source codes etc.
 
... 28 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Dr. Doom/RAD
Scrap/Genesis Project
Guests online: 93
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.053 sec.