Latest code: Getting DE0 working & Program changes required
Cluso99
Posts: 18,069
New FPGA code and PNUT.EXE release for 30-Sep-2013
I have changed the thread title to better reflect what is/will be here.
I now have my De0-Nano working with the new code. I have documented this in the first post in the sticky.
http://forums.parallax.com/showthread.php/144199-Propeller-II-Emulation-of-the-P2-on-DE0-NANO-amp-DE2-115-FPGA-boards?p=1145599&viewfull=1#post1145599
Software Changes:
Now I have to get the compiler working with my older code. These are the changes required so far...
Original Post:
I have just tried to download the new FPGA configuration (as posted by Chip a few days ago). It reports that it has programmed OK but when I plug my propplug into the DE0 and run PST it does not run the monitor (maybe it does not recognise the "space"). I tried 19200 baud in case the running at 20MHz was the problem.
I retried the old FPGA configuration and all works as expected.
I then reprogrammed the DE0 again with the new FPGA configuration. No luck.
So I plugged in the Parallax expansion board and also put in the link on the DE0 between pins 3 & 5 (checked against the pic Chip posted originally).
I then connected the Propplug to the new header on the expansion board (looking at the Propplug connector, ground is closest the "Prop Plug" white legend and identified by the square solder pad). Still no luck. I haven't run the expansion board before - I seem to recall was there some issue with the SPI Flash.
Any ideas?
Should the DE0 still work standalone (without the expansion board)? If so, is the link required?
Meanwhile I am scouring the threads in case I have missed something.
I have changed the thread title to better reflect what is/will be here.
I now have my De0-Nano working with the new code. I have documented this in the first post in the sticky.
http://forums.parallax.com/showthread.php/144199-Propeller-II-Emulation-of-the-P2-on-DE0-NANO-amp-DE2-115-FPGA-boards?p=1145599&viewfull=1#post1145599
Software Changes:
Now I have to get the compiler working with my older code. These are the changes required so far...
- Change xinfreq = 80_000_000 (was 60_000_000)
- Monitor start address = $700 (was $70C) - thanks ozpropdev
- The pnut.exe compiler has changed to reflect the new opcodes, so recompiling older code is required.
Original Post:
I have just tried to download the new FPGA configuration (as posted by Chip a few days ago). It reports that it has programmed OK but when I plug my propplug into the DE0 and run PST it does not run the monitor (maybe it does not recognise the "space"). I tried 19200 baud in case the running at 20MHz was the problem.
I retried the old FPGA configuration and all works as expected.
I then reprogrammed the DE0 again with the new FPGA configuration. No luck.
So I plugged in the Parallax expansion board and also put in the link on the DE0 between pins 3 & 5 (checked against the pic Chip posted originally).
I then connected the Propplug to the new header on the expansion board (looking at the Propplug connector, ground is closest the "Prop Plug" white legend and identified by the square solder pad). Still no luck. I haven't run the expansion board before - I seem to recall was there some issue with the SPI Flash.
Any ideas?
Should the DE0 still work standalone (without the expansion board)? If so, is the link required?
Meanwhile I am scouring the threads in case I have missed something.
Comments
Your post popped after I just submitted mine.
I'm having the same issue with the monitor.
If I reset the board from PST using DTR checkbox and press "space" the monitor works.
I cant launch it from my code though?
The new programs require add-on boards.
remove the flash chip as well.
Cheers
Brian
Trying to get my P2 LMM Debugger compiling/working...
I have changed the xinfreq to 80MHz and the monitor rom start to $70C.
pnut.exe now complains about no PUB.
The changes I had to make to Invaders for it to work in the new FPGA and Pnut.exe were as follows.
1. XINFREQ change to 80_000_000
2. The FRQA value for the video generation was recalibrated for 80 MHz from 60 MHz
3. All WAITVID instructions had the POLVID loops removed before them.
4. GETMUL and GETDIV also had their POLLING loops removed.
5. Monitor address changed to $700 from $70C
6. Changed ORGH directive to $E80 from $18E80.
That's was all if my memory serves me correctly.
Cheers
Brian
I have never used PUB in my code, so i'm not aware of that issue?
Besides, most people I know would also complain about no PUBS! (bars,etc)
For PASM programs that ORGH to $E80, use F11 to download. F12 is for Spin2 programs. F10 just loads a single-cog loader at $E80.
Spin2 is in the new PNUT, but it's not documented yet.
Thanks Chip
The problem was I was filling the hub space between $E80-$FFF because I wanted to reserve that space for interprogram mailboxes. So my program started at $1000 hub.
Does pnut still do Ctl-L (create a listing and output file)? It seems to be broken - hence the missing PUB error. I had been using p2load to load the code and start (coginit) at $1000.
Use CTRL-M for PASM or CTRL-L for Spin.
changing the clock. You have to power cycle the Nano after installing the .jic.
The SDRAM timing on the latest configuration files is marginal and may not work. Yesterday, I found some obscure settings for the Cyclone IV I/O pins which lengthens delays in and out of the pad, relative to the clock, and that made things very solid. When I get new config files out (hopefully later today), those timing changes will be in them. The adjustment amounts to about 1ns of overlap, which makes all the difference.
Of course, the first thing I did was run Prop2-Invaders. :):):)
I made the changes to Chip's simple_vga_800X600.spin suggested above and adjusted the frqa_ to $12_000_000 as it is in Invaders.
This worked ok... except that I have thin color bars filling the right side of the image.
I have poked around quite a bit trying to figure out exactly where $12_000_000 comes from... no luck.
Is there an equation or is this an empirical number?
I have looked at the various ntsc drivers and have no clue what needs to be done to run them at clkfreq of 80_000_000 with the latest .jic for the Nano-P2.
Anyone have a working example?
Thanks
Rich
That value is a "frequency tuning word" (long?) that sets the output frequency of counter A to 5.625 MHz. You can hook a scope onto the jumper between pins 3 and 5 of the 26 pin header to observe the counter A output, which is then jumpered back into the FPGA to drive the video generator. The video generator has a 8x PLL circuit, which yields a 45 MHz dot clock for driving the VGA monitor
The equation is:-
tuning value = desired CTR output frequency * (2^32) / 80_000_000 hz p2 clock
(keeping in mind the video circuit has a settable PLL that combines to give the final frequency)
I did a search for 5.625MHz in history... and it turns out that 5.625MHz is a frequency step useful for 3D synthetic apertures used by the European Institute for the Protection and Security of the Citizenhttp://ipsc.jrc.ec.europa.eu... different PLLs:)
If anyone is interested in 3D indoor radar http://d-nb.info/100730880X/34
I am very interested if anyone has 8bit NTSC working with the new configuration. I have samples that used to run but no longer do. I was in the habit of just dumping useful code into a folder without attribution, so I would have to scratch my head to name an author.
Rich
The dot clock is 40 MHz in my code which is the standard as far as I know. My Monitor is a bit picky and does not like non standard frequencies (like 45Mhz).
Andy
PS. I hae a working PAL example but not adapted any NTSC code so far.
That helped a lot. The VGA sample now runs on my cheapo vga projector. So, I don't have to keep changing cables. It also fixes Invaders so I can see it on my projector. The same artifact is there in simple_VGA_800x600.spin... I get nice broad color bars on the left side of the screen and a series of narrow color lines on the right.
When I do the the calculations for frqa for (to produce ntsc 57.272720MHz) I get a decimal value of 384,350,717.73908... which roughly equates to a hex value of 16E8B9FD(or E). I get video!!! out using P2_NTSC_252x96_8bit_Greyscale_DE0.spin(March 17,2013)tubular?.
Do we have to use polling before waitvid to make either of these multitasking?
No this is no longer needed with the newest FPGA image. WAITVID switches automatically into polling mode if more than one task is active.
Be aware: it is not the same for all WAITxxx instructions, WAITCNT needs to be replaced with PASSCNT for example.
Andy