
Department of Computer Science and Electronics
30
that one uses the latest Win AVR release (after 2007-01-02). However, the either
analogue or UDR register simulation has not yet been supported, and that was not
sufficient to ensure the correct operation of the code.
Urged by the need to communicate and send the sensors’ state, Atmega16 offers
the USART or the SPI serial communication. But normally the SPI bus is used for very
short distance communication with peripherals or other microcontrollers that are located
on the same circuit board. This is different from the UART, which is used for
communication over longer distances, such as between units or between microcontroller
and PC. The SPI was developed to provide relatively high-speed, short distance
communication using a minimum number of microcontroller pins. That is why the
USART was chosen. [6]
4.3. Solution
The schematic, the layout and the code can be found in the appendices. The time
spent in this project was enough to make the program work as expected, thus the
purpose of this thesis has been almost achieved. Nevertheless, much more things could
have been achieved in a longer period of time, as the use of the microcontroller provides
us with certain abilities.
It seems that all things mentioned above are working as they were expected. The
report focuses on one single board, although the author’s strongest aim was to make 3
cards and the PPC work in the same network. Given that a correct performance in the
system consisted of the PC and the simulation kit has been verified by tests, the entire
network is highly likely to work.
5. Results, analysis of results, recommendations, future
work
As the STK500 responds right to the PC orders, it is verified that, at least, the
code is correct.
The code mainly includes a while loop which, depending on what data it
receives from USART, will call the respective function. It is also evident that the non-
interrupts provided by Atmega16, are not used. The reason is that the microcontroller
has no other task to perform; therefore there is nothing wrong in waiting an order. For
this specific application, the interrupts are not potentially useful. However, both ADC
and USART are somewhat slower than the processor; thus, the latter waits for each
analogue conversion or USART data transmission, and this results in a waste of time in
some occasions. The use of interrupt-driven mode, nevertheless, would solve this
problem.
The reason for choosing the single ADC mode is that this was the most suitable
one for this application.
Comentários a estes Manuais