
Department of Computer Science and Electronics
29
The ADC test has been done with some voltage divisor as shown in figure 4-12.
For instance, we can test the code writing in the Hyper Terminal panel the
character ’
’; this ASCII character correspond to the 0x81 hexadecimal value, or the
10000001 binary one. Thus, taking the imposed frame protocol into consideration, we
have that the microcontroller with address ‘0x01’ must do the calibration. Then, 2
minutes (calibration time) later, the PC may send the ASCII character ‘q’ corresponding
to the 01110001 binary value therefore, now, the Atmega16 has to reply to the PC
sending the sensors’ states.
Assume that the PC receives a ‘C’ character, which has a 0x43 hex value
corresponding to the ASCII table. In this case, the sensors 0, 1 and 6 are above a white
line in contrast to the rest of the sensors which lie above the field.
4.2. Model/method
As the knowledge on the Atmega16 as well as the software used was null and
never used before, much time has been spent gathering information and looking into
what is done and how can be done.
The next step is to generate the schematic and the layout of the board using
Eagle software. As this project’s intention was to improve the previous one, the need to
calculate automatically the sensors’ threshold urges us to use a microcontroller. The
justification of using the Atmega16 from Atmel, the RS485 network and all the
hardware aspects and specifications, is something beyond the purpose of this thesis; all
the aforementioned data have been selected by the IDE department.
Once the first draft of the code was finished in WinAVR using C language, the
code was compiled and built. AVR Studio software is used to make the code simulation.
This software is now fully compatible with the latest version of Win AVR. The former
64K limit on flash size when using Win AVR/GCC compiler has been fixed. It requires
Figure 4-12. STK500 testing the code
Commenti su questo manuale