I am done with On-The_Fly deisgn. This is also called Cowboy Coding. Politicians get in trouble when they shoot from the Lip, and Cowboys miss the target when they shoot from the hip. Engineers who dash off projects are simply hobbyists who are getting overpaid for their work, IMHO. I am as guilty as anyone of this! Cowboy coding results in projects that even the designer cannot understand 6 months out. When you design a project, you have to figure out the pinout on the chip. You have to figure out the clock frequency. You have to decide on the major subroutines. Are you going to use a superloop design or an interrupt driven design or a combo? Are you going to poll buttons or use interrupts for buttons? Given the interrupt parameters and the crystal you selected, what should the interval between interrupts be? Do you need a timer or another peripheral? What are the setup parameters? What peripherals are being driven or interfaced? What is the circuit diagram? What is the state diagram of the project (flow diagrams are useless IMHO, but state diagrams are good) ? What will be the user interface? How many buttons, speakers, motors, whizzers, fizzers or bionic sensors? How will the unit be used? What is it supposed to accomplish? At the very minimum ( and this is too little documentation) all of this stuff should be included in comments at the beginning of the main code file. In a small one-off project, this is often how I do things. I don't dash off a project without a pinout list at the beginning of the main C code file, and some of the other items listed. Circuit diagram, even if it is scribbled on an envelope, is better than carrying one in your head. For a very simple project (two buttons and a speaker) a verbal circuit diagram might suffice, but don't fall into this trap. The above documentation should be brief, and for a small scale one-off can be extremely brief. However if it is missing the project is not done. You should not write a single line of code until you've sat down and figured out some basic documentation for the project. You owe this to yourself. Takes too much time you say? It takes very little time to write down your design decisions, far more time to actually figure them out. Keep a notepad window open while you are punching calculator buttons and reading up on Timer1 bit settings and write that stuff down. Cowboy Coding is great fun, and results in the most bug-riddled code possible. If you are working with a far-flung team (currently I am working on projects with Engineers in Stockholm, Hong Kong, Seattle, Chicago, and Amsterdam. I am in Missouri. ) all of this documentation becomes critical. If you are working on a hobby project for yourself, then you will put down the project for a month or two then scratch your head when you pick it back up and end up starting over. If you are in a lab, others will need to use your tools that you create. You will need to use that tool 5 years from now. How does it work? Regardless, writing down all these design decisions is good discipline and separates Engineers from cowboys. -- Lawrence Lile Robert Rolf Sent by: pic microcontroller discussion list 01/18/2004 11:30 PM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: Re: [OT]: Re: Horowitz... On-the-fly design "T.C. Phelps" wrote: > > UAlberta? Greetings from Calgary, fellow Albertan. :)> Yeah, scary how many people I run into saying that they'd seen me on the PICLIST. Who knew that this was a best seller list ? > > Hence my point about THOUGHT being important. > > Yeah, in years past I've jumped into projects without > thinking too much and wound up starting over. That was > before discovering the immense value of designing > something first instead of trying to build and design > at the same time. ;) There is something to be said for designing on the fly. It gives you a chance to test key parts of a design to validate your ideas before you get too far along. It also lets you use what you have. If you have sufficient experience, you can get to the end result more quickly, such as when I used to stop at Active Electronics on my way to work, and designed circuits for a 'we need it right now' project to use what they had in stock. Now that Active stocks bugger all, I am forced to do a full design just so I can order all the parts I'll need the first time around. /rant on If I find a nice part for a project, I -may- be able to get a sample, but if I need 10, I'm S.O.L because everyone is only interested in 5k+ piece orders. MOQ (minimum order quantities) are killing basic research and development by hobbiests. Thank goodness for Digikey, even if they are pricey. But if the big mail order houses don't carry a part, you're out of luck unless you have deep pockets and can afford to waste 90% of a MOQ order. /rant off Robert -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body