Shop OBEX P1 Docs P2 Docs Learn Events
The WireWorld Computer - Page 2 — Parallax Forums

The WireWorld Computer

24567

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-18 15:05
    David Betz wrote: »
    Thanks! Looks like it will require a bit of conversion to run on the Mac or Linux to convert the Windows file API calls to stdio. Doesn't look like a big job though.
    Ummm... Maybe I spoke too soon. Looks like the entire point of this is to write to a COM port. I'll have to convert it to use the same serial I/O code that p2load uses. Might take a while.

    By the way, I tried to run P2Prep.exe under WinXP and got an error related to the VC runtime library. Should this run under WinXP?
  • BaggersBaggers Posts: 3,019
    edited 2013-04-18 15:10
    Yeah, I wrote it on a WinXP machine, using DevC++
  • BaggersBaggers Posts: 3,019
    edited 2013-04-18 15:12
    if you sort a P2load to SDRAM then it wouldn't need the COM stuff in P2Prep :D

    Btw, what are other people using to upload to SDRAM?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-18 15:20
    Baggers wrote: »
    Yeah, I wrote it on a WinXP machine, using DevC++
    I get an error in msvcrt.dll. Do I need a more recent version of that?
  • BaggersBaggers Posts: 3,019
    edited 2013-04-18 16:15
    Dunno David, probably
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-18 16:29
    Baggers wrote: »
    Dunno David, probably
    Could you send me the copy you're using?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-18 20:46
    I converted p2prep to run on the Mac or Linux but it doesn't seem to work for me. Maybe it's because the 460800 as a baud rate. Anyway, I guess I'm not going to be able to run this demo. Any chance of posting a video?
  • cgraceycgracey Posts: 14,206
    edited 2013-04-18 22:15
    Roy Eltham wrote: »
    I believe on the FPGA boards the refresh is being handled by the board and not the fpga logic that is the P2 in our case. I think the current driver will need to be updated for the real P2 in order to do the refreshing signals, right Chip?

    No. The current driver does refresh, already, and way too much of it. After every command and every time it resets the command list pointer, it does an 'auto refresh' which affects all 4 banks.
  • cgraceycgracey Posts: 14,206
    edited 2013-04-18 22:20
    jazzed wrote: »
    Nice idea. Guess it depends on the default state of the programmed pull-ups after cogstop. Chip?

    I don't remember if it's pin states or a simple sequence that puts the SDRAM in self-refresh mode. Getting the chip into self-refresh mode would be the best to get its contents to survive a cog change.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-19 01:50
    David Betz wrote: »
    I converted p2prep to run on the Mac or Linux but it doesn't seem to work for me. Maybe it's because the 460800 as a baud rate. Anyway, I guess I'm not going to be able to run this demo. Any chance of posting a video?
    What does "JB_TO_SDRAM_32BIT_TV.obj" do? Is the source available? I don't think I'm going to be able to figure out how to get the WireWorld program to run without being able to debug the download of the SDRAM. I'm sure I must have broken something while trying to port it to the Mac/Linux but it's hard to know what without knowing the code it's talking to on the P2.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-19 02:01
    I noticed that the first program to be loaded has "TV" in its name so I switched to the AV input on my monitor while doing the load to see if it was displaying anything on the TV screen. It looks like it is displaying an image during that first stage load. It's just that the image goes away and nothing appears on the VGA screen after the second load of WiredComputer.obj. It does look like it is driving the VGA monitor though but the screen is entirely black. Any idea what could be going wrong in the transition between the load and the starting of WiredComputer.obj?
  • BaggersBaggers Posts: 3,019
    edited 2013-04-19 02:55
    Yeah, sorry matey, the JB_TO_SDRAM_32BIT_TV.obj waits for the sending computer to send J and B then a long for SDRAM address, then a long for length, then the data :)

    edit: added source.
    JB_TO_SDRAM_32BIT_TV.spin
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-19 07:35
    Baggers wrote: »
    Yeah, sorry matey, the JB_TO_SDRAM_32BIT_TV.obj waits for the sending computer to send J and B then a long for SDRAM address, then a long for length, then the data :)

    edit: added source.
    JB_TO_SDRAM_32BIT_TV.spin
    Thanks! I'll look at this later.
  • AribaAriba Posts: 2,690
    edited 2013-04-19 16:56
    cgracey wrote: »
    I don't remember if it's pin states or a simple sequence that puts the SDRAM in self-refresh mode. Getting the chip into self-refresh mode would be the best to get its contents to survive a cog change.

    It's not so much a cog change, but a Reset of the Prop2 that the RAM content must survive. If we have a big C code loaded to the SDRAM and then make a Reset to load a new VM which interpretes this SDRAM code, then the SDRAM should refresh itself while loading the new VM code.
    I think the Reset makes all pins floating so we will need at least a PullDown resistor at CKE to keep the SDRAM in SelfRefresh mode. (Something to consider for the Prop2 - module).

    Andy
  • jazzedjazzed Posts: 11,803
    edited 2013-04-19 18:13
    cgracey wrote: »
    I don't remember if it's pin states or a simple sequence that puts the SDRAM in self-refresh mode. Getting the chip into self-refresh mode would be the best to get its contents to survive a cog change.

    My question is : do the P2 pull-up/down resistor programming states survive a cogstop or a reset. I'm guessing not.
  • cgraceycgracey Posts: 14,206
    edited 2013-04-19 20:21
    jazzed wrote: »
    My question is : do the P2 pull-up/down resistor programming states survive a cogstop or a reset. I'm guessing not.

    The pins actually have their own state memories. After a pin is configured by a cog, that cog holds the config line high. The config lines are OR'd together across cogs, just like DIR's and OUT's. So, once a cog has configured a pin, another cog can configure it, with the only effect being that that cog becomes the new one to hold the config line high. The prior cog is then free to stop/restart (its config output goes low), while the pin maintains its mode.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-04-23 07:17
    Baggers wrote: »
    Yes David, that's a great idea, then I can ask you nicely if you could add SDRAM loading into P2Load :D pretty please with bells on ;)
    If you want a hand I'll send you the source for mine, and talk you through it, but it's pretty easy, especially with Chip's SDRAM drivers!
    Okay, I think I now have all of the pieces I need to load SDRAM from data written to flash. I'll try to put the pieces together in the next few days. I'm determined to see this demo running on my DE2-115! :-)
  • BaggersBaggers Posts: 3,019
    edited 2013-04-23 07:50
    Awesome, and great motivation ;)
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-10 03:58
    Baggers: Do you have a standalone version of this VGA driver? I'd like to launch it from C and want a version of the driver that isn't also the main program. Is there a version that can be started with COGINIT in another COG? I understand that I'll have to run it in COG 0 on the DE2-115 board but that's not a problem. Or is there one of your other drivers that you'd recommend instead?

    Thanks,
    David
  • BaggersBaggers Posts: 3,019
    edited 2013-05-10 08:51
    I'll knock one up for you now, give me a couple of mins. :)
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-10 08:53
    Baggers wrote: »
    I'll knock one up for you now, give me a couple of mins. :)
    I tried making one myself but it only shows a blank screen. Obviously, I've done something wrong! :-)

    It's attached in case you want a good laugh.

    VGA_Driver.spin
  • BaggersBaggers Posts: 3,019
    edited 2013-05-10 10:04
    Hi David,

    How's this?

    I also spotted a duplicate
    mov x,#23
    call #blank

    Which I've now removed in this driver. :)

    VGADriver.spin
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-10 10:15
    Baggers wrote: »
    Hi David,

    How's this?

    I also spotted a duplicate
    mov x,#23
    call #blank

    Which I've now removed in this driver. :)

    VGADriver.spin

    Thanks! I'll try this later tonight. Do you know what I did wrong with my attempt to separate out the VGA driver?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-10 14:37
    David Betz wrote: »
    Thanks! I'll try this later tonight. Do you know what I did wrong with my attempt to separate out the VGA driver?
    Okay, I tried this and it produces the same black screen that my attempt to port your driver produced. What should I see? I'm assuming I should see random stuff since nothing every initializes the frame buffer in SDRAM. What is the format of the frame buffer? Is it one byte per pixel? How are RGB encoded into that byte?

    Thanks!
    David
  • pedwardpedward Posts: 1,642
    edited 2013-05-10 14:59
    I wouldn't assume the SDRAM is full of garbage at power up, it is very likely to be zeroed out because it is a DRAM. The HUB memory is persistent across resets, but is initialized to ROM + zero on power up.

    There is a GETLFSR instruction that is very useful at generating noise for testing, I'd put a loop in to initialize the memory before going any further. Or initialize it with a specific sequence.
  • potatoheadpotatohead Posts: 10,261
    edited 2013-05-10 16:38
    Actually, my SDRAM always has garbage in it on power up.
  • BaggersBaggers Posts: 3,019
    edited 2013-05-10 17:13
    Had friends round today, and going to bed now as it's 1:12 ;) will have a look tomorrow!d
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-10 17:20
    Baggers wrote: »
    Had friends round today, and going to bed now as it's 1:12 ;) will have a look tomorrow!d
    Can you say what the data format is for the pixels in the frame buffer?
  • AribaAriba Posts: 2,690
    edited 2013-05-10 18:16
    David Betz wrote: »
    Can you say what the data format is for the pixels in the frame buffer?

    The mode value defines the pixel format. It is set to %1010 which is the luma8 mode, so 1 byte per pixel: 8 colors with 5bit luma each.
    You can change the mode to %1100 to get a RGB 3:3:2 format (or other 8bit modes).

    It can be that your monitor does no like the wrong pixel frequency of 45 MHz. Try to set frqa_ to "long $1555_5555" instead of $1800_0000, this results in 40 MHz which is the standard.

    Andy
  • David BetzDavid Betz Posts: 14,516
    edited 2013-05-10 19:17
    Ariba wrote: »
    The mode value defines the pixel format. It is set to %1010 which is the luma8 mode, so 1 byte per pixel: 8 colors with 5bit luma each.
    You can change the mode to %1100 to get a RGB 3:3:2 format (or other 8bit modes).

    It can be that your monitor does no like the wrong pixel frequency of 45 MHz. Try to set frqa_ to "long $1555_5555" instead of $1800_0000, this results in 40 MHz which is the standard.

    Andy
    That was it! Thanks!! I wonder why Baggers used a non-standard frequency?
Sign In or Register to comment.