jamesbowman

J1b on Duo tryout

27 posts in this topic

Is anyone inclined to give the J1b no DUO a tryout?

 

The .bit file is at:

 

https://github.com/jamesbowman/swapforth/raw/master/j1b/xilinx/j1-papilioduo.bit

 

If you load it, it should be possible to talk to it over the UART at 921600:

 

There are more details in the reference manual on page 5:

 

https://github.com/jamesbowman/swapforth/raw/master/j1b/doc/j1b-reference.pdf

 

And to get the whole system, clone this tree and look under j1b/:

 

https://github.com/jamesbowman/swapforth

 

Share this post


Link to post
Share on other sites

James,

 

This is excellent news.  Thankyou for all your hard work getting this to run on the Papilio Duo.

 

We really appreciate the extra mile you have gone to get this into the Papilio Community.

 

I shall be trying it tonight, after work.

 

regards

 

 

Ken

 

Share this post


Link to post
Share on other sites

Hi James,

 

I have programmed the j1.papilioduo.bit  bit file into my 2MB Papilio Duo using the Papilio-Loader tool. That loads OK with no errors reported.

 

Please bear with me as I am a complete newcomer to python.  I am using a 64-bit  Windows 8 machine.

 

I have installed Python2.7 and pyserial-2.7

 

(Not Python 3 as some of the syntax is incompatible)

 

I have downloaded the scripts, unzipped and installed them in  C:/Python27/swapforth/j1b

 

I can see that the Papilio Duo UART has appeared on COM4, and I have confirmed that if I run shell.py  that it causes the  Tx LED to blink momentarily

 

I get the message  "Contacting..."  back from the shell, but nothing back from the FPGA  -  no activity on Tx or Rx LEDs.

 

 

Are there any other python scrips or tools that need to be present in my directory in order for this to work

 

Any suggestions appreciated

 

 

Ken

Share this post


Link to post
Share on other sites

Hi,

 

I built the verilog code for the Papilio Pro, using the hex file that resulted from "make" on the PC.

