Shop OBEX P1 Docs P2 Docs Learn Events
Propeller II: Emulation of the P2 on FPGA boards (Prop123-A7/A9, DE0-NANO, DE2-115, etc) - Page 14 — Parallax Forums

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

1111214161724

Comments

  • David BetzDavid Betz Posts: 14,511
    edited 2012-12-12 07:37
    Absolutely the specific location is irrelevant (pun intended) but it is the same idea. As you noted, it works a lot better than LED's!

    Congrats about getting C running!

    I look forward to trying it.

    While C is starting to work, it's cumbersome to build a program to run on the P2 since we haven't added options to propeller-elf-gcc to select P2 code generation yet. It is currently necessary to use the gcc "-nostdlib" "-Xassembler -p2" options when compiling and linking and provide all of the support modules like crt0_lmm.s, crtbegin.s, and crtend.s explicitly. This actually has the advantage that you can easily change crt0_lmm.s which contains the LMM kernel and rebuild without having to mess with building a new version of GCC every time. However, it's awkward if you just want to compile and run C programs. I'll work on a better way.
  • Bill HenningBill Henning Posts: 6,445
    edited 2012-12-12 08:18
    Based on your description it is waaaay to early for me to play with - I'll keep an eye on this thread to monitor your progress, and please let me know when it is less awkward :)
    David Betz wrote: »
    While C is starting to work, it's cumbersome to build a program to run on the P2 since we haven't added options to propeller-elf-gcc to select P2 code generation yet. It is currently necessary to use the gcc "-nostdlib" "-Xassembler -p2" options when compiling and linking and provide all of the support modules like crt0_lmm.s, crtbegin.s, and crtend.s explicitly. This actually has the advantage that you can easily change crt0_lmm.s which contains the LMM kernel and rebuild without having to mess with building a new version of GCC every time. However, it's awkward if you just want to compile and run C programs. I'll work on a bet
  • David BetzDavid Betz Posts: 14,511
    edited 2012-12-13 14:00
    Is there some trick to reprogramming the DE0-Nano? I want to update to Chip's newest configuration file but Quartus doesn't seem to see my DE0-Nano board. I can see "USB Blaster" listed in the Windows device manager and it says it is operating correctly but Quartus doesn't seem to be able to see it. I did this operation successfully when I first programmed the DE0-Nano and I haven't changed my Quartus software since. Is there an additional step needed when reprogramming an already programmed board?
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-12-13 14:11
    This happened to me too. I tried re installing drivers, changing USB ports. I even tried an actual USB Blaster. Only thing that fixed it was complete reinstall of Quartus 12.1. (or the programmer software)
  • David BetzDavid Betz Posts: 14,511
    edited 2012-12-13 14:13
    This happened to me too. I tried re installing drivers, changing USB ports. I even tried an actual USB Blaster. Only thing that fixed it was complete reinstall of Quartus 12.1. (or the programmer software)
    I just installed the programmer and now it seems to work. Thanks for the suggestion!
  • David BetzDavid Betz Posts: 14,511
    edited 2012-12-13 14:40
    I'm trying to program my new DE2-115 board and am getting an error. Anyone know what might cause this? Here's a screen shot.

    DE2-115.jpg
    1024 x 586 - 67K
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-13 14:43
    Hi David.

    If I know You need change it to programming mode (one strap)
    David Betz wrote: »
    I'm trying to program my new DE2-115 board and am getting an error. Anyone know what might cause this? Here's a screen shot.

    DE2-115.jpg
  • David BetzDavid Betz Posts: 14,511
    edited 2012-12-13 14:43
    David Betz wrote: »
    I'm trying to program my new DE2-115 board and am getting an error. Anyone know what might cause this? Here's a screen shot.

    DE2-115.jpg

    Ugh. Yet again I find the answer after posting a dumb question. I needed to flip the "program/run" switch. Duh.
  • potatoheadpotatohead Posts: 10,254
    edited 2012-12-13 15:51
    Hey, I did it too. Spent quite a while looking for that switch among all the switches.
  • AribaAriba Posts: 2,682
    edited 2012-12-15 15:13
    I have made a special version of PropTerminal for Propeller 2 testing. Just copy the Prop2Term.exe into the same directory as PNUT.exe. It is by default configured in the right mode and size for the P2 monitor. You only need to change the COM port (if it is not COM6): menu Options -> COM port. Then save it with File -> Save Settings, to make the COM setting permanent.
    If you minimize PropTerminal it gives the COM port free, and you can download code from the PNUT, when you restore PropTerminal, by clicking it on the taskbar, it opens the COM port automatically.

    This PropTerminal version has a special upload mode (Menu File -> Upload) which lets you load a *.obj file,
    generated by PNUT.EXE, over the Write function inside the Monitor. So if you are in the Monitor, select upload and the OBJ file. The data gets written to hub ram and also the cogstart command is prepared. You only need to press return to start the code.

    One of the special features of PropTerminal is the ability to show some simple graphics. I have used that to test some cordic instructions (the one I figured out with the little description we have).

    The cordictest1.spin can generate sine, cosine and random data and writes it to the CLUT ram. Then the data in this ram gets drawn as a graph on PropTerminal. You can use this code as a framework for other tests, which profit from a graphical output.

    attachment.php?attachmentid=97867&d=1355613203

    have fun

    Andy

    Edit: Added version 0.2 of Prop2Terminal, which allows to define the target hubaddress for uploads of .OBJ files.
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-15 15:39
    Hi Andy.

    Nice

    But I have one question?

    Have You possibility to made scroll buffer in it that give possibility to scroll back to save entire session -- Not only one screen?
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-12-15 15:51
    @Ariba

    Great. I tried a quick test and it and everything worked for me.
    :cool:.

    Thanks!

    Bob
  • potatoheadpotatohead Posts: 10,254
    edited 2012-12-15 16:22
    This is great! Thanks Ariba!

    I've not done graphical output on the terminal at all. Thanks for the example.
  • AribaAriba Posts: 2,682
    edited 2012-12-15 16:36
    Sapieha wrote: »
    Hi Andy.

    Nice

    But I have one question?

    Have You possibility to made scroll buffer in it that give possibility to scroll back to save entire session -- Not only one screen?

    Hello Sapieha

    PropTerminal works with a graphic window, which makes it hard to scroll forth and back.
    But if it is only for saving a short session the Copy Text, or Save Text in the File menu should work (they have an internal buffer with 32kB). Copy Text writes the session into the Clipboard, Save Text to a file.

    Andy
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-15 16:42
    Hi Andy.

    I found that before You answered -- Still thanks for answer.

    But -- What about -- Have one more option in Many ---- Log File --- If active - log all activity to <-> from terminal.

    Next question have You in it Cursor control -- and if -- Can You support us with list of commands.

    Thanks

    Ariba wrote: »
    Hello Sapieha

    PropTerminal works with a graphic window, which makes it hard to scroll forth and back.
    But if it is only for saving a short session the Copy Text, or Save Text in the File menu should work (they have an internal buffer with 32kB). Copy Text writes the session into the Clipboard, Save Text to a file.

    Andy
  • AribaAriba Posts: 2,682
    edited 2012-12-15 17:46
    Bob, potathead

    Your welcome

    Sapieha

    The readme.txt inside the official PropTerminal ZIPs, contain a description of all the commands. But this textfile is really a mess and should be redone one day.

    So here is short extract of the most important commands:
    $20..$FF  = draw character (Prop1 ROM-font)
    0         = clear screen
    1         = home
    5,md,x,y  = graphic command, see later
    8         = backspace
    9         = tabulator (8 spaces)
    10        = LF
    12,colr   = change color 1..15
    13        = CR
    
    
    Graphic modes:
    5,0,x,y   = set left top for box,circle,rbox
    5,1,x,y   = draw pixel at x,y
    5,2,x,y   = draw line to x,y (from prev point)
    5,3,x,y   = draw filled box x,y=right bottom
    5,4,x,y   = draw filled box XOR mode x,y=right bottom
    5,5,x,y   = clear area x,y=right bottom
    5,7,x,y   = draw filled circle x - prev.x = radius
    5,8,x,y   = draw rounded outlined box x,y=right bottom
    
    5,12,x,y  = set text cursor position  x,y in chars
    .
    

    Andy
  • SapiehaSapieha Posts: 2,964
    edited 2012-12-15 17:57
    Hi Andy.

    Thanks.

    Why not place that in HELP menu ?


    Ariba wrote: »
    Bob, potathead

    Your welcome

    Sapieha

    The readme.txt inside the official PropTerminal ZIPs, contain a description of all the commands. But this textfile is really a mess and should be redone one day.

    So here is short extract of the most important commands:
    $20..$FF  = draw character (Prop1 ROM-font)
    0         = clear screen
    1         = home
    5,md,x,y  = grahic command, see later
    8         = backspace
    9         = tabulator (8 spaces)
    12,colr   = change color 1..15
    
    
    Grahic modes:
    5,0,x,y   = set left top for box,circle,rbox
    5,1,x,y   = draw pixel at x,y
    5,2,x,y   = draw line to x,y (from prev point)
    5,3,x,y   = draw filled box x,y=right bottom
    5,4,x,y   = draw filled box XOR mode x,y=right bottom
    5,5,x,y   = clear area x,y=right bottom
    5,7,x,y   = draw filled circle x,y = center
    5,8,x,y   = draw rounded outlined box x,y=right bottom
    
    5,12,x,y  = set text cursor position  x,y in chars
    

    Andy
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-16 01:51
    Nice job Andy. Got to get that DE0-nano so I can have some fun too!
  • pik33pik33 Posts: 2,350
    edited 2012-12-16 08:02
    FredBlais wrote: »
    I have an old DE2 Cyclone II EP2C35F672 board lying around, is it compatible with the propeller 2 binary?

    You need Cyclone IV board. There are two of them: DE0-nano or DE2-115.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-18 01:44
    I ordered my DE0-Nano today. My son should have it tomorrow and I will get it from him Thursday ;) I had to wait until I cleared the decks (pun intended - see my avatar) because I know this will consume many hours of fun and I needed to get some other things done first!

    As a note: D.P. sent me a PM that I somehow missed until today. There is a set of drivers required for using the download as detailed by Peter.
  • ctwardellctwardell Posts: 1,716
    edited 2012-12-19 14:06
    So how many DE0-Nano and DE2-115's are running so far?

    Do we want to put a count somewhere or maybe if people want a list of who and where?

    Maybe a short list of anything you have connected for testing.

    I'll start:

    DE0-Nano, Ohio

    4 LED's and a 7 segment LED + D.P. via 2 74HC04's, Lighted on Logic High.


    C.W.
  • K2K2 Posts: 691
    edited 2012-12-19 16:36
    I've got a DE0-Nano connected to a homemade display board from an earlier ARM project. The display is an 8x37 array of blue LEDs.

    Location - Скалистые горы.
  • potatoheadpotatohead Posts: 10,254
    edited 2012-12-19 19:31
    DE2 using on-board LED's, Prop Plugs, PUTTY, Prop Terminal.
  • nutsonnutson Posts: 242
    edited 2012-12-20 00:49
    Two DE0-nano-s and one DE2-115 here. Experimenting with yet another FPGA board as a peripheral for the nano. If Chips or Sapieha's I/O boards materialize, I'll go with those, expect these boards to get better driver support than I can make.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-12-20 05:07
    l just collected my DE0-NANO. Fun begins tomorrow :)
  • Bill HenningBill Henning Posts: 6,445
    edited 2012-12-20 08:08
    P2 test setup

    DE0-Nano with:

    - PropPlug: programming & interacting with the monitor
    - Parallax Serial Terminal: plays nice with pnut.exe
    - SchoolBoard 2: breadboard + switches + lights to play with adding I/O devices
    - OpenBench Logic Sniffer: timing analysis

    Chip's monitor is fantastic for post-mortem analysis after I have the cog stop itself with the "back to monitor" code Chip posted.
  • TrapperBobTrapperBob Posts: 139
    edited 2012-12-20 08:38
    DE0-Nano with:

    - PropPlug: programming & interacting with the monitor
    - Andy's terminal
    - Papilio Pro , LogicStart, etc
  • potatoheadpotatohead Posts: 10,254
    edited 2012-12-20 09:00
    @Bill, isn't it? Was working on P1 a little last night, and I missed having the thing.

    Since we are mentioning gear, I'm using a scope to watch pin toggles and such for timing. Waiting for the I/O adapter board to arrive before I do much else.

    BTW, I've written a good chunk of what will be a complete using the monitor reference here: http://forums.parallax.com/entry.php?1446-Using-The-P2-Monitor-Document-Updated It's totally useful now, with another update coming in a few days.
  • ctwardellctwardell Posts: 1,716
    edited 2012-12-20 09:06
    Bill mentioned the OpenBench Logic Sniffer, those are really nice and low cost at $50.00 plus maybe $10.00 or so for the probes.

    In the US you can get one quickly from here:

    http://www.epictinker.com/Open-Workbench-Logic-Sniffer-p/obc101e1p.htm

    I'm not affiliated with those guys, I just got really fast friendly service and like to reward that.

    I haven't used it yet with the P2 but I have used it to do some SPI watching on the P1.

    C.W.
  • David BetzDavid Betz Posts: 14,511
    edited 2012-12-20 09:08
    P2 Setup:

    DE0-Nano
    PropPlug
    PropGCC under Mac OS X
    Windows XP running under Parallels on the Mac
    p2load for loading programs larger than can be handled by PNut.exe
    Also using p2load as a simple terminal emulator

    I'm using this to do an initial port of PropGCC to P2. This mostly involves teaching the GNU assembler (gas) the P2 instruction set. Any GCC backend changes will probably wait for Eric. I've wanted to hook up some LEDs but I've been afraid of blowing up my DE0-Nano board by drawing too much current. All of my debugging so far has been through a serial connection.

    I also have a DE2-115 board generously supplied by Parallax but I haven't had time to do much other than load the configuration file so far. I'm on the road now and expect to do more with it over the holiday break.
Sign In or Register to comment.