Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

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

  1. #1
    Junior Member
    Join Date
    Sep 2021
    Posts
    16

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

    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 by jonathan322; 09-22-2021 at 01:42 PM. Reason: more info

  2. #2
    Junior Member
    Join Date
    Sep 2021
    Posts
    16
    PS Please be patient with me

  3. #3
    Member
    Join Date
    Sep 2021
    Posts
    70
    Why not just emulate the 6502?

  4. #4
    Junior Member
    Join Date
    Sep 2021
    Posts
    16
    Quote Originally Posted by Mcu32 View Post
    Why not just emulate the 6502?
    Is there such an emulator for the 4.1? It would have the correct bus specs, if there is (and if it had the ability to sit on an actual 65xx data bus).
    Last edited by jonathan322; 09-22-2021 at 08:28 PM. Reason: misspelling

  5. #5
    Member
    Join Date
    Sep 2021
    Posts
    70
    Just emulate the other periphals too.. there is a c64 emulator for Teensy 3.6. The T4 is much faster.

  6. #6
    Junior Member
    Join Date
    Sep 2021
    Posts
    16
    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

  7. #7
    Junior Member
    Join Date
    Sep 2021
    Posts
    16

    Nobody knows?

    Does no one know how to implement this? Is it overly ambitious?

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,067
    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.

  9. #9
    Junior Member
    Join Date
    Sep 2021
    Posts
    16
    Quote Originally Posted by defragster View Post
    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 No, but seriously, I did see one project by Ted Fried ( https://github.com/MicroCoreLabs/Pro...aster/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 by jonathan322; 09-26-2021 at 10:21 PM.

  10. #10
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,067
    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.

  11. #11
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,558
    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...rary-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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •