How to start
ManAtWork
Posts: 2,176
in Propeller 2
Although I have quite a lot of experience with the P1 I'm totally new to the P2 and I haven't followed all the discussions here. So I'm trying to gather as much information as possible to be able to play a little bit and hopefully start my first P2 project, soon. Sorry for starting a new thread with questions that have surely been asked before many times. But all the answers are hard to find and scattered around the forum. And hopefully others find it also useful to collect them here.
I've already found the data sheet: https://docs.google.com/document/d/1gn6oaT5Ib7CytvlZHacmrSbVBJsD9t_-kmvjd7nUR6o/edit?usp=sharing
Is there a "minimum example schematic" somewhere? I mean, what is the minimum configuration (absolutely required external parts) to run the P2? crystal, voltage regulator, flash ROM, download/debug connector?
I've seen Parallax sells engineering samples
https://www.parallax.com/product/p2x8c4m64p-es-4
but I've found no Eval board. Is this one the only one available, right now?
http://forums.parallax.com/discussion/170695/p2d2-with-p2-revb-taking-orders/p8
It's no problem for me to make my own boards. It would just speed up getting the first prototype a bit.
What software do I need if I'd like to start with Spin, Assembler and C programming? I'm focussed on embedded realtime applications so I currently don't need an OS, video, filesystem etc.
In a realtime system a single step debugger is not of much use. On the P1 I used a simulator so I was at least able to test complicated math code in assembler. Debugging on the live system was done by sending prints or binary data over COM port to some scope software I've written by myself on the PC. I've heared the P2 has some hardware debugging features. Is that already supported?
I fear I can't really tell if everything works as I expect before December 17th which is the deadline for ordering larger quantities of P2 chips until October 2020. But I'm optimistic and consider ordering at least one tray.
http://forums.parallax.com/discussion/170919/order-p2x8c4m64p-now-for-april-delivery-up-to-990-units-per-customer#latest
I've already found the data sheet: https://docs.google.com/document/d/1gn6oaT5Ib7CytvlZHacmrSbVBJsD9t_-kmvjd7nUR6o/edit?usp=sharing
Is there a "minimum example schematic" somewhere? I mean, what is the minimum configuration (absolutely required external parts) to run the P2? crystal, voltage regulator, flash ROM, download/debug connector?
I've seen Parallax sells engineering samples
https://www.parallax.com/product/p2x8c4m64p-es-4
but I've found no Eval board. Is this one the only one available, right now?
http://forums.parallax.com/discussion/170695/p2d2-with-p2-revb-taking-orders/p8
It's no problem for me to make my own boards. It would just speed up getting the first prototype a bit.
What software do I need if I'd like to start with Spin, Assembler and C programming? I'm focussed on embedded realtime applications so I currently don't need an OS, video, filesystem etc.
In a realtime system a single step debugger is not of much use. On the P1 I used a simulator so I was at least able to test complicated math code in assembler. Debugging on the live system was done by sending prints or binary data over COM port to some scope software I've written by myself on the PC. I've heared the P2 has some hardware debugging features. Is that already supported?
I fear I can't really tell if everything works as I expect before December 17th which is the deadline for ordering larger quantities of P2 chips until October 2020. But I'm optimistic and consider ordering at least one tray.
http://forums.parallax.com/discussion/170919/order-p2x8c4m64p-now-for-april-delivery-up-to-990-units-per-customer#latest
Comments
Personally I would suggest starting with FlexGUI, which has PASM, Spin, BASIC, and C support in one package, and also comes with a demo of micropython. But I'm biased, since I wrote it .
Other good choices are Tachyon FORTH (it's a very complete system and probably more mature than any other tools available right now) and Catalina C (a C89 compiler that was originally on P1 but now has P2 support).
@ozpropdev has done some work on debugging, but I don't know the current state. There is a P2 simulator (the somewhat misnamed "spinsim", which can also simulate P1).
Regards,
Eric
Right after that, run one of the examples that sends text back through the serial / USB connection and you are off to the races.
Attached is a schematic of the most basic parts needed to get going, apart from the power supplies.
The SPI Flash memory chip could be replaced with an SD card socket instead (use the same pinout as for the flash chip, but swap the CS and CLK pins).
Edit: Attached schematic updated with link to documentation for the Propeller 2 chip footprint and ground pad information
I'll use the AP3402 step-down regulator for the 1.8V and an LDO for 3.3V. And I've just ordered 4 ES chips. No patience to wait for the eval boards...
And I've found the Eval board schematics. https://www.parallax.com/downloads/propeller-2-es-eval-board-schematic
Unfortunatelly, the types/values of the ICs are missing, so I can only guess. Any SPI flash with at least 512MB = 4Mb works? So I could take the AT25SF041 or MX25V4035 oer AT25SF081 if I want some spare memory for data storage?
Your right about the ground pad- and thanks for the feedback; I'll make that clearer on the schematic.
The last page if the RevA schematic includes a full BOM. The flash IC was the same for RevB.
You changed a lot with the regulators I think and definitely the USB power handling.
That's true. I'll see about getting the RevB bom added to that schematic file. I thought it was "out there"; memory can be a funny thing sometimes!
https://www.parallax.com/downloads/propeller-2-es-eval-board-design-files
Thanks evanh!
I posted the design files for my P2 board here:
https://forums.parallax.com/discussion/170725/my-first-p2-pcb-its-alive/p1
I made a couple mistakes, but they were fixed in the files that are posted.
If you design your own pcbs, take a look at what the pullups and pulldowns do on pins P59-61 for booting the P2. You might need these to be linkable for your testing, and for security too as you can prevent downloading. Its not foolproof tho.
You can probably get a P2D2 board(s) from Peter - he’s assembling atm.
I forgot, use Eric’s Flexgui for compilation, and/or look at Peter’s TAQOZ - there is a version built right into the P2s ROM
And for testing, theres my monitor/debugger in the ROM which allows dumping cog/lut/hub etc.
If you want a more complete schematic (that stills fits on one page) then have a look at this one for the P2D2 (r3). Plus I have attached the datasheet anyway.
I think its going to catch people out, if those people are used to P1's internal RESn pullup (or other micros)
Yes, thanks for the heads-up, I was thinking I needed to update that!
many thanks for the documentation. I'm currently routing my first P2 PCB layout... One question: The short form data sheet list the ePad dimension as 10.3mm as the full datasheet says 9.6mm. Which one is correct.
I don't know if it matters much but I found out that at least smaller QFN packages are auto-centered better if the ePad is corrently sized.
I know there are those discussions about FastSpin and FlexGui, but I don't want to read 1000s of messages. I've read the forst pages but, unfortunatelly, there's little useful information for the newcomer...
You can find Spin 2 vs Spin 1 differences as proposed and implemented by @ersmith in FastGUI. Most of us are considering that as a forward looking look at Spin 2 that is useful today.
That, plus your Propeller Manual, found in the menus of PropTool, or as a download from Parallax are pretty good to get started.
Spin basics are likely to continue to work just fine. Some operators have changed. See the fast GUI doc for a quick reference.
Spin 2 features may see change for some time yet.
I am working in PASM and Spin, keeping it simple for code I want to use in the future. I use Pnut and FastGUI currently.
Shame on me. I was too stupid to find it, but now I did. The language definition or at least the differences/extensions are described in "spin.pdf" in the "doc" folder of FlexGui. I've first looked in "fastspin.pdf". It contained no language definition but only the command line parameters and some general info about the compiler. I was disappointed and didn't look further.
Compiling and running from RAM works. Writing to flash also works, at least the programmer says But the P2 doesn't boot from flash when I cycle power. What can be wrong? I have the EEPROM connected as shown in Peter Jakacki's P2 shortform.pdf:
P61 to /CS with pullup, P60 to SCK, P59 to SI, P58 to SO. The EEPROM is a MX25V8035FM from Macronix. I hope it is compatible. I remember Chip said something like "all SPI flash chips support the same read command. They only differ in page size and write commands." So I think if writing works then booting should also work...
Can somebody please tell me what that new addressing modes mean? OK, "#" is immediate, but what does "##" and "#\" mean? There are even more confusing patterns like "#\@ " and "##@ ".
## indicates a 32-bit immediate value, such as add x, ##123456
\ indicates that an absolute address should be used, such as jmp #\label
@ causes the hub address to be used, such as long @label
@ is important in two ways: Firstly, it provides the byte offset into the binary file as compiled/assembled. This matches where a loader will put the binary in hubRAM at runtime. Secondly, because it is always byte sized offsets this allows a defined way to know lengths of static data in the binary. PS: Eric has an extension to this with @ @ for compiled code, I'm not sure what the difference is.
EDIT: Had to place a space between the two at's to stop the forum software going screwy.
Still no clue about the flash problem. I've set the flash command line options to verbose (-v). The output is now: I hope the flashloader does a verify to ensure the write to EEPROM has been actually successful.
Again, my wiring is like this: P61 to /CS with pullup, P60 to SCK, P59 to SI, P58 to SO. The EEPROM is a MX25V8035FM from Macronix.
TAQOZ is built into the ROM for checking hardware among other things, so when you have new hardware to debug, use TAQOZ.
With a terminal connected, reset the P2 and type the 3 characters [>] [SPACE] [ESC] to enter TAQOZ. Then type .SF and it should report Flash ID etc. You can examine and program/erase the Flash from TAQOZ.
To make P33 blink an LED type:
33 BLINK
To make P34 go high or low:
34 HIGH
34 LOW
Uh, this is something that should definitely be fixed soon! Especially for testing of new prototype boards (and later production) it saves a lot of time finding problems. And it shouldn't be too hard to implement.
BTW, I checked the data sheets of both Macronix MX25V8035 (mine) and Winbond W25Q128 (used for the P2D2 and Eval board AFAIK). All basic commands (Read, Chip Erase, Page Program, Write Enable...) seem to be compatible. Page size is 256 bytes for both devices.
Next thing to try is using TAQOZ as Peter suggested. It's completely new to me...