Propeller II: Emulation of the P2 on FPGA boards (Prop123-A7/A9, DE0-NANO, DE2-115, etc)

1356724

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,416
    edited 2012-11-29 - 13:42:16
    "All the lower COM ports were in use, but I remapped it to COM1. I'll have another go." - probably not a good idea to re-map it to COM1 ... See my note in post #59


    Beau Schwabe --- Robotics applications- PCB design, embedded software, and mechanical
    Oklahoma Robotics -

    www.Kit-Start.com - bschwabe@Kit-Start.com ෴෴ www.BScircuitDesigns.com - icbeau@bscircuitdesigns.com ෴෴

  • LeonLeon Posts: 7,620
    edited 2012-11-29 - 13:47:55
    Thanks, Beau and Tubular.

    It seems to be working on COM1, and loaded the code into the emulated cog. I'll follow your suggestions later, when I've had a play with it.

    Chalk up another success with the DE0-Nano. It was I who first suggested using it!
    Leon Heller
    G1HSM
  • David BetzDavid Betz Posts: 13,592
    edited 2012-11-29 - 13:48:35
    "All the lower COM ports were in use, but I remapped it to COM1. I'll have another go." - probably not a good idea to re-map it to COM1 ... See my note in post #59
    I remapped mine to COM1 and it seems to work. This is on a Dell laptop. Maybe it doesn't have any actual COM ports.
  • Beau SchwabeBeau Schwabe Posts: 6,416
    edited 2012-11-29 - 13:53:36
    COM1 and COM2 are usually reserved for a legacy MOUSE and are sometimes hardwired into the mother board.


    Beau Schwabe --- Robotics applications- PCB design, embedded software, and mechanical
    Oklahoma Robotics -

    www.Kit-Start.com - bschwabe@Kit-Start.com ෴෴ www.BScircuitDesigns.com - icbeau@bscircuitdesigns.com ෴෴

  • David BetzDavid Betz Posts: 13,592
    edited 2012-11-29 - 13:54:29
    COM1 and COM2 are usually reserved for a legacy MOUSE and are sometimes hardwired into the mother board.
    Fair enough. I'll switch mine to COM9 just to be safe.
  • LeonLeon Posts: 7,620
    edited 2012-11-29 - 13:55:06
    I'm using a Dell laptop, as well.
    Leon Heller
    G1HSM
  • TubularTubular Posts: 3,802
    edited 2012-11-29 - 14:12:38
    COM1 and COM2 are usually reserved for a legacy MOUSE and are sometimes hardwired into the mother board.

    I think its still possible even to redirect these (it seems to be a higher level handle style thing, not tied to traditional interrupts and i/o ports), but yes agreed, moving COM5~9 probably makes more sense.
  • Bill HenningBill Henning Posts: 6,445
    edited 2012-11-29 - 14:16:22
    It should be OK to redirect COM1-2 as long as there is no physical serial port on the computer

    Watch out for COM3/COM4, sometimes USB serial converters will show up as COM3/4, so if you move them and later plug in the adapter that used to be there, you may have issues.
    www.mikronauts.com / E-mail: mikronauts _at_ gmail _dot_ com / @Mikronauts on Twitter
    RoboPi: The most advanced Robot controller for the Raspberry Pi (Propeller based)
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 14:16:50
    cgracey wrote: »
    I don't have any tips. I just stay in PNUT, myself. It's minimal, but reliable. No scroll bars.
    Actually I was hoping that a *minor tweak* might be considered for PNUT which only involves that it check if it's own copy of the file has been updated and if it hasn't then check to see if the file itself has been updated (by another editor) and reload if necessary before compile.
    I've got the whole source for Tachyon sitting in there and it's very awkward trying to edit this large file in PNUT as you would know. Surely this tweak would be a good and simple solution?

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • Roy ElthamRoy Eltham Posts: 2,684
    edited 2012-11-29 - 15:12:22
    Actually I was hoping that a *minor tweak* might be considered for PNUT which only involves that it check if it's own copy of the file has been updated and if it hasn't then check to see if the file itself has been updated (by another editor) and reload if necessary before compile.
    I've got the whole source for Tachyon sitting in there and it's very awkward trying to edit this large file in PNUT as you would know. Surely this tweak would be a good and simple solution?

    Handling a file changing externally is not a minor tweak. Especially on Windows.
  • Cluso99Cluso99 Posts: 15,548
    edited 2012-11-29 - 16:33:25
    I have updated the original post with more info. Please let me know if there are errors or anything else I should post there.
    My Prop boards: P8XBlade2 , RamBlade , CpuBlade , TriBlade
    P1 Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    P1: Tools (Index) , Emulators (Index) , ZiCog (Z80)
    P2: Tools & Code , Tricks & Traps
  • David BetzDavid Betz Posts: 13,592
    edited 2012-11-29 - 20:35:56
    Is there a description of jmptask somewhere? I'm trying to understand Chip's monitor code and how it handles the serial interface.
  • SapiehaSapieha Posts: 2,964
    edited 2012-11-29 - 20:50:49
    Hi David

    NOT yet !!
    We all wait for complete instruction's set


    David Betz wrote: »
    Is there a description of jmptask somewhere? I'm trying to understand Chip's monitor code and how it handles the serial interface.
    Regards
    Sapieha
    _____________________________________________________
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it as simple as possible yet as versatile/usable as possible.
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 21:10:34
    Roy Eltham wrote: »
    Handling a file changing externally is not a minor tweak. Especially on Windows.
    If no changes have been made to the local file then RELOAD = CLOSE then OPEN.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-11-29 - 21:22:08
    I am having a major lust for new silicon about this P2 emulation platform..... very difficult to ignore. Even with only 6 cogs, it is attractive and exciting.
    Hwang Xian Shen, Puddleby-on-the-Marsh.
    All things considered, I can live and thrive without Microsoft products. LINUX is just fine.
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 21:35:51
    David Betz wrote: »
    Is there a description of jmptask somewhere? I'm trying to understand Chip's monitor code and how it handles the serial interface.

    There are 4 program counters in each cog. They are initialized as follows:

    PC0 = $000
    PC1 = $001
    PC2 = $002
    PC3 = $003

    At first, the task register, which is 32 bits (16 two-bit fields), is cleared to 0, making all time slots execute task0.

    JMPTASK sets up to all four PC's at once, using a bit field in S and an address in D.

    JMPTASK #substart,#%1111 ...would set all PC's to substart
    JMPTASK #substart,#%1000 ...would set PC3 to substart
    JMPTASK #substart,#%0100 ...would set PC2 to substart
    JMPTASK #substart,#%0010 ...would set PC1 to substart
    JMPTASK #substart,#%0001 ...would set PC0 to substart

    Until SETTASK is executed (initialized to $00000000), only PC0 is running, making the cog seem normal.

    SETTASK #%%3210 ...would enable all tasks. If no JMPTASK was done, PC1..PC3 would begin execution from $001..$003 (better have some JMP's there)

    When you do an immediate SETTASK #, the lower 8 bits of immediate data are replicated four times to fill 32 bits. To get more granularity, you could do a register, instead of an immediate, and 32 unique bits would be loaded into the task register, which rotates right after each instruction completion, with the 2 LSB's determining which task to execute next.

    Here's an example program:
            org
    
            jmp     #task0
            jmp     #task1
            jmp     #task2
            jmp     #task3
    
    task0   settask #%%3210     'turn on all tasks
    
    :loop   notp    #0          'toggle P0
            jmp     #:loop
    
    task1   notp    #1          'toggle P1
            jmp     #task1
    
    task2   notp    #2          'toggle P2
            jmp     #task2
    
    task3   notp    #3          'toggle P3
            jmp     #task3
    
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 21:37:01
    If no changes have been made to the local file then RELOAD = CLOSE then OPEN.

    I think detecting changes may be the hard part.
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 21:39:19
    cgracey wrote: »
    I think detecting changes may be the hard part.
    No need to detect, just close and open. I can achieve the same effect by <ctrl> O <enter> before I hit F10 which just opens the last file.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 21:39:47
    I am having a major lust for new silicon about this P2 emulation platform..... very difficult to ignore. Even with only 6 cogs, it is attractive and exciting.

    Do you have a DE2-115 running? Those boards are made in Taiwan.
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 21:44:17
    No need to detect, just close and open. I can achieve the same effect by <ctrl> O <enter> before I hit F10 which just opens the last file.

    I think I might have a solution for you.

    For each compile:

    1) copy your code to a Untitled.spin
    2) launch pnut.exe
    3) hit F10

    You could automate all but the F10.

    For me to change pnut.exe, I could just make it always reload the file if a certain mode was set, right?
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 21:50:13
    cgracey wrote: »
    I think I might have a solution for you.

    For each compile:

    1) copy your code to a Untitled.spin
    2) launch pnut.exe
    3) hit F10

    You could automate all but the F10.

    For me to change pnut.exe, I could just make it always reload the file if a certain mode was set, right?
    This of course isn't a bit deal as there are far more important things which is why I said it's a minor tweak which you must be used to and it's just another line or two and recompile. What harm could it do if it always reloaded a file before compile? If local changes have been made it should come up with the normal save prompt which is fair enough but this one minor tweak means PNUT can just do what it does best and that is compile and load while we can pick our external editors to suit.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 21:54:07
    This of course isn't a bit deal as there are far more important things which is why I said it's a minor tweak which you must be used to and it's just another line or two and recompile. What harm could it do if it always reloaded a file before compile? If local changes have been made it should come up with the normal save prompt which is fair enough but this one minor tweak means PNUT can just do what it does best and that is compile and load while we can pick our external editors to suit.

    What if we launch pnut.exe with a command switch that tells it to compile, download, and then shut down if there were no problems? That would be totally hands-free then. Would that work for you?
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 21:55:40
    I'm compiling a large file but find that if I place my welcome string at the end of the code that it doesn't print. My obj file is 29K but the BIN file is only 2K.
    TESTLP
            mov    dirc,txmask
    
            mov    X,nameptr
            call    #PRT_STR
    
            mov    X,#1
            shl    X,#24
            djnz    X,$
            jmp    #TESTLP
    
    nameptr        long    @NAME+s
    
    PRT_STR
            rdbyte    tos,X wz
    PRT_STR_ret
         if_z    ret
            call    #TRANSMIT
            add    X,#1
            jmp    #PRT_STR
    
    ' <TACHYON KERNEL ------------------------ >
    
    ' then
    NAME        byte    $0D,$0A,"TACHYON P2 Forth ",0
    

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 21:58:09
    cgracey wrote: »
    What if we launch pnut.exe with a command switch that tells it to compile, download, and then shut down if there were no problems? That would be totally hands-free then. Would that work for you?
    Wouldn't that make it more complicated as we now have to tell it which file to open when it can already be open? I am finding it very necessary to use an external editor (CONTEXT) just so I can navigate and also UNDO all those little oopsies.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • SapiehaSapieha Posts: 2,964
    edited 2012-11-29 - 22:06:46
    Hi Peter.

    What for external editor You use?

    I use NotePad++ that have that possibility's. ---> look on attached PDF

    Wouldn't that make it more complicated as we now have to tell it which file to open when it can already be open? I am finding it very necessary to use an external editor (CONTEXT) just so I can navigate and also UNDO all those little oopsies.
    Regards
    Sapieha
    _____________________________________________________
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it as simple as possible yet as versatile/usable as possible.
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 22:14:05
    Sapieha wrote: »
    Hi Peter.

    What for external editor You use?
    I use NotePad++ that have that possibility's. ---> look on attached PDF

    I'm running this on WINXP inside of VirtualBox running in LinuxMint 14 so I use CONTEXT as an editor. Normally I would use medit in Linux. As I said, this is not a big deal as I can work around, but then if it's not a big deal to have PNUT close and open it's current file so as to perform a reload then that's all I need.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 22:19:54
    I'm compiling a large file but find that if I place my welcome string at the end of the code that it doesn't print. My obj file is 29K but the BIN file is only 2K.

    Only $1F8 longs are being loaded.

    What we are doing is just loading what is actually the 'loader' that would perform further loading, decryption, etc. I will have to make a re-loader program to download, in lieu of the $1F8 longs which are now being sent, which will then load the user code in, up to the top of memory, if there is so much.
  • SapiehaSapieha Posts: 2,964
    edited 2012-11-29 - 22:20:14
    Hi Peter

    Thanks

    I run native winXP

    I'm running this on WINXP inside of VirtualBox running in LinuxMint 14 so I use CONTEXT as an editor. Normally I would use medit in Linux. As I said, this is not a big deal as I can work around, but then if it's not a big deal to have PNUT close and open it's current file so as to perform a reload then that's all I need.
    Regards
    Sapieha
    _____________________________________________________
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it as simple as possible yet as versatile/usable as possible.
  • cgraceycgracey Posts: 11,946
    edited 2012-11-29 - 22:20:53
    I'm running this on WINXP inside of VirtualBox running in LinuxMint 14 so I use CONTEXT as an editor. Normally I would use medit in Linux. As I said, this is not a big deal as I can work around, but then if it's not a big deal to have PNUT close and open it's current file so as to perform a reload then that's all I need.

    Let me see what I can do.
  • Peter JakackiPeter Jakacki Posts: 8,795
    edited 2012-11-29 - 22:25:40
    cgracey wrote: »
    Let me see what I can do.
    I can get around this with a key sequence or macro but the biggest problem at the moment is the 2K bin file limit, is that a bug?

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- The LOT --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
    phone.png
Sign In or Register to comment.