Electronics, coding and hacking. And ADD.

« Away with the breadboard It's a mess, and no success »

Ok, now we're talking...


I'm almost where I left off with the previous cartridge project. I've got the micro controller hooked up on the C64's bus, and it's respectful enough to let the C64 run flawlessly as if it's not there.

Now, the C64 is kind enough to throw the CE line low once the cartridge is needed. I intentionally thought it would be a good idea to let the INT0 external interrupt handle this job, but it was in fact too slow. It seems like it needs about 3-400ns longer to wake up, compared to the ole' test-bit-and-loop method.

[Ninja edit:This is confirmed in the ATmega128's datasheet. External interrupts consume 4 clock cycles to trigger, which means 62.5ns*4=250ns wasted just waiting]

There are still some timing issues, and I will deal with them somehow. As you can see on the screenshot below, the number I'm outputting is 255. Whenever you see something else, it means the timing is off. Still a little tweaking left to do:

Output from the C64 BASIC program

Here you see the cartridge emulator hooked up to the system. Green wires (to PA0..7 and PF0..6) are used for the address bus, yellow wires (PD0..7) for the data bus.

Not for the faint of heart.

Not much code to speak of, either. This is all there is at the moment, and I would say it nails it about 90% of the time. I might have to overclock to get it up to 100%:

Minimal code. Now, to optimize it.

[Ninja edit 2: Timing issues sparked a new idea, so now I have plans for a different approach. Stay tuned.]


to Ok, now we're talking...

Feed for this Entry


    There are currently no comments.

About You

Email address is not published.

All messages must be validated by the admin.

Spam messages or messages containing URLs linking to spam, will never be published.

Add to the Discussion

Add to Google