The glitches when typing on the keyboard remind me of the Sinclair ZX80 and 81 which did similar things when typing (and for similar reasons!). Interestingly, the Raspberry Pi Foundation's Pico board (similar to the Arduino in its main function, but with more RAM and speed, but only about $4!) can do emulation surprisingly well. For example, here's NES and Gameboy: ua-cam.com/video/FB4kOBt8ARo/v-deo.html and BBC Micro: ua-cam.com/video/WaPJmCgseQw/v-deo.html
Great job! I just tried and it works like a charm! I would like to port it on an ESP32, may be it is even possible to add a storage on a micro SD... you got my subscription!
The Commodore 64 was handy for ALL sorts of things. One of the most amusing I discovered was in one of the typical "Computer Stores" back in the 1980's that sold IBM PC's and such. They had a Kiosk with a video display and some big buttons you push and it would give you varioius IBM PC sales pitches. I wondered what they were using and opened the door at the front of the cabinet bottom. This IBM PC sales display had a big laser disk controlled by (drumroll please) a Commodore 64.
Pretty impressive seeing an 8 bit MCU emulating an 8 bit microprocessor with a sensible performance. Especially as most of its time is spent spitting out composite video.
Impressive. I would love to see that on an ESP32. There you have enough SRAM and the second core or maybe even the ULP core could handle the composite signal
It seems that the ESP32 clock speed should be around 10 times that of the arduino at 160MHz. That means maybe emulating at the same or faster effective speed as compared to the original 6502
The ulp runs at 8mhz, but the instructions gobble many cycles each, as far as I know interrupts aren't supported but it might run as a continuously timed scan, which I'd be interested to find out more
I want to congratulate you on this excellent video I am proud that channel topic like this can initiate so many smart people to react and response... you have them all ;) Thank you and good luck !
This keyboard interrupting screen looks very similar to Sinclair ZX80 but there anything CPU did caused screen to go bonkers and not only key presses. In any way this is pretty cool idea and execution is flawless.
Amazing. You can look to ZX81 - there CPU also displayed screen but it has two modes FAST and SLOW in FAST screen flickered when typing but in SLOW not. I don't remeber exactly, but i think other code than display was execeuted only in horizontal and vertical return time for SLOW mode and there was not flickering. or other words other interruputs was only enabled then.
Im curious... since you can emulate the 6510 and the arduino has various GPIO pins... would it be possible to use the 6510 emulation (without basic and all the other stuff) as a drop in replacement for a real 6510 cpu. it runs at 16mhz, so perhaps its doable
@@DoctorVolt Thats quite interesting. Imagine a 64 developed and running on just emulated chips. Although accessing external memory (another emulated series of chips) might be slow
Hi Guy! Thank you and so good... Only, There is an error in what you say at the minute 4:20. What you show there, is the video signal of a SINGLE HORIZONTAL LINE of an image. In a CRT screen, the electron beam paint the ENTIRE screen 50 TIMES PER SECOND, and EACH TIME it traces 625 LINES! So, on balance, it runs through a SINGLE LINE of screen in only 64 MICROseconds (and not 64 MILLIseconds, as you said) which is 1000 times faster. Bye!
I tried it out. Amazing job! It's great, but when I wire up the keyboard, the screen lags A LOT, and the keyboard doesn't work.. Can you help me troubleshoot this?
A little OT question: how did you compile the VIC-20 sketch? I got this error and I don't know how to fix it... cpu.c:64:1: error: unknown type name 'prog_uchar' cpu.c:64:12: error: size of array 'BIOS' is too large exit status 1 unknown type name 'prog_uchar'
@@DoctorVolt thank you! I changed as "const uint8_t " and it compiled... however, as you told, it doesn't work (while yours, for C64, works perfectly!) Would you make a video (or at least leave here some info) about how to fix this problem for the VIC-20 project?
Really great job! It is fantastic that these days is possible to take 3$ board and experiment and simulate / emulate devices which costs month salary before yr 2000.
That said, the original 6502 CPUs ran at ~1 MHz and early home computers used DRAM memory (early ram design, pretty slow and the contents must he routinely refreshed). And the ROMs were directly accessible because they occupied the main memory space. So even a "simple" atmega 328 is quite powerful by comparison. Most Arduinos (and compatible boards) using an 8-bit AVR design run at the full 16 MHz the chip is rated for and the 328 has 2K of on-board SRAM (fast and doesn't need refreshing) as well as 32K of flash memory for the program binary. In addition, being a Harvard Architecture, the program and data memory are on entirely separate buses and therefore accesses are probably faster.
Suggestion: why not to make a similar project for PET? You already have the code for 40 columns, it should be just a matter to remap the ROM images...? Since you know perfectly the code you wrote, should be an easy task for you, I suppose...
Yes, in fact this can emulate any Commodore computer with a 6502 or 6510. But I think that a video where I emulate other computers does not make much sense, because this works similar and it might become boring if I tell the same things in every video.
@@DoctorVolt I understand and agree with your point of view. However there's a big plus, making a PET emulator: you can use it to build a working mini-PET clone (the first PET was sold with just 4kB RAM), using a 3D printer for the case. AFAIK this was done using a Raspberry, but never using an Arduino - that would be a great project, also because it's a 3$ hardware instead of 40$. BTW I tried to replace the ROM images, but of course it didn't work :,-(
couldnt you take a second arduino to read the keyboard and then feed the keystrokes to the first arduino using serial port. That may fix screen dropout.
probably most amazing video that i've watched this year, and i am writing this comment in december ;d i can't tell if cpu emulation was neatest or adding PS/2 keyboard support working in same way as on this ZX80 thingie, stealing video out interrupt time to service keyboard routine :D lovely!
Maybe that's due to the fact that I am not a native speaker and read from script. But anyway, I think that an old movie robot voice fits well to an 80's computer video.
@@TalpaDKI'm pretty sure this video directly contradicts your assertion, at least to some extent. An arduino can easily emulate the 6502 cpu, some ram, run BASIC, and do composite video output. The C64 can do quite a lot more, but to really exercise the hardware requires assembly programming and knowledge on how to make the best use of the dedicated video and sound chips. -------- Technically the Arduino IS an 8-bit computer since it has an internal CPU, RAM, Storage, and I/O facilities.
The PICO has more RAM, runs at 133Mhz and should be able to delegate all that interrupt shift register stuff to PIO, so would probably make a far better emulator.
Really amazing!!!! What about to use an Arduino Due, that should have everything needed (Flash, RAM and SDcard support) to get closer to a 100% emulation? Do you thinkg is it possible? I used the Due for another project, a 100% Altair 8800 emulation with 64 kb RAM etc., so maybe it could also emulate the C=64, loading the programs from the SD card (as for the Altair-Duino project)
The C64DTV is based on an ASIC single chip implementation of the Commodore 64 with enhancements, it does NOT use emulation the C64’s chips are implemented in the C64DTV’s ASIC chip.
Hello Dr volt , I try to run the sketch on nano but no video signal. I checked the signal , resistors but no results. Is this related to any Arduino ide update ?
No, it also works with 1N14148, but a schottky diode like BAT48 makes better video signal quality. Maybe the reason is that your TV/monitor just doesn't accept the video signal.
I tested the Arduino TVout library and worked fine. Also I checked the signal on the oscilloscope and it’s similar to your signal but not working in the tv. Anyway, thanks for your responses.
Donnerwetter - Hut ab, vor so viel Wissen! Wie lange benötigt man, um sich so ein Wissen anzueignen? Ich habe damals ja auch mit dem "Brotkasten" gezockt, aber nie was mit Elektronik gemacht. Jetzt würde ich, auf meine alten Tage, gerne mal in das Hobby reinschnuppern. Ist das nun zu spät? Frage an den Fachmann: Chris Hülsbeck, berühmter Musiker auf dem C-64, hat wohl damals zwei Musik-Stimmen mehr aus den C-64 Bausteinen geholt, als Commodore vorgesehen hatte. Da muss doch ein gigantisches Wissen hinterstecken, oder? Wie macht man so etwas?
Jahrelange Erfahrung. Habe mich als Kind schon für Technik interessiert, dann entsprechend Studium, jahrelang in der Entwicklung gearbeitet und natürlich selbst auch immer gebastelt und programmiert.
hey man im trying to make something like this with a 16 x 4 lcd and a wireless usb keyboard im a beginner and dont know arduino coding so... i was wondering if you could help me out here...
The keyboard used here must be PS/2 or a PS/2 compatible USB keyboard. Wireless keyboards (at least the one that I tried) are not PS/2 compatible. So I see no chance there.
Great project! Mapping RAM to EEPROM is a bad idea... not because of write cycles but because EEPROM is terribly slow on AVR... BTW whats the music on the end?
This was just amazing. So cool to see!! Awesome work I’ll need to give this a try!
Hi Adrian! If you ever do, please consider making a video about it as well :)
@@thealienontheinternet That is a good idee
Adrian, this is definitely right up your street ❤
I think you could compress the roms , and use the saved flash as ram (many microcontrollers can modify their flash, but it may come with a speed cost)
The glitches when typing on the keyboard remind me of the Sinclair ZX80 and 81 which did similar things when typing (and for similar reasons!). Interestingly, the Raspberry Pi Foundation's Pico board (similar to the Arduino in its main function, but with more RAM and speed, but only about $4!) can do emulation surprisingly well. For example, here's NES and Gameboy: ua-cam.com/video/FB4kOBt8ARo/v-deo.html and BBC Micro: ua-cam.com/video/WaPJmCgseQw/v-deo.html
I can't believe that's possible! Amazing! Thanks for showing this off.
Great job! I just tried and it works like a charm! I would like to port it on an ESP32, may be it is even possible to add a storage on a micro SD... you got my subscription!
The Commodore 64 was handy for ALL sorts of things. One of the most amusing I discovered was in one of the typical "Computer Stores" back in the 1980's that sold IBM PC's and such. They had a Kiosk with a video display and some big buttons you push and it would give you varioius IBM PC sales pitches. I wondered what they were using and opened the door at the front of the cabinet bottom. This IBM PC sales display had a big laser disk controlled by (drumroll please) a Commodore 64.
Wow, awesome work! Maybe try the Arduino Zero next? Way more RAM plus DMA which would save you a lot of time drawing the screen.
Right, almost every microcontroller can do this faster and better than an Arduino. I think it´s no big deal to port this to other MCUs, too.
The revenge of the ZX80 video circuitry on Commodore, channelled by Arduino.
Should be ported on ESP32 ASAP.
Pretty impressive seeing an 8 bit MCU emulating an 8 bit microprocessor with a sensible performance. Especially as most of its time is spent spitting out composite video.
Impressive. I would love to see that on an ESP32. There you have enough SRAM and the second core or maybe even the ULP core could handle the composite signal
The ESP could easily do it - it's already been used to run arcade emulators that used the 6502 and the Z80 CPUs (e.g. NES emulation)
It seems that the ESP32 clock speed should be around 10 times that of the arduino at 160MHz. That means maybe emulating at the same or faster effective speed as compared to the original 6502
Check out the Odroid Go, it's an ESP32 in a Gameboy-like case. It can emulate a c64, and some other 8bit stuff.
The ulp runs at 8mhz, but the instructions gobble many cycles each, as far as I know interrupts aren't supported but it might run as a continuously timed scan, which I'd be interested to find out more
I wonder what could be achieved with an Arduino DUE?
Wow
I want to congratulate you on this excellent video
I am proud that channel topic like this can initiate so many smart people to react and response... you have them all ;)
Thank you and good luck !
I think a better one could be done on an ESP32 .. please do :D
Commodore fan enjoys ZX80 typing experience.
Very nice... next use a STM32Fxxx
I also like the way you hooked up the power supply with the wire bridge on the breadboard. Thanks for this tip.
That interrupt on the video brings me back to the time of the ZX80 :D
NIce, if I only had time
Fantastic!!!!
Fun. I like.
Ammazing!
good job
This is amazing. Thanks so much for sharing this--I would never have found it.
Typing is just like on a ZX80, no screen update while in the keyboard handler...
Cue the haters .. anyway, this looks like a neat project, can’t wait to try it this week. Thank you for sharing.
@7.00 what's the music? Gribbley's Day out or something by Rob Hubbard?
"Sraiduino" is a crap!
Even if there is DMA, it doesn't use it!
This keyboard interrupting screen looks very similar to Sinclair ZX80 but there anything CPU did caused screen to go bonkers and not only key presses. In any way this is pretty cool idea and execution is flawless.
Great video!! Thank you for sharing this great experience with us.
Nice demonstration how to generate video signals using an Arduino!
An UDOO RYZEN Bolt V1000 Maker Board SBC with built in ARDUINO functionality might be the way to go.
Nice job, even did the graphics under Software control, 👍👍👍
Amazing.
You can look to ZX81 - there CPU also displayed screen but it has two modes FAST and SLOW in FAST screen flickered when typing but in SLOW not.
I don't remeber exactly, but i think other code than display was execeuted only in horizontal and vertical return time for SLOW mode and there was not flickering.
or other words other interruputs was only enabled then.
Im curious... since you can emulate the 6510 and the arduino has various GPIO pins... would it be possible to use the 6510 emulation (without basic and all the other stuff) as a drop in replacement for a real 6510 cpu. it runs at 16mhz, so perhaps its doable
Yes. An Arduino Mega has enough ports to emulate all the pins of a 6510
@@DoctorVolt Thats quite interesting. Imagine a 64 developed and running on just emulated chips. Although accessing external memory (another emulated series of chips) might be slow
I did this with a Teensy on the MicroCore Labs MCL64
Squeezing C64 memory into EEPROM. that new to me
Thank you soooo much. Well this project give us a start of dreaming to go further
As always, a short and clear video where all of the content is interesting and useful. Very nice!
nice! SUB'd. make it full hw emulation. usb keyboard. video out. 😁
That's awesome! Subbed.
A question, for the keyboard mapping, how did you translate from the serial protocol. Or how did you map the keyboard into the VIC/C64 OS.
I explain in this video: ua-cam.com/video/F1rKhW-UAfM/v-deo.html
Why is this video not available?
Hi Guy! Thank you and so good...
Only, There is an error in what you say at the minute 4:20.
What you show there, is the video signal of a SINGLE HORIZONTAL LINE
of an image. In a CRT screen, the electron beam paint
the ENTIRE screen 50 TIMES PER SECOND, and EACH TIME it
traces 625 LINES! So, on balance, it runs through a SINGLE LINE
of screen in only 64 MICROseconds (and not 64 MILLIseconds,
as you said) which is 1000 times faster.
Bye!
I know, but it is no more possible to change
Impressive work.
Wouldn't it be possible to link Arduino together to increase the calculation capabilities?
Sure, you could use one Arduino to emulate the processor, and a second one for video signal generation. And maybe even a third one for sound.
no color output. probably no sprites.
I LOVE MY C64 ❤❤❤ FOREVER ❤❤❤
Really cool project :-) Looking forward to try it out on my own :-) !
Hmm maybe I should do this on a teensy
What's about Gameduino, C-64 Basic is it compatible with Arduino?
Not natively. But my C64 emulation runs C-64 Basic, of course.
Take for emulation the C64 a ESP32. You can interpret basic programs from flash memory and the Speed is.spectacularly
Should not be too difficult to port this to an ESP32. The real challenge is however to squeeze every bit of power out of the Atmega.
@@DoctorVolt , I believe there are solutions to emulate a 6502 with VGA output and PS2 input. A C64 is not far away.
A total waste of time.
I tried it out. Amazing job! It's great, but when I wire up the keyboard, the screen lags A LOT, and the keyboard doesn't work.. Can you help me troubleshoot this?
Maybe you have connected it the wrong way or it does just not support PS/2.
@@DoctorVolt Hello. I sent you an email, may you answer please? Thanks.
What about the user interface (input/output pins), is it functional? Can I control LEDs etc. with it?
Not in the current state, but this can be implemented in the Arduino program.
A little OT question: how did you compile the VIC-20 sketch? I got this error and I don't know how to fix it...
cpu.c:64:1: error: unknown type name 'prog_uchar'
cpu.c:64:12: error: size of array 'BIOS' is too large
exit status 1
unknown type name 'prog_uchar'
Rename it to uint8_t and it will compile.
@@DoctorVolt thank you! I changed as "const uint8_t " and it compiled... however, as you told, it doesn't work (while yours, for C64, works perfectly!)
Would you make a video (or at least leave here some info) about how to fix this problem for the VIC-20 project?
Love it....
Truly amazing, great video.
Really great job! It is fantastic that these days is possible to take 3$ board and experiment and simulate / emulate devices which costs month salary before yr 2000.
That said, the original 6502 CPUs ran at ~1 MHz and early home computers used DRAM memory (early ram design, pretty slow and the contents must he routinely refreshed). And the ROMs were directly accessible because they occupied the main memory space.
So even a "simple" atmega 328 is quite powerful by comparison.
Most Arduinos (and compatible boards) using an 8-bit AVR design run at the full 16 MHz the chip is rated for and the 328 has 2K of on-board SRAM (fast and doesn't need refreshing) as well as 32K of flash memory for the program binary. In addition, being a Harvard Architecture, the program and data memory are on entirely separate buses and therefore accesses are probably faster.
Suggestion: why not to make a similar project for PET? You already have the code for 40 columns, it should be just a matter to remap the ROM images...? Since you know perfectly the code you wrote, should be an easy task for you, I suppose...
Yes, in fact this can emulate any Commodore computer with a 6502 or 6510. But I think that a video where I emulate other computers does not make much sense, because this works similar and it might become boring if I tell the same things in every video.
@@DoctorVolt I understand and agree with your point of view. However there's a big plus, making a PET emulator: you can use it to build a working mini-PET clone (the first PET was sold with just 4kB RAM), using a 3D printer for the case. AFAIK this was done using a Raspberry, but never using an Arduino - that would be a great project, also because it's a 3$ hardware instead of 40$.
BTW I tried to replace the ROM images, but of course it didn't work :,-(
with no graphics and sound chip behavior it would make for a Commodore Pet emulator
With the appropriate ROM it can also emulate a PET
Interessant.
With a raspberry pi pico you probably could emulate a full c64
Maybe I'll give it a try 🙂
Impressive. Well done!
Amazing!
couldnt you take a second arduino to read the keyboard and then feed the keystrokes to the first arduino using serial port. That may fix screen dropout.
no, because the arduino still has to interrupt the video output to process the input.
@@DoctorVolt yea, never thought of that.
Flabbergasted. That this is even remotely possible didn't even cross my mind. It's like art. 'i could have painted white on white' 'but you didn't'
hi eine Datasetten erweiterung wäre cool
probably most amazing video that i've watched this year, and i am writing this comment in december ;d
i can't tell if cpu emulation was neatest or adding PS/2 keyboard support working in same way as on this ZX80 thingie, stealing video out interrupt time to service keyboard routine :D
lovely!
very cool
The voice reminds me of a robot talking in one of those old movies.
Maybe that's due to the fact that I am not a native speaker and read from script. But anyway, I think that an old movie robot voice fits well to an 80's computer video.
Wow!
Wohooowwwww. Great Work. Amazing Masterpiece. Great!
Wow... I never imagine that Arduino can emulate an 8bit computer!!
Well actually the Adruino can't emulate an 8bit computer (not an C64 anyway) its not even close to emulating a C64.
@@TalpaDKI'm pretty sure this video directly contradicts your assertion, at least to some extent. An arduino can easily emulate the 6502 cpu, some ram, run BASIC, and do composite video output.
The C64 can do quite a lot more, but to really exercise the hardware requires assembly programming and knowledge on how to make the best use of the dedicated video and sound chips.
--------
Technically the Arduino IS an 8-bit computer since it has an internal CPU, RAM, Storage, and I/O facilities.
Maybe you can make a cartridge bus as wel.
This makes no sense here, because the Arduino here emulates only a subset of a real C64
In my book, people with your skills should be the ones driving those cars.
A version for the PI PICO will be so nice
The PICO has more RAM, runs at 133Mhz and should be able to delegate all that interrupt shift register stuff to PIO, so would probably make a far better emulator.
4:41 should say 64µs instead of 64ms
Ok, that´s right
Nice😄
is it possible to do this on arduino uno r3??
Of course.
ich habe das auf dem Mega laufen ich würde das gerne auf einem LCD Display anzeigen lasse einer ne Ahnung wie das geht?
Leider nicht. Hab bisher noch nichts mit Arduino-LCDs gemacht
But can it run "Hello, world!" ?
Yes, it can.
Really amazing!!!!
What about to use an Arduino Due, that should have everything needed (Flash, RAM and SDcard support) to get closer to a 100% emulation? Do you thinkg is it possible? I used the Due for another project, a 100% Altair 8800 emulation with 64 kb RAM etc., so maybe it could also emulate the C=64, loading the programs from the SD card (as for the Altair-Duino project)
I think that it will not be difficult to port this to an Arduino Due
Cool stuff. Brings back memories.....
For the rest of your life, you don't need to do anything to deserve more cool credits. So cool.
The C64DTV is based on an ASIC single chip implementation of the Commodore 64 with enhancements, it does NOT use emulation the C64’s chips are implemented in the C64DTV’s ASIC chip.
Sure, there are many ways to emulate a C64. But in case of an ASIC I would not say emulation.
Hello Dr volt ,
I try to run the sketch on nano but no video signal. I checked the signal , resistors but no results.
Is this related to any Arduino ide update ?
I just tried with the newest Arduino IDE, V2.3.2 and everything worked fine. Maybe there is something wrong with your Arduino.
Is it possible that no video signal due to use of N14148 diode instead of Bat48
No, it also works with 1N14148, but a schottky diode like BAT48 makes better video signal quality. Maybe the reason is that your TV/monitor just doesn't accept the video signal.
I tested the Arduino TVout library and worked fine. Also I checked the signal on the oscilloscope and it’s similar to your signal but not working in the tv.
Anyway, thanks for your responses.
Good!! what about the colour?
Color is not possible as the Arduino has only one shift register.
did that several times :) the last one was a VNC-enabled C64 over WiFi
ua-cam.com/video/xprLuqoh4FE/v-deo.html
and ua-cam.com/video/g-6loMjgGNQ/v-deo.html
Unfortunately not in English
@@DoctorVolt ah yeah, but you can get the point from the videos and can answer in here :)
Donnerwetter - Hut ab, vor so viel Wissen!
Wie lange benötigt man, um sich so ein Wissen anzueignen? Ich habe damals ja auch mit dem "Brotkasten" gezockt, aber nie was mit Elektronik gemacht. Jetzt würde ich, auf meine alten Tage, gerne mal in das Hobby reinschnuppern. Ist das nun zu spät?
Frage an den Fachmann: Chris Hülsbeck, berühmter Musiker auf dem C-64, hat wohl damals zwei Musik-Stimmen mehr aus den C-64 Bausteinen geholt, als Commodore vorgesehen hatte. Da muss doch ein gigantisches Wissen hinterstecken, oder? Wie macht man so etwas?
Jahrelange Erfahrung. Habe mich als Kind schon für Technik interessiert, dann entsprechend Studium, jahrelang in der Entwicklung gearbeitet und natürlich selbst auch immer gebastelt und programmiert.
@@DoctorVolt Ohhh... das ist nebenher im Hobby natürlich nicht aufzuholen. Vielen Dank für Deine rasche Antwort und Deinem Video!
would be interesting to see this on a teensy 4.1
Wow. Amazing. 👍👍👍
I love it! What a fun project.
What a fantastic video. Loved it. Thankyou
I think it is better to add another microcontroller for the keyboard instead of using interrupt
wow thats impressive!! can you play games with this setup?
Very simple and small games may run. For the common C64 games it has too many limitations.
Super cool project! Well done!
hey man
im trying to make something like this with a 16 x 4 lcd and a wireless usb keyboard
im a beginner and dont know arduino coding so...
i was wondering if you could help me out here...
The keyboard used here must be PS/2 or a PS/2 compatible USB keyboard. Wireless keyboards (at least the one that I tried) are not PS/2 compatible. So I see no chance there.
@@DoctorVolt ok but what if i use a wired keyboard, where do i even begin?
@@DoctorVolt i have a ps2 adapter
@@HashirEasa See the link in the video description
@@DoctorVolt thanks, but what do i do if i want to use a 16 by 4 LCD module?
Very good job !
I remember the commodore64 back in the 90's bought it from garage sale. It was popular in the early 80's.
Great project!
Mapping RAM to EEPROM is a bad idea... not because of write cycles but because EEPROM is terribly slow on AVR...
BTW whats the music on the end?
Giana Sisters. Composer: Chris Hülsbeck
Played on a SID...
You could always use an external SPI eeprom?
geht das auch mit dem C 16?
Sollte mit jedem Computer der mit dem MOS 6502 oder 6510 läuft. Man braucht halt das richtige ROM und man muss das Memorymapping ändern.