The Toggle Tutorials
mindrobots
Posts: 6,506
I like the toggle examples because they are iterative implementations of basically the same program progressively increasing in complexity as they include more and more sophisticated Propeller and PropGCC functionality. I've been going through them and verbosely commenting the source as I figure out what each is doing and what feature is being exploited/showcased. An updated demos\toggle\directory is being created with my changes.
Attached is the initial draft of "The Toggle Tutorials" for critique and feedback. As I see this now, it isn't a beginner's guide to C, or a beginner's guide to the Propeller but more a transition guide to help someone with some knowledge of C and Propellers start using PROPGCC and making use of the propeller features they know and love (multiple I/O pins, multi-cogs, PASM, etc.) and also understanding how to do some things in PROPGCC (multiple COGS, LMM, XMM, threading, COGS running PASM, COGS running GAS, etc.) that they may be doing in SPIN and PASM.
At some point, I'll introduce some input processing techniques. I was hoping to end the tutorial with an I2C implementation since that's a relatively simple yet sophisticated example of choreographed PIN I/O that does something useful.
I'd like honest feedback on the value of this and where it fits in the skill/learning continuum. Its good for me because I currently know a little about a lot of the stuff going on. I'm not a Propeller master in anyone's imagination and I'm certainly not a C guru but I do have a solid background and good grasp of the hardware and software concept involved.
I did start to borrow some of the Wiki contents to fill appendices and other knowledge holes. Plus I've also gotten some great info from Steve and Eric which will be incorporated into this journal of my learning journey.
If you have time, please take a look and provide any constructive feedback also if you can give me some direction as to continue or not. It's a great learning experience but we all know how much fun writing documentation can be.
I hadn't considered it but if this is better as a series of Wiki documents under Tutorials or something, I can surely do it that way. I've never Wiki'd before but I can probably handle that aspect if required/desired.
Thanks for your time and feedback!
Attached is the initial draft of "The Toggle Tutorials" for critique and feedback. As I see this now, it isn't a beginner's guide to C, or a beginner's guide to the Propeller but more a transition guide to help someone with some knowledge of C and Propellers start using PROPGCC and making use of the propeller features they know and love (multiple I/O pins, multi-cogs, PASM, etc.) and also understanding how to do some things in PROPGCC (multiple COGS, LMM, XMM, threading, COGS running PASM, COGS running GAS, etc.) that they may be doing in SPIN and PASM.
At some point, I'll introduce some input processing techniques. I was hoping to end the tutorial with an I2C implementation since that's a relatively simple yet sophisticated example of choreographed PIN I/O that does something useful.
I'd like honest feedback on the value of this and where it fits in the skill/learning continuum. Its good for me because I currently know a little about a lot of the stuff going on. I'm not a Propeller master in anyone's imagination and I'm certainly not a C guru but I do have a solid background and good grasp of the hardware and software concept involved.
I did start to borrow some of the Wiki contents to fill appendices and other knowledge holes. Plus I've also gotten some great info from Steve and Eric which will be incorporated into this journal of my learning journey.
If you have time, please take a look and provide any constructive feedback also if you can give me some direction as to continue or not. It's a great learning experience but we all know how much fun writing documentation can be.
I hadn't considered it but if this is better as a series of Wiki documents under Tutorials or something, I can surely do it that way. I've never Wiki'd before but I can probably handle that aspect if required/desired.
Thanks for your time and feedback!
Comments
Ron
I'll count that as a vote to move onto Tutorial #2 lmm_c_toggle.
Some small details:
- The demos/libpropeller directory is going away, but will come back as a small library another day.
- Header propeller.h is now in lib/include/propeller.h, and propeller.c is no longer used.
- 0x0ff0000 could be expressed as (0xff << 16) - it makes it easier to read the start bit.
It would be good to illustrate using propeller-gcc commands in addition to make commands.One advantage of that would be going directly from the LMM program to a COG program simply by adding -mcog.
Looking forward to the rest.
--Steve
You sure filled in a lot of grey area I had about memory models. And now for my brilliant question of the day. What is the size of the kernel running in the cog and is it the same size for all memory models? I looked twice and didn't see it, though I might have missed it. Thanks Again.
Ron
1 & 2 - I figured the locations of things would be changing as things evolve - I'll tag those so they can be more easily updated later.
3 - I'm still used to my 16 bit days when 4 hex digits didn't look too bad. 8 hex digits does get a bit awkward at times if it can be shorthanded.
I was headed toward putting the propeller-gcc command in there. I must have gotten distracted by something shiny.
Any Wiki versus pdf thoughts? I could go either way at this point - wiki has the hyperlink advantages. PDF has better hard-copy, e-reader and offline appeal.
The memory model text for the most part came from the Wiki site -> http://code.google.com/p/propgcc/w/list
That is an interesting question. I'm in no position to answer it. I think we need to invoke the names of the Guru's and hope they can help!
I'll go on the hunt for the info. I am sure it's somewhere.
Ron
Practically speaking the kernel takes up the whole cog. If it doesn't, then we're leaving performance on the table. We are looking at ways (besides FCACHE) to let user code run in the kernel, based on options given at compile time.
Eric
I just read Bill Hennings original thread about LMM very interesting how it all came together, with the 4 lines of assembly code. The details on the size of the kernel help put it all together and make sense, don't leave anything table.
Ron