With default settings, the Xilinx synthesis tool gives a maximum clock frequency around 100 MHz (it can't meet the 6 ns constraint on fclk) so I removed the clock multiplier for testing and changed the UART to 9600 baud.

It sends some "smoke signs" - entering "1 2 +" returns "ok" - but any attempt to send files from the "common" folder results in errors or lock-up.

My hardware uses no external RAM at all, is that required? (I think it's mapped to 0x4000, "grep" found some references to that number in the code).

Share this post


Link to post
Share on other sites

Hi James,

 

I have programmed the j1.papilioduo.bit  bit file into my 2MB Papilio Duo using the Papilio-Loader tool. That loads OK with no errors reported.

 

Please bear with me as I am a complete newcomer to python.  I am using a 64-bit  Windows 8 machine.

 

I have installed Python2.7 and pyserial-2.7

 

(Not Python 3 as some of the syntax is incompatible)

 

I have downloaded the scripts, unzipped and installed them in  C:/Python27/swapforth/j1b

 

I can see that the Papilio Duo UART has appeared on COM4, and I have confirmed that if I run shell.py  that it causes the  Tx LED to blink momentarily

 

I get the message  "Contacting..."  back from the shell, but nothing back from the FPGA  -  no activity on Tx or Rx LEDs.

 

 

Are there any other python scrips or tools that need to be present in my directory in order for this to work

 

Any suggestions appreciated

 

 

Ken

 

Hmm, if it gets to "Contacting..." then the Python part is working fine.

 

I would check the COM port that it is talking on. On Linux the DUO appears at 2 ports, because the FTDI chip is a double, so I have to pick the higher port.

Share this post


Link to post
Share on other sites

James,

 

I checked the serial port and I am definitely using the correct port.

 

If the J1b is just plugged into a standard serial terminal program, is their any response via the Uart Tx that would confirm operation?

 

I am at a bit of a loss here, to as whether the device is not running on my 2MB Duo, or whether it is some artifact caused by using Windows rather than Linux to host the python shell.

 

any help appreciated

 

 

 

Ken

Share this post


Link to post
Share on other sites

James,

 

I checked the serial port and I am definitely using the correct port.

 

If the J1b is just plugged into a standard serial terminal program, is their any response via the Uart Tx that would confirm operation?

 

I am at a bit of a loss here, to as whether the device is not running on my 2MB Duo, or whether it is some artifact caused by using Windows rather than Linux to host the python shell.

 

any help appreciated

 

 

 

Ken

 

Hmm, yes. You should be able to connect to it using any terminal program. The speed is 921600, and you *must* make sure that the terminal drops DTR (as below) because it is the reset signal.  Pressing return gives 'ok':

 $ miniterm.py /dev/ttyUSB1 921600--- Miniterm on /dev/papilio: 921600,8,N,1 ------ Quit: Ctrl+]  |  Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ------ DTR inactive ---  ok  ok  ok  ok1 2 + . 3  ok  ok  ok  ok  ok  ok
 
I have updated the built .bit file to run at 80 MHz, please can you retry with it?
 
 
Thanks, James.

Share this post


Link to post
Share on other sites

Thanks James,

 

I will try out the 80MHz version tomorrow - and see if it was just a timing issue.

 

Much appreciated

 

 

Ken

Share this post


Link to post
Share on other sites

James

 

The 80MHz version works "out of the box"  - so I guess it may have been a timing issue. I notice that the speed grade of my Spartan 6 is 2C.

 

I now need to get the shell to work under Python 2.7.

 

I'll let you know when its up and running

 

Thanks again

 

 

Ken

Share this post


Link to post
Share on other sites

James

 

The Shell now connects with the j1b - but is complaining about an ImportError - see attached screenshot.

 

What am I missing?

 

 

 

Ken

post-38539-0-16908800-1442995183_thumb.j

Share this post


Link to post
Share on other sites

Hi,

 

I'm no pro snake charmer but I think the problem is that the "readline" library is missing.

For example see here:

 

https://pypi.python.org/pypi/readline

"Some platforms, such as Mac OS X, do not ship with GNU readline installed."

 

Installing package called "pyreadline" might fix it (untested, see above link).

Share this post


Link to post
Share on other sites

Hi Offroad,

 

Thanks for the tip.

 

I'll have a go this evening after work.

 

 

 

Ken

Share this post


Link to post
Share on other sites

James,

 

Sorry for my late reply, but I have been attending various open source events around the UK this last week and enjoying the unseasonal exceptionally sunny weather.

 

I hope to spend some quality time with the J1b this weekend.  Will try the new shell with Win 8.

 

Will report back later with my findings

 

 

Ken 

Share this post


Link to post
Share on other sites

Is anyone inclined to give the J1b no DUO a tryout?

 

The .bit file is at:

 

https://github.com/jamesbowman/swapforth/raw/master/j1b/xilinx/j1-papilioduo.bit

 

If you load it, it should be possible to talk to it over the UART at 921600:

 

There are more details in the reference manual on page 5:

 

https://github.com/jamesbowman/swapforth/raw/master/j1b/doc/j1b-reference.pdf

 

And to get the whole system, clone this tree and look under j1b/:

 

https://github.com/jamesbowman/swapforth

I'm confused -- the J1B Reference Manual says on page 7:

"After installing the icestorm tools,..."

From what I've read, these are for the Lattice iCE40 FPGAs, not the Xilinx Spartans that are on the Papilio boards.

What have I missed?

(BTW, I'm just about to get into the world of FPGAs, and the J1B seems like a great place to start.)

Thanks!

Share this post


Link to post
Share on other sites

Aha yes, that was a typo. It says "Xilinx" now. Thanks.

 

I'm confused -- the J1B Reference Manual says on page 7:

"After installing the icestorm tools,..."

From what I've read, these are for the Lattice iCE40 FPGAs, not the Xilinx Spartans that are on the Papilio boards.

What have I missed?

(BTW, I'm just about to get into the world of FPGAs, and the J1B seems like a great place to start.)

Thanks!

Share this post


Link to post
Share on other sites

Hi James, I don't have a Papilio Duo but I have an old Avnet Spartan3A eval board with a Xilinx xc3s400a chip. I made some small changes to your J1b to work on that board. If you think I should upload it somewhere please let me know. Thanks for your great Forth CPU. The 16bit J1 had me hooked on Forth :-)

 

Basically, I changed the BRAM and serial link(my Minicom only runs upto 115200) and the j1b runs. I can enter something like: 1 2 + . and it says 3. A screen capture:

 

 

[yibing@yibing j1b]$ python shell.py -h /dev/ttyACM0 -p ../common/ swapforth.fs

Contacting... established
u': \\     source nip >in ! ; immediate \\ Now can use comments!'
u'\\       '
u'\\ This file contains definitions in high-level Forth for the'

...............

Loaded 528 words
>  ok>$30000 $a0000 + .
 851968  ok
>hex
  ok
>30000 a0000 + .
 D0000  ok
>

 

 

mark

Share this post


Link to post
Share on other sites

Ok, can confirm j1b on P-DUO lives. But I couldn't figure out how to get DTR right on Windows w/ Putty, so in the end I uploaded the bit stream to flash, and reconnected to a Raspberry Pi. This link describes how to set it up to recognise the FTDI adapter for serial port use: http://www.element14.com/community/docs/DOC-76657/l/installing-and-running-xxicc-rev-00p

 

Looks like each empty DO LOOP iteration takes 100 ns. Nice!

 

-jcw

 

Edit: it was not 10, but 100 nS. Still pretty good!

Share this post


Link to post
Share on other sites

James, jcw,

 

My new Papillio Duo and computing shield arrived today.  These were the ones I ordered during the special offer on CyberMonday.  

 

This means I now have an additional set of hardware to devote to the J1b  -  as the first two boards are currently tied up with ZPuino projects - and so far I have only been working with a J1b simulator running in C on a STM32F746  - which runs about 1/10th of real speed.

 

jcw - if you are interested in some benchmarking  - how about a simple loop that toggles an I/O pin - that would give an idea of how quickly we can do hardware related things?

 

It would be really cool to get the J1b working with a VGA output - James - I am sure that you know exactly how to do this :)  Is there a Gameduino 1 hack that could be done?

 

 

Ken

Share this post


Link to post
Share on other sites

Hi JCW, James,

 

I use "Termite" under windows 

 

There's a Plug -in under setting that is called "Status LEDs"   - that allows you to set DTR as you need.

 

I was able to get 5.27MHz Output Pin toggle using  James's code modified as follows to remove delay

 

: blink OUTPUT 13 pinMode

0 begin dup 13 io!

invert 

again ;

 

 

 

And this version toggles at about 7.5MHz

 

: fasterblink

OUTPUT 13 pinMode

0 begin

1 13 io!

0 13 io!

again ;

Share this post


Link to post
Share on other sites

This evening I got the Python Shell running with Python2.7 and Win 7.

 

You need to adjust the Path system variable - and also install PySerial.

 

I have now got what i consider to be  minimum "friendly environment" working  - so I can start to explore the J1b and Forth language.

 

In the pipeline I have a new open source  pcb design (currently at manufacturers) for a shield that supports the FTDI  FT812  Embedded Video Engine (Eve) - outputting to Dsub VGA connector (800x600 60Hz) plus PS/2 keyboard and Mouse. This pcb will work with anymicrocontroller with Arduino headers that suppoerts  SPI interface  - including Papilio Duo, Nucleo, Discovery F7, Arduino + Teensy  etc.

 

It's VGA output for the big screen.

 

Have  a Happy Christmas

 

 

Ken

Share this post


Link to post
Share on other sites

Hey Ken,

 

That EVE design sounds wonderful! I would love to check it out when it is ready. I had considered doing one myself but never found the time.

 

Jack.

Share this post


Link to post
Share on other sites

Hey Jack,

 

I should get the pcbs back early next week - just in time for Christmas.

 

James B is also having a set made up Stateside - so I expect that he will have it up and running with the J1 long before me.

 

I'll forward you the EagleCAD files if it would be of potential future interest.  

 

The SPI interface is wired to the usual pins on the  Arduino headers - so potentially it could be used as a video graphics co-processor for either the ATmega - or the FPGA on the Papilio Duo.

 

 

I will keep you posted - as we make some progress.

 

 

Have a Happy Christmas and a Prosperous New Year

 

 

Ken

Share this post


Link to post
Share on other sites

Hi Jack, James, All

 

My Eve pcbs arrived today - so I hope to get a couple built up later this evening.

 

The attached images show the bare board, and the completed board, fitted on top of the Papilio Duo - using the standard "duemillenove" Arduino headers.

 

The board offers the 800 x 600  24 bit VGA graphics to either the Spartan 6, or if you wish, the ATmega32U4.  

 

In theory you could play "Gameduino" like games  - using just the 32U4.

 

However, the plan is that the FT812 Eve "embedded video engine"  IC  augments  the J1b Forth processor - with very little processing overhead.  

 

I have also included a secondary VGA resistor network - such that the FPGA could generate its own RGB 3:3:2 video output - independent of the Eve IC. This could be used for the existing ZPUino processor as a simple way of getting a  limited  256 colour VGA display.

 

Also included are sockets for PS/2 keyboard and mouse - and a spare "FTDI" cable connector to give an additional UART connection.

 

I will be spending some time building up this board over Christmas, and collaborating with James regarding the driver code needed to access the FT812 from the J1b processor.

 

 

Merry Christmas and Prosperous New Year

 

 

 

Ken 

post-38539-0-53418700-1450801831_thumb.j

post-38539-0-77205400-1450820947_thumb.j

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now