NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Project Help and Ideas » Baseline
March 26, 2011 by Noter |
Many of the projects I have in mind rely on a common set of features - timekeeping, temperature measurement, temporary storage, local display, and host/PC communication. Finally after much trial and error and many late night hours, I feel I am finally nearing a working baseline that I can carry forward to these projects. I still have problems though. One is that my clock doesn't keep accurate time. As a matter of fact, it's terrible and now I understand why some folks have used an external real time clock, the nerdkit is a bad timekeeper. I'm going to try a 32khz clock crystal for the async timer though before I give up and add an external clock chip. I think it will work ok but I'll have to switch to the internal 8mhz clock for the mcu since the clock crystal will use the pins I currently have the mcu crystal on. At first I struggled to drive a 7-seg display on the same chip as I have temp measurement and other things going on. I used shift registers and such to minimize the number of pins needed to drive the display but in the end it wasn't as roubust as I had hoped. As I layered functions onto the mcu, the display wasn't as smooth in it's scanning as when it had the whole mcu resource. After a while I abandoned this approach and went the I2C master/slave direction which is working very well. I can even drive two or more displays quite easily (time and temp displayed below). I2C saved me on this one and an extra ATmega to drive the display is about 1/2 the price of a special 7seg driver chip. I'm currently using a LM335 temp sensor and it seems to be roughly equivalent to the LM35 that came with the nerdkit. I have to read it 1000 times and average the value to maintain a constant temperature display. I guess that's ok but I think I'll try a Dallas 18B20 to see if it gives greater stability. Also I like the ability to put multiple 18B20's on a single pair of wires as one of my projects is to monitor ground temp every 6 inches to a depth of 6 feet. With the serial eeprom, I have plenty of room to store timestamped readings until the data can be uploaded to the host so I think I can pretty much check the local storage item as complete. Communicating with the host PC is another area that turned into more work than I originally anticipated. I ended up writing a C program on the PC that will accept requests from the avr or alternatively send commands to the avr. At the moment, the only request accepted from the avr is to get the system time from the PC and likewise the only command sent by the PC is to set the time on the avr. I plan on this being a wireless interface at some point so I also implemented simple CRC's for validation. Adding requests and commands will be easier going forward since all the framework is in place. Well, I just wanted to share my baseline project. As always, comments, suggestions, and questions are welcome. |
---|---|
March 27, 2011 by Ralphxyz |
Noter great post, it is good to have a baseline like this. I have been meaning to do one for my Weather Station project. I think it gives a good reference especially for people searching the forum as they are getting started on a idea. Thanks, Ralph |
Please log in to post a reply.
Did you know that our kits have shipped to hobbyists in 40 countries? Learn more...
|