Notes On Propeller (might be helpful for new user )
Bob Drury Posts: 236
in Propeller 2
Attached Word document with navigation bar might help with syntax look up for propeller has essentially what has been previously documented on Parallax site but includes examples might help new users waiting for Propeller manual.
Very nice Bob!
Very nice doc, Bob!
Updated "Hello Propellwe 2 Examples Rev02.docx" and added the example program files. docx is at bottom of zip file list
That's a lot of effort you've thrown in! You're picking up plenty of good details too.
Are you doing this for Parallax? They are beavering away on docs right now themselves.
PS: Section 4.1 "P2 Uses a Voltage Divider approach." ... I should point out the first figure is also a voltage divider circuit. The main difference is the Prop2 uses a more robust and faster acting arrangement that doesn't have the buffering op-amp. Therefore the output is pure resistive, hence why the output resistance is specified. I think it also has the side effect of better linearity as well but that's just a guess from me.
PPS: Looking it up, the first figure is called a "binary weighted resistor" DAC. Linearity of that type becomes a major issue at higher word sizes. The "R-2R ladder" DAC is effectively the same but greatly improves on the linearity.
Prop2 uses what's called a "Thermometer coded" or "Unary coded" DAC. A name I've never bumped into before but then I'd not seen the exact method either. It's pretty heavy on real-estate but does deliver high precision at speed.
Prop2's ADCs are what's called a "sigma-delta modulator" or "delta-sigma modulator". Just a single fast comparator with feedback, which oscillates in the MHz, producing a natural bit-stream known as pulse-density-modulation (PDM). This is subsequently vacuumed up by a counter configured as a "Sinc filter/decimator" from which you then get your typical PCM samples.
Thanks for reply. I will add your comments into the document for future revision. I am not doing this for Parallax who will do a better job when then get around to the docuentation, but anyone who wants to use it can. I am retired and I think the propeller II has so much poetential for learning .
Most recent revision see docx file examples updated
Valuable information inside. Thank you.
May I suggest updating the first post with the newest doc file and commenting the changes within the consecutive posts ?
This way one will always have the newest document version at the top and the newest comments detailing the changes as they come in the posts.
Great work Bob!
I will see if I can do that on the next update.
Latest Revision 4 of Notes. Working on Assembly operand instruction examples.
New HelloPropellerP2Rev05 Added more PASM instructions examples mainly ALT commands
New HelloPropellerP2Rev06 added more PASM examples and Information on CRC8 Cyclic Redundancy Checks (thanks to forum members for helping with understanding PASM Syntax)
A PDF of your work might be in order. When I load the .docx with LibreOffice it looks pretty untidy in many places. Font sizes are wonky so that not a lot fits on a page. BTW: I'm getting 815 pages.
It is 669 pages. I had trouble making PDF . I finnaly got it to export . I believe my laptop doesn't have enough memory.
I like the feeddback thanks. Does the PDF give you Navigation tool? Does Libre office have the navigation tool? I find this really useful for jumping around in word document.
Nice, just very, very, nice. Only gripe so far is the pin block diagram is fuzzy on my screen. Kinda like the edges and characters are a bit out of focus. Otherwise, wish I had seen this sooner.
For long documents like this, I really like LyX. It's a graphical front end for LaTeX. I started using it back when my computer didn't have enough ram to load OpenOffice, let alone handle a long document.
If you don't mind, I might try starting with this document.
BY all means go for it. Goal is to get a good manual for the propeller II
@"Jeff Martin" is supposed to be giving an update today on the state of P2 documentation -- it's part of the P2 live stream at 1PM (Pacific Time).
@"Bob Drury" Glad you wrote all this down!
If you don't mind, I added it to my P2 web page: http://www.rayslogic.com/Propeller2/Propeller2.htm
Please use it how ever you want.
Can I put your website in notes?
Sure, no problem...
Added more P2 instructions and some info HDMI\DVI looking for some CALL subroutine examples and some Selected events examples if any one has PASM code it would be apreciated.
I guess I can't post file updates anymore it is too large to attach.
Might be a good time to section it up and make a file for each.
CALL examples ... that's so ordinary ... oh, hehe, not well suited to inline assembly examples though.
CALL is how compiled programs execute functions/methods. An assembly demo using CALL would be best demo'd in a separate cog where it can be pure pasm.
When I'm testing the hardware limits I'm often using pure pasm from go to whoa. Then I use my own debug routines for reporting results. Sometimes this involves trashing all of hubRAM. So everything needed is contained in the one cog. Here's an example snippet:
The relevant subroutines are:
I think your right I will section it up. To start I think I will leave all the examples as files and just have their file names in the main body with the assembly description. It is
actually redundant having both. Thanks for Call program will go through it . My experience was with 6802D5 kit from motorola where subroutines had stacks that were automatic (Push\Pull) and the propeller doesn't really have that . (at least that I know of) so I was curious how the stack is made and how the interrupt routines would handle
that. Since there really aren't CPU registers that require saving and restoring in the same way (trying to remember way back ) it may not be required at all .
Regards and Thanks
Oh, right, yes, there is a choice of stacks in the Prop2, as opposed to the Prop1 which had none. Above, I use the dedicated 8-level hardware stack, or, more accurately, CALL/RET use it. Which means no RAM used for the implicit push/pop, and also means it is the same speed, 4 sysclock ticks (13..20 hubexec), as a JMP instruction.
Compilers will more likely use a stack in hubRAM instead. For that, CALLA/RETA uses PTRA register as the stack pointer. Speed is 5..32 ticks for the branch (maybe hubexec) and push combined. RETA is longer at 11..40 ticks, since the implicit pop is a rdlong timing compared to push's wrlong timing.
CALLB/RETB can be used for PTRB as well.
And finally, there is CALLD (JMPRET in Prop1), which doesn't use a stack. This is same as LINK instruction in other processors. It branches like a JMP while saving the PC in a named register. Very flexible.
EDIT: Corrected the speeds to include hubexec.
ISR entry is handled by means of an injected CALLD. There is a collection of reserved cogRAM for this. ISR exiting, both RESx and RETx, is via aliasing of more CALLD variations. Stack is untouched.
So don't go exiting from an interrupt with anything extra on the stack.