Too quick with the send button... If your main program is nothing but a series of calls to subroutines, you can divide and conquer by commenting out a particular subroutine during test in order to see if that's where your problem is. This also allows for easier simulation and test in that you can test individual modules independently of the rest of the program. It's always easier to beat a critter into submission a little at a time than to take everything on all at once. Those of us with simple minds must find simple solutions. But this, too has been learned in an analog world...block out a system, break all of those blocks into smaller and simpler blocks. The system is nothing more than a set of simple circuits put together to form a complex function...bricks used to build a wall. REB Roy E. Burrage wrote: >To add to this, building your program as a set of modules makes this >process a lot easier. Your main program would be a series of calls to >subroutines that would return to the main program when they're done >doing what ever it is they do. Doing a flow chart helps in this >process. It takes a little more time up front, and forces us to put >some forethought into what our program is going to do in the beginning, >but saves time in the long run. > >Of course, there are always those who hate to document... > > >REB > > >David VanHorn wrote: > > > >>This is a part of the art that isn't taught much.. >> >>How to diagnose or debug a problem. >> >>Basically, you need to divide up your system, to know that "THIS PART >>WORKS", and keep sectioning off the problem into a smaller and smaller >>space until you have it cornered. >> >>I learned this art in analog electronics, how to divide up the system >>and isolate the problem. The approach works just as well with >>software, and with microcontrollers it's not all that unusual to have >>problems that are both in hardware and in software. >> >>"drive a stake in the gound" with some part of your code that outputs >>something you can see, and be absolutely sure that it always works. >>Use that to debug other parts of the system. >> >> >> > >
Message
Re: [AVR-Chat] serial communication
2008-02-05 by Roy E. Burrage
Attachments
- No local attachments were found for this message.