Getting Started with the T-Board The T-Board modules were designed to speed up your AVR prototyping. This guide will show you just how quickly you can get up and running with the Hello World for microcontrollers a blinking LED. Variants There are three T-Board variants: T-Board 328: a 28-pin version supporting ATmega8/48/88/168/328 microcontrollers T-Board 24/44/84: a 14-pin version supporting ATtiny20/24/44/84/441/841 microcontrollers T-Board 25/45/85: an 8-pin version supporting ATtiny13/25/45/85 microcontrollers The T-Board 328 has two features not supported by the other variants: An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal Module Layout and Function 2014 **T-Board 328 only A. Power Connector: A standard 2.1mm centre-positive jack (DC, max 9V) B. Voltage Selection Jumper: Allows the microcontroller to operate at either 5V or 3.3V C. **FTDI Connector: Connect an FTDI breakout board for Serial communication over USB D. Reset switch E. **Crystal header pins: Gives you the option of connecting an external crystal F. ICSP Connector: Connect an ISP programmer to program the microcontroller G. Power LED What Software Should I Use? The T-Board works with all AVR Integrated Development Environments, including WinAVR, Atmel Studio and the Arduino IDE. We recommend Atmel Studio as it is simple to use, has advanced debugging functionality, and supports the T-Board without any additional configuration. It does however require Microsoft Windows. If you don t already have Atmel Studio installed then you ll need to download and install it. Installation is straightforward, and covered on the Atmel website.
Hello World Blink For the Hello World project you will need: 1. 1 x T-Board 2. 1 x Breadboard 3. 1 x LED 4. 1 x Resistor (matched to the LED) 5. 1 x jumper wire 6. 1 x ISP Programmer Step 1: Setup the Breadboard 1. Place the T-Board on the breadboard 2. Move the Voltage Selection jumper to the 5V position 3. Connect the jumper wire between GND and the negative power rail 4. Connect the resistor between an empty row on the breadboard and a. PB0on the T-Board 328 b. PA5 on the T-Board 24/44/84 c. PB4 on the T-Board 25/45/85 5. Connect the anode of the LED to the resistor and the cathode to the negative power rail Step 2: Write the Program 1. Create a new project in Atmel Studio: a. Click the File menu, then New, then Project b. Choose GCC C Executable Project, give the project a name, choose where to save it and click OK.
c. Choose the correct device: T-Board 328: ATmega328P T-Board 24/44/84: ATtiny 84 T-Board 25/45/85: ATtiny 85 2. Type the following code into Atmel Studio
/* * T_Board_Blink.c * * Created: 24/05/2014 11:54:26 * Author: Andrew Retallack, Crash-Bang Prototyping * */ #define F_CPU 16000000UL //We are running at 16MHz. Used to time the delay #include <avr/io.h> #include <util/delay.h> int main(void) { //Configure the LED port DDRB = (1<<DDB0); //Set Pin PB0 as an output pin } while(1) { PORTB = (1<<PORTB0); _delay_ms(1000); PORTB &= ~(1<<PORTB0); _delay_ms(1000); } //Turn the LED on, by making PB0 high //Delay 1 second //Turn the LED off, by making PB0 low //Delay 1 second If you are not using the T-Board 328 then change the above code to refer to the LED pin: Existing T-Board 24/44/84 T-Board 25/45/85 DDRB DDRA DDRB DDB0 DDA5 DDB4 PORTB PORTA PORTB PORTB0 PORTA5 PORTB4 3. Compile the code a. Set this to a release version (on the toolbar, look for a drop-down box that may say Debug, Release or Configuration Manager. Select Release). b. Press F7 to build the solution c. There should be no errors Step 3: Upload the Program to the T-Board 4. Connect the ISP programmer you ll be using to the T-Board and Computer 5. Select the ISP Programmer that you will be using, by select the Project menu, then properties 6. On the Tool tab, select the debugger/programmer you re using. 7. Upload the program to the T-Board: Click on Debug menu, then Start without Debugging 8. The LED should start blinking.
9. If you like you can now disconnect the T-Board from the ISP programmer, and connect it to a 9V battery to operate in stand-alone mode. Using the FTDI Connector By connecting an FTDI breakout board or cable, you re able to communicate with your computer using the serial protocol. The T-Board was designed to work with Sparkfun s Basic FTDI breakout board, but can be used with any (including the Elektor FT232R USB/Serial Bridge) - just ensure the correct pins are connected. You can also use the FTDI breakout board to program your T-Board, however this requires a bootloader on your microcontroller. This is a great way to program your board if you re using the Arduino IDE. Additional Resources Atmel Studio Documentation: http://www.atmel.no/webdoc/atmelstudio/index.html Atmel Programmer: http://www.atmel.com/tools/avrispmkii.aspx USBTiny Programmer: https://learn.adafruit.com/usbtinyisp or https://www.sparkfun.com/products/9825 Using Atmel Studio with a USBTiny Programmer: http://www.crash-bang.com/getting-startedatmel-studio/ Atmel In-System Debuggers: http://www.atmel.com/microsite/atmel_studio6/debugging_simulation.aspx Sparkfun s FTDI Breakout: https://www.sparkfun.com/products/9716 Arduino IDE: http://arduino.cc/en/main/software Atmel Studio: http://www.atmel.com/tools/atmelstudio.aspx