Do you have a question about the UNIBOARD V1.1 and is the answer not in the manual?
Questions and answers
Summary of Contents for Thinklabs UNIBOARD V1.1
Page 1
4/7/2009 1.1 U LABS OARD V OARD V UIDE HINK Licensed by: Open platform for Embedded and Real Time Systems Programming Open platform for Embedded and Real Time Systems Programming Open platform for Embedded and Real Time Systems Programming TRI Technosolutions Pvt. Ltd. TRI Technosolutions Pvt.
ThinkLABS Table of Contents Introduction ................................ 5 Package Contents ..............................6 Testing the Board ..............................7 Testing the Board on Windows OS ..........................7 Testing the Board on Linux OS ............................ 11 What you need for programming the Board ......................12 Hardware requirements ..............................
Page 3
ThinkLABS Software Installations ............................22 Software Installations for Linux OS ..........................22 Text Editor (Gedit Editor) ............................22 Installing Gedit Editor: ............................22 Gedit Editor Plug-in (Embedded Terminal): ......................24 Compiler (avr-gcc) ..............................29 avr-libc (Standard C library for Atmel AVR development) : ..................31 avrdude (software for programming Atmel AVR microcontrollers): ..............
Page 4
What you can do with the uNiBoard ......................... 114 Add-ons ................................118 SD/MMC card Interface ............................118 Ethernet Interface ..............................118 uNiBoard v1.1 Schematic ..........................119 Controller section: ATmega128 pin connections ...................... 119 Buzzer section ................................120 Joystick and connectors section ..........................120 LCD section ................................
You don’t need to pay a license fee to the ThinkLABS team or even ask permission. However, if you republish the reference design, you have to credit the original group. And if you tweak or change the board, your new design must use the same or a similar Creative Commons license to ensure that new versions of the board will be equally free and open.
ThinkLABS Package Contents The uNiBoard development platform with the peripherals listed below uNiBoard development board – 1 unit • 16x2 LCD – 1 unit • Serial cable (DB9) – 1 unit • USB cable – 1 unit • FRC connector cables – 2 units •...
ThinkLABS Testing the Board This section lists the procedure to test the board. To enable you to quickly test the Board, it comes with a test program loaded. So, make sure you first test the board before any programming. If you have programmed the controller thereby erasing the test program from the flash or in case you find...
Page 10
ThinkLABS STEP 12: Turn ON the Board. STEP 13: The test program that we have loaded demonstrates SNAKE game on any serial terminal which is VT102 compatible. If everything is correctly installed you should be able to see a game of SNAKE (modified) as well as play using the Joystick.
ThinkLABS Testing the Board on Linux OS Follow the steps to check whether or not the uNiBoard is working properly on Linux OS STEP 1: Step 1 to Step 3 is same as given in the Windows OS procedure. STEP 2: Turn ON the Board. If you are wondering how to install the USB drivers, you don’t need to do that at all since Linux kernel has those drivers inbuilt.
ThinkLABS What you need for programming the Board Hardware requirements uNiBoard version 1.1 along with USB cable • Serial cable (optional) • FRC Cable (optional) • Software requirements Text Editor (Gedit on Linux/ Programmers Notepad on Windows) • Tool chain (avr-gcc, avr-binutils, avrdude): Installation procedure is explained in the upcoming •...
ThinkLABS Features Board Features ATmega128 controller with external crystal of 16MHZ • usbasp: ATmega8 based USB programmer for ATmega128 (open source firmware running on • hardware licensed under GNU GPLv2 from http://www.fischl.de/usbasp) I2C communication lines • SPI communication lines •...
ThinkLABS Controller Features The features of Atmega128 are as follows: Advanced RISC Architecture • 128K Bytes of In-System Self-programmable Flash program memory • 4K Bytes EEPROM • 4K Bytes Internal SRAM • JTAG (IEEE std. 1149.1 Compliant) Interface • Two 8-bit Timer/Counters with Separate pre-scaler and Compare Modes •...
ThinkLABS Setting up the Board configuration Board Description Atmega128 controller The ATmega128 is a low-power 8-bit microcontroller based on the AVR enhanced RISC architecture. The Atmel ATmega128 is a powerful microcontroller that provides a highly flexible and cost effective solution to many embedded control applications.
ThinkLABS External power The external power connector in the above figure can also be used for connecting rechargeable batteries and making the board operate on battery power in case of robotic or other such mobile applications. Test LEDs Test LED's are pulled-up so to glow the LEDs we need to make the particular port pin Low. You can connect the General Purpose PORT to test LED Port using FRC Cable.
ThinkLABS USB Power (Pressed) / External power (Depressed) Refer to the uNiBoard figure where the components have been labeled to understand where these switches are physically placed on the board. While you have connected the uNiBoard cable for programming purposes or for powering the board this switch should be in the pressed position.
ThinkLABS The PORTC and PORTF (ADC) are open ports and can be connected to test LEDs through FRC cable. These can be accessed using 10-pin the FRC connector. The pin diagram of Atmega128 is given below along with the manner in which we have utilized the port pins...
Page 20
ThinkLABS There are two jumpers on the board one for programming or SPI jumper and other one for LDR or External ADC selection. As shown in the figure below: 4 SPI Lines Joystick/External USB Power Programming Program Enable sensor Selection...
Page 21
ThinkLABS Position of jumper while using LDR sensor While connecting external sensors at the open interface of PORTF, this jumper position should be changed to the alternate position as shown below: Position of jumper using external analog sensors Programming jumper: The programming jumper has to be retained in the position shown below under all cases except when using the SPI communication lines.
ThinkLABS Software Installation Software Installations Software Installations for Linux OS s for Linux OS The procedure that we are discussing for U The procedure that we are discussing for Ubuntu Linux involves downloading packages through the synaptic Linux involves downloading packages through the synaptic manager.
ThinkLABS STEP 4: Press ALT + F2 and type gedit and press enter to open the Gedit application Press ALT + F2 and type gedit and press enter to open the Gedit application Press ALT + F2 and type gedit and press enter to open the Gedit application...
Page 26
ThinkLABS STEP 4: Press ALT + F2 and type gedit and press enter to open the Gedit application Press ALT + F2 and type gedit and press enter to open the Gedit application Press ALT + F2 and type gedit and press enter to open the Gedit application STEP 5: The Gedit application will open The Gedit application will open.
Page 27
ThinkLABS STEP 6: Then in gedit open Edit menu > preferences and goto plugins tab Then in gedit open Edit menu > preferences and goto plugins tab STEP 7: Select Embedded Terminal and press close button Select Embedded Terminal and press close button.
ThinkLABS STEP 2: Enter root password STEP 3: It will show a list of all dependencies install as shown below It will show a list of all dependencies install as shown below Serial port terminal (Gtkterm) Gtkterm) The Gtkterm is analogous to Windows HyperTerminal which is useful for serial commutations between PC...
ThinkLABS Gtkterm Configurations for setting the Gtkterm Configurations for setting the Baud rate, Parity, Stop bits Stop bits STEP 1: Press ALT + F2 and type gtkterm and press enter to open the Gtkterm application Press ALT + F2 and type gtkterm and press enter to open the Gtkterm application...
Page 38
ThinkLABS STEP 3: Select the Port: /dev/ttyS0 if you have connected to the serial Select the Port: /dev/ttyS0 if you have connected to the serial communication communication port, if not change the Port. STEP 4: Select the Speed to the Baud rate Baud rate as per in your code, you have configured as per in your code, you have configured for the UART.
ThinkLABS Software Installations for Windows OS oftware Installations for Windows OS WinAVR (Includes avr-gcc, gcc, avr-binutils, avrdude) Copy the software packages from the uNiBoard contents Copy the software packages from the uNiBoard contents on CD or download latest version of WinAVR from...
ThinkLABS Programming the Board Programming the Board NOTE: Refer to the above section sections to check that you are having all the required to check that you are having all the required software tools. Getting Started on Linux Linux For programming the Board you must first have the hex file to be loaded into the flash section of the...
Page 52
ThinkLABS STEP 6: Save the file STEP 7: Edit the Makefile in this file change TARGET = Xfilename (with no extensions and no quotes (“)). If you put any extensions it won’t work. NOTE: Xfilename indicates any filename that a user will use.
Page 53
ThinkLABS STEP 8: Save the Makefile. STEP 9: On Linux based systems, you can use one of the makefiles of the sample codes marked as On Linux based systems, you can use one of the makefiles of the sample codes marked as On Linux based systems, you can use one of the makefiles of the sample codes marked as Makefile_LINUX by renaming it to Makefile, failing which you will get an error saying “No rule to make...
Page 56
ThinkLABS 1.1. Changing the Fuse settings Changing the Fuse settings NOTE: The fuse setting must be changed only if The fuse setting must be changed only if required. The ATmega128 has three fuse bytes The ATmega128 has three fuse bytes referred as High Fuse Byte, Low Fuse Byte and Extended Fuse referred as High Fuse Byte, Low Fuse Byte and Extended Fuse Byte.
Page 57
ThinkLABS M103C Atmega103 compatibility mode 0 (programmed) WDTON Watchdog timer is always ON 1 (unprogrammed) The following Table represents High Fuse Byte: High Fuse Byte BIT No. Description Default Value OCDEN Enable OCD 1 (unprogrammed, OCD disabled) Enable JTAG 0 (programmed,...
Page 58
ThinkLABS CKSEL1 Select Clock source 0 (programmed) CKSEL0 Select Clock source 1 (unprogrammed) The Make utility allows programming the fuse bits. The following The Make utility allows programming the fuse bits. The following procedure will procedure will help you configuring the fuse bits.
Page 59
ThinkLABS STEP 2: Edit the Makefile as shown in the in the above picture as per the fuse setting (HFUSE, LFUSE and EFUSE are the (HFUSE, LFUSE and EFUSE are the labels to be edited) that is required. STEP 3: On Embedded terminal type make fuses (This will read the fuse setting currently present on the board)
Page 60
ThinkLABS STEP 4: Again on the embedded terminal type make readfuses to verify that fuse bit have been saved. terminal type make readfuses to verify that fuse bit have been saved. terminal type make readfuses to verify that fuse bit have been saved.
ThinkLABS Getting Started on Windows Getting Started on Windows The sample programs have been given been given in the CD folder named “\UNIBOARD CONTENTS\UNIBOARD_SAMPLE_CODES UNIBOARD_SAMPLE_CODES\NON_RTOS\” and “\UNIBOARD CONTENTS\UNIBOARD_SAMPLE_CODES UNIBOARD_SAMPLE_CODES\ RTOS” Or you can download it from our website at link oad it from our website at link http://thinklabs.in/download/...
Page 68
ThinkLABS STEP 3: You must have the Makefile in your project directory. In case of windows you would find a file named Makefile_WINDOWS, which you can rename as Makefile. Make sure that you have only a single Makefile in your working directory.
ThinkLABS Getting Started with RTOS (uC/OS-II) on Windows OS uC/OS-II Hardware and Software Architecture Before starting of with the uC/OS-II programming you need to know its file structure i.e. how the uC/OS-II source code and its ports are structured. The diagram below gives an idea of the way in which these files have been maintained.
ThinkLABS Every RTOS project/source code consists of (as shown in the above figure): Portable kernel code: This is generally a code written in ANSI C which can be ported to any platform • fulfilling certain requirements like memory footprint, computational power, number of registers etc.
Page 81
ThinkLABS STEP 4: Go to the current program program directory from Gedit Embedded terminal using cd using cd command or right click on Bottom terminal and select change directory (refer to the sub-section getting started on Linux section getting started on Linux).
ThinkLABS Code, Compile and program the RTOS (uC/OS-II) programs on Windows OS NOTE: You Should have the required software tools i.e. text editor, compiler, programmer, serial terminal and required drivers for programmer as shown in the sub-section Software Installations for Windows OS.
Page 102
ThinkLABS NOTE: Check the code at line 108 to 112 in function named as void MyTask(void *pdata). This code is initializing the timer0 i.e. required by scheduler for correct time delays and this macro named as CPU_CLOCK_HZ and OS_TICKS_PER_SEC are defined in the file os_cfg.h as shown in next step.
Page 107
ThinkLABS NOTE 1: Here in this file os_cfg.h check at the line 27 for the macro CPU_CLOCK_HZ which should be assigned as 16MHZ i.e. the CPU frequency and at line 67 the macro OS_TICKS_PER_SEC which should be assigned as 61.
ThinkLABS Troubleshooting Make utility Make sure that you are in current project working directory. • Make sure that you have Makefile in your current working directory. If not then rename the • Makefile_WINDOWS or Makefile_LINUX to Makefile from uNiBoard Contents.
ThinkLABS Make sure that you are using correct ADC channel. • Make sure that LDR Jumper is placed on the Board and in the correct position. • External Interrupts Make sure that you have enabled pull-ups in your code. •...
ThinkLABS 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.
Page 115
ThinkLABS The VT 100 is video terminal made by DEC. It became a de facto standard used by terminal emulators. Digital’s first ANSI-compliant terminal, introduced in August 1978. The VT100 was more of architecture than a simple terminal. There are two display formats: 80 columns by 24 lines and 132 columns by 14 lines.
Page 116
ThinkLABS MASTER SLAVE MISO MISO MOSI MOSI 9. I2C (RTC) The DS1307 is the RTC (Real Time Clock) chip interfaced on the I2C lines of the controller. The API’s can be used for reading the date and time from RTC. Before reading you need to call this API Update_RTC_variables() which actually updates local variables that data and time API’s returns.
Page 117
ThinkLABS The score is printed by this task on LCD whenever snake eats food. Also every time food is generated LEDs would blink. Every time the SNAKE eats food the buzzer will give a beep sound. 3. Semaphores This is a sample code which displays the shared resource as a global variable which is shared among the various tasks.
ThinkLABS Add-ons What we have discussed till now are some completely standalone activities. We assume that you wont just What we have discussed till now are some completely standalone activities. We assume that you wont just What we have discussed till now are some completely standalone activities. We assume that you wont just limit yourselves to these activities and explo limit yourselves to these activities and explore the board’s power further using accessories like SD/MMC...
You don’t need to pay a license fee to the a license fee to the ThinkLABS team or even ask permission. However, if you or even ask permission. However, if you republish the reference design, you have to cre republish the reference design, you have to credit the original group.
ThinkLABS Appendix A – References Websites: www.atmel.com www.avrfreaks.net www.fishl.de/usbasp/ www.maxim-ic.com http://en.wikibooks.org/wiki/Embedded_Systems/Atmel_AVR Books: 1. MicroC/OS-II by JEAN J. LABROSSE 2. Programming & Customizing The AVR Microcontroller By Dhananjay V. Gadre 3. Embedded C Programming and the Atmel AVR By Barnett and Cox 4.
Need help?
Do you have a question about the UNIBOARD V1.1 and is the answer not in the manual?
Questions and answers