AVR Ethernet User Guide:

Mikrokontroller med Ethernet-kommunikasjon AVR Ethernet User Guide: Vedlegg E – User Guide Features        ATxmegaA3 microcontroller JTAG o...
28 downloads 2 Views 516KB Size
Mikrokontroller med Ethernet-kommunikasjon

AVR Ethernet User Guide: Vedlegg E – User Guide

Features   

   

ATxmegaA3 microcontroller JTAG o Programmer for Atmel AVR XMEGA FT232R o USB gateway o Optional programmer for Atmel AVR XMEGA ENC28J60 o Ethernet gateway Analog Input (from ADC) o Sensor Input Analog Output (from DAC) Digital IO o UART communication through USB gateway o SPI communication through Ethernet gateway o 4 micro switch buttons o 4 LEDs o 8 spare analog pins o 16 spare digital pins

Contents      

AVR Ethernet K1016 development board Accessories for K1016: o (2 pcs) 10-wire cables for I/O ports o (5 pcs) 2.54mm Jumper connector USB A to Mini B Cable Cat 5e Ethernet Cable CD-ROM with datasheets and software Extra: JTAG programmer

Introduction The AVR Ethernet K1016 development board is a hardware platform to evaluate the ATxmegaA3, and develop software for microcontroller communication over Ethernet.

K1016 – Joakim Myrland

40

Mikrokontroller med Ethernet-kommunikasjon

Initial configuration In order for the AVR Ethernet board to work, the FT232R chip must be configured from a computer using the FT_Prog utility from FTDI. A default configuration file is included in the CD-ROM. http://www.ftdichip.com/Resources/Utilities.htm#FT_Prog

Related Items FLIP (Flexible In-System Programmer) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886 AVR Studio 4 (Atmel’s free IDE) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 JTAGICE mkII (On-chip programming and debugging tool) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3353 AVR ONE! (On-chip programming and debugging tool) http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4279

Hardware Description AVR Ethernet K1016 component overview:

Precompiled firmware The AVR Ethernet board comes with a default .HEX file for the ATxmegaA3. The precompiled firmware for the XMEGA has a TCP/IP stack with a basic HTTP server.

K1016 – Joakim Myrland

41

Mikrokontroller med Ethernet-kommunikasjon

Power supply The kit is powered from USB which leaves two options to power it: Either connects the kit to a PC through an USB cable, or to a 5V USB power supply (AC/DC adapter). An alternative (but not recommended) is using the PORTC VCC and GND pin to supply the board from an external power supply. Electrical characteristics: Power Source USB Bus Powered External Power Supply Power Mode USB Suspend Standy* Active*

Minimum Voltage 3.8V 3.1V Minimum 5mA 160mA

Maximum Voltage 5.5V 3.6V Typical 70μA -

Maximum 100μA 30mA 250mA

* Not including external hardware, and using standard configuration.

Programming the XMEGA through the USB gateway Programming of the ATxmegaA3 through the USB is not supported in the preliminary release.

Communication through UART-to-USB gateway The XMEGA’s UARTD1 is connected to a UART interface on the FT232R. The UART is configurable, but the standard communication setting is 9600 baud, using one start bit, eight data bits, one stop bit and no parity. When the FT232R device is enumerated (connected to a PC) the data transmitted from the XMEGA is passed on to a (virtual) COM port. This means that it is possible to use a terminal program to receive the transmitted data on a PC. Similarly data transmitted from the PC COM port is passed on to the XMEGA UART through the gateway. If the USB device is not enumerated, e.g. powering the kit from an USB supply adapter, the UART will not work.

Communicating through SPI-to-Ethernet gateway The XMEGA’s SPIE is connected to an Ethernet controller, ENC28J60. For Ethernet communication, the XMEGA needs to be programmed with an Ethernet driver, and Ethernet stack. A premade TCP/IP stack is provided with the development board.

K1016 – Joakim Myrland

42

Mikrokontroller med Ethernet-kommunikasjon

Connectors The board has five 10-pin 100mill headers, and one 3-pin 100mill header. The first is used for programming the ATxmegaA3, the second is for reset jumper configuration, and the remaining three are to access spare analog and digital pins on the XMEGA (expansion headers). The 3-pin header is used as an external clock input jumper for the XMEGA. JTAG/PDI Programming The XMEGA can be programmed and debugged by connecting an external programming/debugging tool to the “JTAG & PDI XMEGA” pin header. The pin header is having a standard JTAG programmer pinout (refer to online help in AVR Studio®), and tools like the JTAGICE mkII or the AVR ONE! can thus be connected directly to the header. If it is desired to use PDI programming/debugging an adapter must be used.

XMEGA programming and debugging interface – JTAG and PDI:

IO expansion headers The XMEGA’s analog PORTA and PORTB is available on the “XMEGA PORT A” and “XMEGA PORT B” pin headers. This allows the user to connect external signals to the ADC, DAC and Analog Comparators on PORTA and PORTB. The XMEGA’s digital PORTC is available on the “XMEGA PORT C” pin header. This port features general purpose IO and various communication modules (USART, SPI and TWI). Note that the communication modules on PORTC can be interconnected to test out various functions and features: The USART can loop back communication with a jumper, or communicate between the two UARTs on the PORT. The native SPI and the USART in SPI master mode can be connected, and the TWI module can be enabled in both master and slave mode at the same time to get loop back behavior (pull-up resistors required).

K1016 – Joakim Myrland

43

Mikrokontroller med Ethernet-kommunikasjon

Jumper configurations

Power configuration jumpers:  

For USB bus powered mode, connect pin 1 and pin 2 For external power supply, connect pin 2 and pin 4

IC enable jumpers:   

Enable XMEGA with connecting pin 9 and pin 10 Enable FT232R with connecting pin 6 and pin 8 Enable ENC28J60 with connecting pin 3 and pin 5

To reset an IC, short pin 5, 8 or 9 with pin 7. The clock jumper pins, allows the XMEGA to get an external clock from either ECN28J60 or FT232R.

Miscellaneous IO Micro switch buttons Four micro switch buttons are connected to the XMEGA’s PORTF pin 0 to 3. Internal pull-ups should be enabled to detect when the buttons are pushed as they short the respective line to GND. LEDs Four LEDs are connected to the XMEGA’s PORTF pin 4 to 7. The LEDs are active low – and thus lights up when the respective lines are drawn low by the XMEGA.

Available code examples and drivers The AVR Ethernet board comes with default software that can be modified and used for further development. A Getting-Started training for the XMEGA can be downloaded from the Atmel web site. This training is a general introduction to XMEGA peripherals. There is also further information and drivers for XMEGA available at the Atmel web site.

K1016 – Joakim Myrland

44