
ThinkLABS
© TRI Technosolutions Pvt Ltd Page
114
of
129
http://thinklabs.in
What you can do with the uNiBoard
This section describes the purpose of every sample Code given in the CD’s uNiBoard Contents directory
which contains the sample codes for RTOS based and Non-RTOS.
NOTE:
The
sample code given contains the Makefile. You need to rename the Makefile_LINUX to Makefile
for Linux OS and similarly Makefile_WINDOWS to Makefile for Windows OS while using the code.
In
Non-RTOS based sample codes
we will describe in short what the code is meant for and what sort of
output it will demonstrate:
1.
PORTS
The LEDS are connected to one of the general purpose port (PORTC) available of the ATmega128. These
LEDs are connected using the FRC cable. The open FRC connectors are given on the uNiBoard so that
their status can be monitored by interfacing them to LEDs using the FRC cable.
2.
Timer0 using Interrupt
The Software clock is implemented using hardware timer, Timer0 in Normal mode such that it generated
and Interrupt after every 1ms. The Board’s Crystal is 16MHZ and PRESCALAR is set to 1024 therefore
16MHZ/1024 = 0.000064 sec (resolution of timer). So for timer to overflow for every 1ms we need to
load the count ((256 – 15) =241) as 0.000064 * 15 = 0.96 msec ~ 1msec. The clock is displayed on LCD
and UART.
3.
Switches
The Switches on the uNiBoard are connected to general purpose port pins of the controller. So you can
use this switches for reading the inputs from the user. The SW1 is connected to PORTDS’s PIN7 and SW2
is connected to PORTD’s PIN6 of the controller.
4.
EEPROM
The ATmega128 has an on-chip EEPROM (4KB) so that you can use it to store the non-volatile data. The
code contains the some library functions so that you can store the contents in a particular pattern or
same data at locations by specifying start address and end address. The output is debugged on serial
window. EESAVE fuse bit has to be enabled or else on every programming cycle the EEPROM will also be
erased along with flash.
5.
Joystick and VT library
The Joystick (analog joystick of PS2 fame) is used as a mouse on the serial window in this sample
example. The Joystick X axis is connected to the on-chip ADC channel 1 and Y axis to channel 2. The ADC
is configured such that it gives an interrupt after the conversion is over. Since only one ADC channel
conversion is done at a time so we need to reconfigure it for other channel. The ADC conversion value is
stored in ADC’s Data register.
Summary of Contents for UNIBOARD V1.1
Page 43: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 43 of 129 http thinklabs in ...
Page 51: ...ThinkLABS TRI Technosolutions Pvt Ltd STEP 5 Write your code Page 51 of 129 http thinklabs in ...
Page 66: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 66 of 129 http thinklabs in ...
Page 74: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 74 of 129 http thinklabs in STEP 10 press enter ...
Page 76: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 76 of 129 http thinklabs in ...
Page 90: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 90 of 129 http thinklabs in ...
Page 91: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 91 of 129 http thinklabs in ...
Page 92: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 92 of 129 http thinklabs in ...
Page 93: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 93 of 129 http thinklabs in ...
Page 94: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 94 of 129 http thinklabs in ...
Page 95: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 95 of 129 http thinklabs in ...
Page 96: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 96 of 129 http thinklabs in ...
Page 98: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 98 of 129 http thinklabs in ...
Page 99: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 99 of 129 http thinklabs in ...
Page 100: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 100 of 129 http thinklabs in ...
Page 101: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 101 of 129 http thinklabs in ...
Page 103: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 103 of 129 http thinklabs in ...
Page 104: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 104 of 129 http thinklabs in ...
Page 105: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 105 of 129 http thinklabs in ...
Page 106: ...ThinkLABS TRI Technosolutions Pvt Ltd Page 106 of 129 http thinklabs in ...