65c02 & 65c816 - Using Teensy 4.1 as a Co-processor on 8-bit bus? FlexIO? DMA?

Status
Not open for further replies.

jonathan322

Well-known member
Greetings! This is my first post, so help and patience would be greatly appreciated!

Simply stated, I have two projects in which I would like to use the Teensy 4.1 as a co-processor for the 65c02 and 65c816. Both projects run at 6mhz, but they can go up to about 8mhz. However, I'm new to Teensy, though I do have experience using the Arduino IDE with other boards.

What I would like to know is, how can I interface the 65xx 8-bit data bus (I/O) and a few bits (say, eight) from the 65xx address bus (input only to Teensy, on every cycle), and have the Teensy transfer all 16 bits IN on the positive edge of the 65xx's 6mhz clock, when the RWB (Read/Write active low) is low and data OUT to the Teensy on the positive edge of the clock when RWB is high (but the eight address bits still go in)?

If possible, I'd also like to qualify everything with a chip select.

Thanks in advance for your help and guidance!!!

J
 
Last edited:
Just emulate the other periphals too.. there is a c64 emulator for Teensy 3.6. The T4 is much faster.
 
That's not what I'm doing. I'm using real physical hardware for my project. Also, I'm not sure the Teensy 3.6 project is compatible with the 4.1. Do you know? J
 
Best to search out prior examples when possible and forge ahead and get stuck. Then a true 'expert' might be able to appreciate and address the issue.

Some other few folks you'll see have worked with good success with FlexIO. There are examples maybe PJRC Octo code for T_4.x, or some of KurtE's work (UART Serial, Camera, Displays) might be helpful ? If you can find those sources/discussions and make any sense of them where they apply it might help progress and lead to better feedback.

There are also a few threads on having the Teensy act as a memory device in some fashion ... not sure of posted success/completion ... but parallel bit I/O has been done, though maybe not at 6-8 MHz ...

Indeed @Frank_B made a great T_3.6 emulator of the C64 - not sure of any reason it wouldn't port to the T_4.1? Maybe it won't, or it just isn't an interesting project to bother with.
 
Best to search out prior examples when possible and forge ahead and get stuck. Then a true 'expert' might be able to appreciate and address the issue.

Some other few folks you'll see have worked with good success with FlexIO. There are examples maybe PJRC Octo code for T_4.x, or some of KurtE's work (UART Serial, Camera, Displays) might be helpful ? If you can find those sources/discussions and make any sense of them where they apply it might help progress and lead to better feedback.

There are also a few threads on having the Teensy act as a memory device in some fashion ... not sure of posted success/completion ... but parallel bit I/O has been done, though maybe not at 6-8 MHz ...

Indeed @Frank_B made a great T_3.6 emulator of the C64 - not sure of any reason it wouldn't port to the T_4.1? Maybe it won't, or it just isn't an interesting project to bother with.

I wouldn't know how to port anything, yet :cool: No, but seriously, I did see one project by Ted Fried ( https://github.com/MicroCoreLabs/Projects/tree/master/MCL65%2B ) that is a 65c02 emulator, but, unfortunately, he demux's the data bus, instead of tristating the output. In that case, muxing the data bus so that it can actually sit on a real data bus, and switching directions on a rwb signal, I think it would require the speed that one could get from FlexIO - not merely reading/writing the GPIO registers.

J

PS Are projects for the Teensy 3.6 generally compatible with the 4.1?
 
Last edited:
PS Are projects for the Teensy 3.6 generally compatible with the 4.1?

Generally yes. YMMV - doesn't hurt to try ...

Anything using Arduino functions and c/cpp meets the same spec and should work.

Anything with a supported library for buses or low level hardware where it exists should also work.

There are areas with alternate low level support - missing, improved, or just different. Libraries can account for that - using directly may require some work with the manual or other reference.
 
As I mentioned in PM, I am rusty right now on FlexIO. There is the other thread on FlexIO where others have done more with BUS io with it:
https://forum.pjrc.com/threads/58228-T4-FlexIO-Looking-back-at-my-T4-beta-testing-library-FlexIO_t4

Also we did do some 4 bit transfers with cameras using FlexIO, which I believe was mentioned on the MMOD beta thread as well as thread(s) on the OV7670.

Some of the issues with FlexIO and DMA with T4.x are that there are only so many pins that have been brought out with FlexIO capabilities. Some of this is up on the Readme file up at:
https://github.com/KurtE/FlexIO_t4

And you will see that for a T4.1 the FlexIO object that has a lot of pins is FiexIO3, which does NOT have DMA support... And I don't remember if the FlexIO buss emulation requires contiguous pins (starting flexIO pin and count) or not.

FlexIO1 and FlexIO2 do have several pins, but no groups of 8...

Sorry this is not much information.

Good Luck
 
Status
Not open for further replies.
Back
Top