The Tracked Robot Project 2010Page 5Assignment of the Processor Pins and PortsWe are using an Atmel Mega 88P as the processor for this
version of the tracked robot. The Atmel AVR series of chips are easy to program
and are not very expensive. Most of the pins can not only be used as simple
input or output, but can also be assigned special tasks by turning on functions
built into the chip. Some pins or ports can be used for more than one function
while some are dedicated when you select to use them for a specific function.
We are using an SPI port to program the chip, this means that certain signals are triggered to allow new code to be sent to the chip. To do this we need to dedicate the RESET pin so that when it is held LOW the chip will go into reset mode and either start the program over, or if the proper signals are placed on the programming pins, the chip can be reprogrammed. For this reason, Pin-1 cannot be used for anything other than programming and resetting the chip. We must now evaluate the remaining pins and decide which will need to be used for specific tasks and which can be changes with ease depending on our needs.
The remaining programming pins, 17, 18, and 19 could also be used for other
purposes when the chip is not being programmed... but we need to be careful. If
a motor controller were connected here, it could start up with unpredictable
results every time the chip is programmed. But, if we connect an LCD to these
pins, the worst that would happen is that the display would have garbage on it
during programming... but nothing would be harmed by that. Since it won't hurt
anything, we will dedicate these pins to three of the four data lines of the
LCD.
I prefer to program in BASIC since I have used the language since 1978 or so... and the version that I am using called BASCOM is very powerful, supports a large number of chips, and the demo version is FREE and will program up to 4K of memory. For this robot... I doubt that we will exceed that memory restriction. We are using the AT Mega 88P, but we could have used the Mega 44P which has 4K of memory and have programmed 100% of the memory with the free version. You can download the software here: http://www.mcselec.com/ If you get the registered version, you can program beyond the 4K barrier... and if you use the Mega 328P chip... you would have FOUR TIMES the memory of the Mega 88P chip we are using in this version. (All the above chips are pin-for-pin compatable.) |