General help and suggestions. ============================= Choice of microcontroller There are basically 3 choices which we have available in a Dual In Line (DIL) package. (There are lots more available in surface mount packages, but they require Printed Circuit Boards rather than the prototyping boards we have). All 3 devices have a built in temerature sensor, and all three are available in a 'V' version with a lower maximum clock speed but the ability to work at supply voltages down to 1.8V instead of 2.7V All 3 devices have much the same functionality available. Data sheets for each are in the docs folder. ATMEGA168 - the one you have been using. 1K of ram, 1 USART The makefile settings for the MCU (line2 of the Makefile) and the avrdude programming are: MCU=atmega168 avrdude -p m168p ATTINY45 - a physically small, 8 pin device, with much the same functionality as the ATMEGA168, but usually the pin count . Only 256 bytes of ram on this device. You might want to use this one where space is at a premium, or where you are using it as a sensor. When using this device it may be necessary to move it to a programmer rather than program it in place. The makefile settings for the MCU (line2 of the Makefile) and the avrdude programming are: MCU=attiny45 avrdude -p t45 ATMEGA644 - 2 USARTs, 4K of RAM, physically large (50 mm long x 18 mm wide). GPS projects may need to use 2 USARTS, Data logging projects which write large amounts of data to MMC flash memory will need the RAM capacity. The makefile settings for the MCU (line2 of the Makefile) and the avrdude programming are: MCU=atmega644p avrdude -F -p m644p Choice of speed If the project will eventually be battery powered, choose a frequency for the microcontroller within the range suitable for the battery voltage. You can always test on the bench using 5V, but changing the operating speed part way through the project is likely to cause problems. In general you should choose top operate the CPU as fast as possible, unless you are really trying to minimise the current drawn. It uses the same power to finish the processing in half the time and go into sleep mode, as to run at half the CPU speed. Storage If you can process your data on the microcontroller, do that. If you need to store up to 2 Mbytes, you can add flash memory to the SPI bus, but will need to write a 256 bytes page at a time. If you need to store up to 512 Mbytes, then you can use an external MMC card, but will need to use a microcontroller with at least 2K RAM, plus you need to provide a function to provide a timestamp for your files (you can either add a Real Time Clock (RTC) or provide a dummy function to write a plausible timestamp. Timestamping If your project needs to store timestamps, there is a Real Time Clock (RTC) chip available (the DS1302) with software/library support. Libraries There is software support in the form of example implementations or libraries for the following devices: DS1302 Real Time Clock M25P16 SPI Flash memory requires SPI support MMC memory card and FAT 16 filesystem Requires a real time clock (or dummy functions), and SPI support SCA3000-E01 3 axis accelerometer requires SPI support Serial You have used serial communications using the RS232 protocol, using the serial_to_USB converters. If you need to use the COM1 ports on the PC instead, then you need to know that they are device /dev/ttyS0 in Linux. They are there permanently - they do not appear and disappear on plug in/out like USB devices. You will find on first use that you don't have access to /dev/ttyS0. To fix this type sudo chown /dev/ttyS0 replacing with your crsid. You will be asked for your login password - this is the Operating system's way of getting confimation that you want to run a priveleged command (in this case chown) If you are using the level converter PCB, then, on ce connected to the PC you can look at JP3 and JP4 pin3 to see the incoming signal from the PC. Typing characters into minicom with the port set to /dev/ttyS0 should be visible with an oscilloscope. Soldering a row of 5 pins in to JP3/4 and connecting 2->3 will form a loopback (echo) connection. 6 pin programming header The Tuxgraphics programmers you have used so far have a 5 pin connector. On some of the Printed Circuit boards, you may see a 6 way connector, whose pin connections are as follows: GND Reset (+5V) rarely used or connected SCK MISO MOSI I will provide adaptors where necessary Devices We buy most of our devices from Farnell (onecall.farnell.com) or RS components (rswww.com) If the part or the bag it is in has a 6 or 7 digit number, it is very likely to be either the Farnell or RS part number and you can use the website to look up data for the part. Development During the planning stage, work out a series of steps to get to the eventual goal, and how you will test each stage. Take notes as you go, which should help you when writing the report at the end of the project. Work incrementally, testing as you go, or you run the risk of getting stuck at a complex part of the project, and after considerable time discovering that the fault was in something simple from an earlier stage which is not working as expected. Even if the project will eventually be battery powered and mobile, do as much development and testing as possible in the lab environment, and only go mobile when you can do no more in the lab. You should consider using several computers to speed your development - develop, read code and program your device from one, and have minicom or other test programs ready to go on another. Remember that you can be logged in to multiple computers, and that you can have multiple terminal windows open on each. When developing, as you get to a stage where something is working, add a brief comment to the file, and store a copy. That way you can go back to a working version later.