C64 Emulation with Teensy 3.6

Status
Not open for further replies.
I've added HEX-Files to this thread (a few posts above this) - just connect the display and a USB-A female connector and you can run a few tests. I've fixed some bugs since then, but it is far away from beeing perfect, and it is not as good as VICE (VICE has many years of development now..)
Please tell me every bug you find.

At the moment I do some heavy tests with the CIAs. It'll take some time..
I guess, it's (geek-)fun to connect the emulated C64-userport serialport to a teensy-hardwareserial on the same chip and transfer data..

At the moment, I'm considering buying an original floppy disk drive... I want the emulation to be cycle-exact enough to speak with an original drive. (I'm not sure that if this is really possible.I hope it is.)
Does anyone have (proven to work) original Disks ? And can you lend me some ? I send them back in some month.. (or copy them if i can buy some empty disks somewhere..)

The speed is around ~4000 bit/s - which are the best bi-directional level-shifters to use ?
EDIT: Sorry, ~ 150.000 BIT/s

Connecting a tape-drive would be fun, too.

Future-Plan is to support a larger display.
 
Last edited:
A Question: If I make a specialized PCB -C64 addon for the Teensy 3.6 - Is someone interested to buy it ? i think it'll cost around 30€.. (+ Teensy + Display) and available not before winter.
 
Last edited:
LOL, ok, I bought a drive. (1541-II 50 €)
Any ideas what level-shifters to use ?
p.s. (i'll add a good in-built drive-emulation, but I want to make original-drives work, too)
(a printer would be great, too...)

off-topic: are there today any printers with CENTRONICS-Port ?
 
Last edited:
Connecting a tape-drive would be fun, too.
C64 Tape drives speed was very slow (about 300 baud). Loading a large program at normal speed could take up to 30 minutes in extreme cases. ):

Printers
A number of printers were released for the Commodore 64, both by Commodore themselves and by third-party manufacturers.

Commodore-specific printers were attached to the C64 via the serial port and were capable of being daisy chained to the system with other serial port devices such as floppy drives. By convention, printers were addressed as device #4-5 on the CBM-488 serial bus.

The serial interface is a 6-pin DIN connector
Pin Description____Signal direction___Remark
1 SERIAL SRQ____IN_____________Serial Service Request In, at the C128 "Fast Serial Clock"
2 GND__________-______________Ground, signal ground (0V)
3 SERIAL ATN____OUT___________Attention, for the selection of a device at beginning/end of a transmission
4 SERIAL CLK____IN/OUT_________Clock (for data transmission)
5 SERIAL DATA___IN/OUT_________Data
6 SERIAL RESET__OUT(/IN)_______Reset, in older VIC-20 unused
Code:
 
dot matrix printers use centronics,

There were plenty of Commodore centric printers that could be daisy chained off the same 6 pin serial connector the 1541 used. I had an Okimate 10 color printer that was like this.

(Rats! Doubling Chris O's post...)


A Question: If I make a specialized PCB -C64 addon for the Teensy 3.6 - Is someone interested to buy it ? i think it'll cost around 30€.. (+ Teensy + Display) and available not before winter.

I would buy 1 or 2.


Any ideas what level-shifters to use ?

I have used some of these before. They autosense the direction, but might need some series resistors to make sure they sense the direction correctly when the line they are driving is long.

David
 
I am keen on a Flexibard3

Do you want one of my "Flexiboard3" ? :) I can add a connector for your keyboard..
Hi Frank,

Top job on the c-64!

Have you got a spec for the Flexiboard3?
I have got the hang of soldering larger smd now but could use parts.
I am keen to use the usbhost for midi.
I need to sort out postage to Australia and payment.
Let me know how you want to do it.

Keep up the great work!
 
Argh, its so complicated to make the timing of all the tasks exact.
Today I had a "perfect timing" (within ~1us) for CPU VIC and CIA with the result that no cycles for sound were left. Of course. Sound worked so good all the time that I forgot that it was there and needs some processing-time, too... :-(
GRR. The today's work on the emulator was pretty useless.. (restore backup) I think, I'll make a break til the the diskdrive arrives.
(Paul, I need 4MHz more..only 4... or a chip with 128kb cache. ;-)

Levelshifters: I have some BSS138 in stock and an info that they're good up to 400kHz I2C - so, I hope, they are good enough for a first try (we need MAX half the speed - more likely much less)

My "Centronics" Question was unrelated to the C64. Sry for mixing things.. (If the floppy works, the old printers will work too..but..do they still exist?)
 
Last edited:
Where and when can I order one of your C64 boards, Frank? I absolutely want one and I'm ready to pay in advance.

Don't know :) In this case, first the software, then the board.. ;-)

Edit: And i want to test a new, larger display first. It has more pixels-> more work for the poor teensy (again...) !
 
Last edited:
Frank. I tried your software tonight when my teensy finally arrived. Trying different games to see what all works. This is a GREAT project! I loved the old C64.
Bigger screen is a good idea for old eyes like mine. Can't wait to see other improvements. Thank you!
 
Too much datatransfers - but, if nothing works, it's possible to move the SID to a T3.2 - That will help, too. But I really don't want this.
 
Photo of my preliminary IEC-BUS Level Shifter with 6-pin DIN connector (drive) and 9 pin female-pinheader (Teensy). I ended using a single BC337(per channel) + resistors.It seems to work on the workbench, but I have to wait for the floppydrive..
The IEC BUS is like I2C, with pullups (1K) and open collector outputs (but other protocol ;-) .
IEC_Level_Shifter.jpg
 
Last edited:
The 1541-II arrived.
OK,I had to attach my logic-analyzer (best buy ever) to modfiy the timing again, and to (temporarly) disable the sound. At the moment, it is "C64 cycle-exact" (almost)

Good news..
a) my preliminary level shifter works as expected. It is a bit slow on the falling edge - 1us - but way more fast than needed.
b) loading files from the original floppydisk works. (hehe, PC emulators can't do this..:cool:)


Now I'm going to enable sound again.. I hope this will work - the SID emulation needs a good amount of teensy-cpu time.
When it is running (may take a bit time), I really have to clean up the code before I can think of publishing it..
c64_flopy_firstload.png

Code:
            while (ARM_DWT_CYCCNT < timeTarget){;}
(..had to slow down the whole thing..)
 
Last edited:
A Poll:

Do you want a "C64 Userport" on the PCB ?


- NO
- YES, but I don't need 9V ~
- YES, but 3.3V Levels are OK.

- YES, and I really need 9V~
- YES, and I really need 5V logic levels

- I want the original connector

Remarks:
If possible, i want to design the board with easy to solder through-hole parts. I can't promise anything, but that's my goal.

- A design without userport will be much smaller and cheaper.
- 9V AC needs some BIG parts and a 9V AC wall plug
- The "blue" original female connectors are hard to find, and are very expensive today
- 5V logic levels may not be possible with DIL (through-hole) (needs much space)
- Most likely, floppy "parallel" cables will not work

Poll:
Joystick Ports: Do you need 5V ?
Paddles ?

Poll:
Do you want a Commodore IEC Serial (to connect a floppy or other "IEC" hardware?)

Poll:
Do you want a "Cassette Port" ? (original female connectors are almost impossible to buy nowadays..)
 
Last edited:
Status
Not open for further replies.
Back
Top