Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

XMEGA tutorial: LCD display (05)

|

Blinking diodes mentioned in the previous part of our tutorial is cool, however not very communicative. That's why before moving on to discussing particular peripherals of XMEGA microcontrollers, we will learn how to operate 16x2 LCD text display with HD44780 driver.

This paragraph’s aim is to acquaint the reader with basic knowledge on how to control the display, although we are not going to create it’s function library from scratch. Instead, we will use a template provided by Radosław Kwiecień and available on his website radzio.dxp.pl. I have adjusted his function library to work with XMEGA microcontrollers, so that we can use the display in following parts of the preparation course. We will see how new libraries can be added to the Atmel Studio project by the way.

XMEGA tutorial: ports (04)

|

Port is the fundamental peripheral, which enables connection between microcontroller and other devices. In well known and appreciated processors: ATtiny & ATmega each port used to have three registers: PIN, PORT and DDR. However in XMEGA microcontrollers there are 21 registers for each port... but don't worry! Using the XMEGA ports is even easier than in ATmega!

All ports have unique name: PORTA, PORTB, PORTC... and so on until the end of alphabet! Within each port there are several registers and some of the most important are listed below:
  • DIR – this one register decides which of the pins is supposed to be an input or output. Typing 1 will configure the pin as an output and 0 as input. For example, the instruction below sets pins 3 and 6 as outputs, therefore the other pins will be inputs:
    
    PORTA.DIR = PIN3_bm | PIN6_bm;
     
  • OUT - this is the output register. Typing 1 will cause the appearance of high state of appropriate "leg" of port, while 0 means low state.
  • IN – is the input register, used for reading current pin state. Here is the example of conditional statement (branch control structure) which checks if the state on the pin E5 is high:
    
    if(PORTE.IN & PIN5_bm)
     

XMEGA tutorial: new methods of registers configuration (03)


Kurs XMEGA
Ports are the simplest peripheral system of each and every microcontroller. Even though in XMEGA we have 21 registers for each port! The total number of configuration registers can reach a few hundred or even more than a thousand! In this article I will show you how to get over it without going crazy. Although the beginning of this article may seem a bit vague – please don’t become discouraged as further on you will find both plain and practical examples.

XMEGA tutorial: first program (02)

|

You will be introduced to Atmel Studio and you’ll find out how to download programs to X3-DIL64 from Leon Instruments.

Download:

XMEGA tutorial: what you should know (01)

|

Kurs XMEGA
Atmel’s AVR microcontrollers captured the imagination of thousands engineers around the globe. So far, the producer offered us two families: ATtiny and ATmega, which differ in pricing and possibilities, but the programming methodology for both is identical. Introducing the XMEGA, Atmel has done significant changes in the processors peripherals and, furthermore, changed the methods of software development. This tutorial is to let you learn, how to use XMEGA microcontrollers in practical applications and it will point the differences between them and conventional AVRs. We hope this course will encourage you apply XMEGA in your designs and fully take advantage of its innovative solutions.