View previous topic :: View next topic |
Author |
Message |
Guest
|
command set program architecture - recommendations |
Posted: Tue Oct 14, 2008 3:15 pm |
|
|
Hello,
I've found some topics on this item, but nothing that has been conclusive. I am working on a new project which will buffer commands from the serial lines and control the code accordingly.
Most of my projects in the past have been pretty basic and run in one large loop just checking for flags. I'm not sure if I want to this on this project, as it will probably be a little more complex.
I'm wondering if any of you can recommend some good books that cover the software architecture methods that address some of these things. A book that uses CCS would obviously be the best, but most importantly the architectures, when to use them and when not to.
Thanks for the help |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Tue Oct 14, 2008 4:51 pm |
|
|
If I understand your problem, there's no reason to change your tried & true "loop & look for a flag to be set" methodology. Start by examining the EX_SISR.c and EX_STISR.c examples that come with the compiler.
I've coded a lot of interrupt-driven serial receive and transmit stuff, some of it VERY time critical, and I've never run into any limitations. I keep my ISRs very short - in the receive ISR I simply look for the end of a complete incoming message, then I set a flag. My main() routine just looks for that flag to be set, then proceeds with an in-depth analysis of what just came in.
Is that what you're after? |
|
|
fvnktion
Joined: 27 Jun 2006 Posts: 39
|
|
Posted: Wed Oct 15, 2008 8:20 am |
|
|
Thanks for the info newguy. Yes that is quite helpful.
Further I'm curious what some of your favorite documented resources might be? Books and so forth. I don't feel like I have a good set of hard resources for much of the stuff that I run into. I think it would be great to hear from some of you experts as to what are your favorite resources.
It seems like so many of the question that are asked can be resolved by some of these.
Thanks |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Wed Oct 15, 2008 8:56 am |
|
|
The best book I've ever read that covers the CCS compiler with some practical coding examples is Embedded C Programming and the Microchip PIC by Barnett, Cox and O'Cull. It's well worth having on your shelf. |
|
|
|