0% found this document useful (0 votes)
11 views8 pages

Microcontroller Bootcamp (4) : User Interfaces

The document describes connecting a small 2-line text LCD display to an Arduino microcontroller using an Elektor shield. It provides code to initialize the display and print text and incrementing numbers. The display uses 4 data lines connected to an ATmega328p microcontroller on the Arduino board. The code samples show how to write text to the first line, clear the screen, and then write to the second line by changing the cursor position.

Uploaded by

Mikko Fagerlund
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Microcontroller Bootcamp (4) : User Interfaces

The document describes connecting a small 2-line text LCD display to an Arduino microcontroller using an Elektor shield. It provides code to initialize the display and print text and incrementing numbers. The display uses 4 data lines connected to an ATmega328p microcontroller on the Arduino board. The code samples show how to write text to the first line, clear the screen, and then write to the second line by changing the cursor position.

Uploaded by

Mikko Fagerlund
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

•Projects

Microcontroller
BootCamp (4)
User interfaces

By Burkhard Kainka Serious microcontroller applications usually have some sort of interface between
(Germany)
humans and the machine. You can do a lot with a just a small display, a few but-
tons, a potentiometer and a couple of LEDs. What’s more, you can hit the ground
running with the Arduino shield developed by Elektor, which is described elsewhere
in this edition.

First let’s see what it takes to drive a display. Arduino board. You can also see the other periph-
Various types are available, including graphic and eral components there: two LEDs, two pushbut-
text displays. Text displays range from tiny with tons and a potentiometer. If you wish, you can
a single line of 8 characters, to large with four build all this yourself on a piece of prototyping
lines of 20 characters. As the saying goes, small board. You don’t even have to use exactly the
is beautiful, and in many cases you don’t have to same type of display module. One with two lines
display a lot of characters. That’s why the new of 16 characters would work just as well. If you
Elektor shield has a small two-line text display like to keep things simple, you can order the new
with eight characters per line. In any case, that’s shield on the web page for this article [1], where
enough room for messages such as “V=3.3V” as usual you can also download a file containing
or “I=8.2mA”. What more do you need on your the code for the programs described here.
electronics bench? The display occupies six pins on port D: D2 to
D7. That’s handy, because it leaves exactly two
LCD connection spare for the serial interface: D0 (RXD) and D1
Figure 1 shows how the display module on the (TXD). Ports B and C remain free for whatever
shield is connected to the ATmega328 on the strikes your fancy. All standard display modules

58 | July & August 2014 | www.elektor-magazine.com


Microcontroller Bootcamp

of this sort can optionally be operated in 8-bit is designed for two lines of 16 characters (16 *
mode, which means that the data is sent to the 2), even with this small display. That’s not a
display over eight lines in parallel. However, 4-bit problem in practice because the program keeps
mode has become customary to reduce the num- on running without an error if you accidentally
ber of port pins used on the microcontroller. In write up to 16 characters in a line. However, when
this mode each data byte is sent to the display you see the truncated output on the display you
in two steps. For example, if you want to write will have to consider how you can shave a few
an upper-case A you have to send the hex value more characters off the message.
&H41 (binary &B01000001, or 65 in decimal nota-
tion), as specified in the ASCII code table. In fact After you initialize the display, you should clear
you first send &B0001 and then &B0100. How- everything with the Cls (Clear Screen) command.
ever, you don’t actually need to know all these Everything written after this lands on the first
details or how to go about initializing the display, line, starting at the left end. Here it is the word
since Bascom does all the hard work for you. If “Elektor” – seven characters, short and sweet.
you simply write Lcd “A” in your program, the If you send another character to the LCD now, it
letter A will appear on the display. will be written to position 8 on the first line, but
Our first example program (Listing 1) shows how what you actually want is to start with the sec-
it all works. First you need a Config instruc- ond line. For this you use the Locate command.
tion to tell the compiler how the display pins Here Locate 2 , 1 causes the next character
are connected to the port pins. Next you have to be written to the leftmost position of the sec-
to initialize the display with the Config Lcd = ond line. The program outputs an incrementing
16 * 2 instruction. You can choose from several number at this position. The count variable N is
formats here. The format 8 * 2 is not supported incremented once per second, so you can use
because the display controller in the LCD module the program to measure time. For example, it’s

Listing 1: Text and number output.


LED1 LED2
'------------------------------------
'UNO_LCD1.BAS Text Output S2 S1
1k

1k

'------------------------------------
$regfile = "m328pdef.dat" +5V
10k
'ATmega328p
$crystal = 16000000 '16 PWMB PWMA

MHz 28 27 26 25 24 23 22 21 20 19 18 17 16 15
$baud = 9600
GND

AVCC
C5
C4
C3
C2
C1
C0

B5
B4
B3
B2
B1
AREF

ATmega328p
Dim N As Word
GND
VCC
RES
D0
D1
D2
D3
D4

D5
D6
D7
B0
X1
X2

1 2 3 4 5 6 7 8 9 10 11 12 13 14
Config Lcdpin = Pin , Db4 = Portd.4 ,
Db5 = Portd.5 , Db6 = Portd.6 , Db7 =
Portd.7 , E = Portd.3 , Rs = Portd.2
16MHz
100n
Config Lcd = 16 * 2

Cls 22p 22p


10k
Lcd "Elektor"
Contrast
'Cursor Off
Do 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Locate 2 , 1
D0
D1
D2
D3
D4
D5
D6
D7
GND

R/W

Figure 1.
RS

E
VEE
VCC

Lcd N Basic diagram: how the


LCD
N = N + 1 LEDs, buttons and display
Waitms 1000 on the Elektor shield are
140064 - 11 connected to the ATmega328
Loop
on the Arduino Uno board.

www.elektor-magazine.com | July & August 2014 | 59


•Projects

taken me 1200 seconds to write these lines since on its own what has to be done, which is very
I started the program. That’s 20 minutes, which convenient for the user. In other languages the
means I’m pretty slow today. programmer has to do more in these situations.
On the display you will see an underscore after
There are two Lcd instructions in this example the number that was output, which represents
program, and it’s important to understand that a cursor. The cursor shows where the next char-
they do two completely different things. The pure acter will be written if and when it comes. This
text output instruction simply copies the charac- may be very helpful when you’re busy typing
ters set in quotation marks by the programmer. something in, but in our case the cursor is irri-
By contrast, the instruction Lcd N converts the tating. Fortunately, we can do something about
numerical value in the variable N into text and this with the Cursor Off command, which is ini-
then sends this text to the display. In this case tially commented out in the code. If you delete
N is an integer, but in other cases it could be a the comment character, recompile the program
real number with decimal places. Bascom decides and download it to the microcontroller, you will

Liquid Crystal Displays


Liquid crystal displays (LCDs) are very popular because There are usually 14 lines, and in some cases two more for
they are easy to read and don’t need much power. They the backlight. The display on the Elektor shield need only 14
can be operated without a backlight, although the backlight lines because the backlight is hardwired.
on the Elektor shield is always on. This still results in much About the individual lines: GND and Vcc are obviously
less power consumption than an LED display with the same ground and +5 V. Vee is connected
number of characters. to a contrast trimpot. With many
LCD modules the optimal setting
The reason LCDs are is approximately 4.5 V between
so energy efficient is Vee and Vcc. It is therefore often
that they do not have sufficient to connect a fixed resistor
to generate light. with a value of 470 Ω to 1 kΩ
Instead, they control between Vee and ground, which
whether ambient light is saves the cost of a trimpot.
transmitted or blocked.
The liquid crystal material, RS is an input that allows the
which is located between display be set to receive either
two sheets of glass, rotates data commands (RS = 1) or
the polarization plane of control commands (RS = 0). Data is necessary
the incident light depending to display text, while control commands are necessary
on the applied voltage. A for initialization and positioning the cursor. R/W switches
polarization film is always located on one of the glass between reading and writing. Reading is actually only
sheets. (Incidentally, if you have a defective LCD module necessary to determine whether the display is ready to
you should sometime pull off this film, because you can use receive the next data. This can also be ensured by a short
it to perform interesting experiments with light [2][3].) The wait time, so the read direction is often not used and R/W is
display element of an LCD module is driven by square-wave tied to ground. E is the Enable input. It is used to indicate to
voltages with no DC component, which are applied across the display controller that valid data is present on the data
the individual segments. There are dedicated CMOS ICs for bus (lines D0 to D7) and should be read in by the controller.
this purpose, but some microcontrollers can also drive LCDs The controller always reads in the current data after a
directly. However, standard LCD modules have special built- falling edge. In 8-bit mode all eight data bits are put on the
in controllers that handle the actual drive tasks. bus and then a falling edge is generated on the E input. In
4-bit mode this process occurs twice, with only the upper
The great-grandfather of all LCD controllers was the four data lines (D4 to D7) being used for data transfer. The
HD44780. Even today, most controllers are HD44780 lower nibble (least significant bits) is sent first, followed by
compatible. This involves several standardized control the upper nibble. The display must be initialized to operate
commands as well as the connections to the display module. in either 4-bit mode or 8-bit mode before it is used.

60 | July & August 2014 | www.elektor-magazine.com


Microcontroller Bootcamp

see that the cursor has vanished. Measuring brightness


This is a good place to remind you how easy it is Now let’s edit the program so that the ADC2
to display more information by using the Bascom channel is displayed instead of ADC0 (see List-
help function. Simply move the cursor (here we ing 3). On the shield board, LED1 is connected to
mean the one on your PC monitor) to the key- this channel through a jumper and a 1 kΩ series
word concerned and press the F1 key, and you’re resistor, since this port pin can also be configured
already a lot wiser. For instance, you can learn as an output. However, in this case we leave it
how to make the cursor blink. in the high-impedance state. Now you can see

A two-channel voltmeter
Happen to need a two-channel voltmeter? List- Listing 2: Displaying voltages.
ing 2 shows one of many possible solutions.
'------------------------------------
In the previous instalment we told you how to
'UNO_LCD2.BAS Voltage A0, A3
convert the data provided by the A/D converter
'------------------------------------
into a voltage reading. Now let’s see how you
$regfile = "m328pdef.dat"
can show it on the display. First we write a string
'ATmega328p
at the start of each line that identifies the input.
$crystal = 16000000 '16
The is followed by a space character to separate
MHz
it from the reading. We also tack on a couple of
$baud = 9600
spaces after the reading (in this case a real num-
ber) has been output. Without them, the follow-
Dim D As Word
ing situation could occur: Your last reading was
4.859 V, and the new reading is 5.0 V. Bascom Dim U As Single
outputs “5.0” just as it should, but the rest of
the previous output is still there on the display, Config Adc = Single , Prescaler = 64 ,
so you see “5.059 V” and wonder what’s going Reference = Avcc '5 V
on. To prevent this from happening, we always
delete anything that might be present after the Config Lcdpin = Pin , Db4 = Portd.4 ,
current output. Here we accept the risk that this Db5 = Portd.5 , Db6 = Portd.6 , Db7 =
may involve characters intended for a larger dis- Portd.7 , E = Portd.3 , Rs = Portd.2
play that are not visible on the actual display. Config Lcd = 16 * 2

Incidentally, this program uses the ADC0 and Cls


ADC3 channels for its measurements. You can Cursor Off
connect a signal source to ADC0, preferably with Do
a protective series resistor as shown in Figure 2. Locate 1 , 1
There’s already something connected to ADC3: Lcd "A0 "
the potentiometer on the Elektor shield. You can D = Getadc(1) 'A0
adjust it to provide a voltage from 0 to 5 V. U = D * 5.0
All of the Arduino pins are also fed out to socket U = U / 1023
headers on the shield. If you connect a hefty Lcd U
electrolytic capacitor (you surely have an elec- Lcd " "
trolytic somewhere on your bench – but don’t
exceed 470 µF) between the GND and ADC3 pins, Locate 2 , 1 'Pot
which puts it in parallel with the potentiometer, Lcd "A3 "
you have a low-pass filter and you can see on the
D = Getadc(3)
display how the voltage gradually adjusts after
U = D * 5.0
you change the potentiometer setting. The rea-
U = U / 1023
son for the 470 µF limit is that you might allow
Lcd U
the capacitor to charge slowly to 5 V and then
Lcd " "
quickly turn the potentiometer towards zero. If
Waitms 1000
the capacitor is too large, the resulting discharge
Loop
current could fry the potentiometer.

www.elektor-magazine.com | July & August 2014 | 61


•Projects

to a certain extent by the potentiometer voltage


LED1 LED2 on ADC3. This is due to the sample-and-hold
capacitor at the input of the A/D converter. This
0...5V
capacitor is first charged to the voltage present

1k

1k
100u...
470u on the measurement input, and then its charge
+5V
10k is measured. If the capacitor last saw 3 V from

10k
the potentiometer during the previous measure-
ment, some of its charge will still be left because
28 27 26 25 24 23 22 21 20 19 18 17 16 15 it cannot discharge quickly enough through the
extremely high impedance of the LED. For this

GND

AVCC
C5
C4
C3
C2
C1
C0

B5
B4
B3
B2
B1
AREF
ATmega328p reason, the microcontroller data sheet recom-
mends that the internal resistance of the signal

GND
VCC
RES
D0
D1
D2
D3
D4

D5
D6
D7
B0
X1
X2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 source should not exceed 10 kΩ. Here we are
dealing with many megohms instead, so it’s bet-
16MHz
ter to set the potentiometer to zero. Then you
100n
will see that there is still a measurable voltage
Figure 2.
22p 22p
140064 - 12
at low light levels. This circuit shows that the
Using the analog inputs. A/D converter has very high input impedance. A
typical digital voltmeter with an input impedance
that a perfectly ordinary LED can also act as a of 10 MΩ would not be able to measure the LED
photodiode – in this case as a light sensor. If you voltage, but the ATmega can do so.
shine a bright light on the LED, it can deliver a
voltage as high as 1.5 V—three times as much With very high impedance signal sources, you
as a silicon photodiode. That’s because a larger can connect a 10 nF bypass capacitor in parallel
band gap means a greater voltage, which applies as shown in Figure 3. This makes the measure-
equally well to the forward voltage of a diode and ments much more reliable. Even with very dim
voltage it generates. light, you can now measure a voltage of roughly
Another thing you might notice is that at low light 1 V. For all PN junctions with their exponential
levels the voltage measured on ADC2 is affected characteristic curves, the rule of thumb is that
the voltage rises by approximately 70 mV when
the current is increased by a factor of 10. This
Listing 3: Measuring the LED voltage means that the span between 1.0 V and 1.5 V cor-
and the potentiometer voltage. responds to seven decades of current range, and
Do thus seven decades of brightness. That should
Locate 1 , 1 be more than enough for measuring from 10 lux
Lcd "A2 " to 100,000 lux, and we can see the makings of
a light meter here. Maybe that’s an attractive
D = Getadc(2) 'LED1
job for an enthusiastic reader? There’s nothing
U = D * 5.0
wrong with a nice collection of Bascom programs
U = U / 1023
with contributions from many people.
Lcd U
Lcd " " PWM outputs
When precise timing matters, timers come to the
Locate 2 , 1 fore. Most microcontrollers have several timers.
Lcd "A3 " Timer1 of the ATmega328 has a resolution of
D = Getadc(3) 'Pot 16 bits. You can regarded it as a sixteen-stage
U = D * 5.0 counter, similar to the well-known CD4040 (which
U = U / 1023 has only twelve stages). A clock signal (or other
Lcd U pulse signal) entering at one end comes out at
Lcd " " the other end with a lower frequency. You can
use the CD4040 to build a clock generator or a
Waitms 1000
frequency divider, or as the basis for a binary
Loop
pulse counter. Timer1 can also handle all of these

62 | July & August 2014 | www.elektor-magazine.com


Microcontroller Bootcamp

functions; you just have to initialize it properly.


There are also two 8-bit timers on board (Timer0 LED1 LED2

and Timer2).

1k

1k
One of the many operating modes of Timer1 is 10n

PWM mode. It can generate two pulse width mod-


+5V 10k
ulated signals, which means rectangular pulse
signals with adjustable mark/space (on/off) ratio.
Among other things, they can be used to con-
28 27 26 25 24 23 22 21 20 19 18 17 16 15
trol the brightness of a lamp, much in the same

GND
C5
C4
C3
C2
C1
C0

B5
B4
B3
B2
B1
AVCC
AREF
way as a dimmer on the AC line which simply
switches the voltage on and off at a high rate. ATmega328p

GND
VCC
RES
Here we want to do the same thing by using the

D0
D1
D2
D3
D4

D5
D6
D7
B0
X1
X2
1 2 3 4 5 6 7 8 9 10 11 12 13 14
PWM output to control the brightness of an LED.
The PWM output has a maximum adjustment 16MHz

range of 10 bits, but it can also be configured in


8-bit mode. Here 10 bits is an attractive choice 100n
22p 22p
Figure 3.
because it matches the resolution of the A/D con- 140064 - 13 Using an LED as a light
verter. In both cases the counter runs from 0 to sensor.

Listing 4: PWM control.

'-------------------------------------- Portc.0 = 1 'Pullup


'UNO_LCD3.BAS PWM Portc.1 = 1 'Pullup
'-------------------------------------- Config Portb = Output
$regfile = "m328pdef.dat" Cls
'ATmega328p Cursor Off
$crystal = 16000000 '16 MHz Do
$baud = 9600 Locate 1 , 1
Lcd "PWMA="
A = Getadc(3)
S1 Alias Pinc.0 Pwm1a = A
S2 Alias Pinc.1 Lcd A
Lcd " "
Dim D As Word
Dim U As Single If S1 = 0 Then
If B > 0 Then B = B - 1
Config Adc = Single , Prescaler = 64 , End If
Reference = Avcc '5 V If S2 = 0 Then
If B < 1023 Then B = B + 1
Config Timer1 = Pwm , Prescale = 1 , End If
Pwm = 10 , Pwm1b = B
Compare A Pwm = Clear Up , Compare B
Pwm = Clear Up Locate 2 , 1
Lcd "PWMB="
Config Lcdpin = Pin , Db4 = Portd.4 , Lcd B
Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Lcd " "
Portd.7 , E = Portd.3 , Rs = Portd.2 Waitms 100
Config Lcd = 16 * 2 Loop

www.elektor-magazine.com | July & August 2014 | 63


•Projects

clock frequency is used. You might think that this


PWMA PWMB
LED1 LED2 yields a PWM frequency of 15.625 kHz (16 MHz
divided by 1024), but in fact it is only half of this
S2 S1
(approximately 7.8 kHz). This come from the fact

1k

1k
that Bascom uses the “Phase Correct PWM” mode
instead of the “Fast PWM” mode. You can learn
+5V 10k
more about this from the microcontroller data
sheet, but that’s more like a book than a data
sheet. Here Bascom saves developers time and
28 27 26 25 24 23 22 21 20 19 18 17 16 15
effort by always choosing a reasonable option for

GND
C5
C4
C3
C2
C1
C0

B5
B4
B3
B2
B1
AVCC
AREF
each setting. This means you can obtain work-
ATmega328p ing results with Bascom even if you don’t fully

GND
understand all the details.
VCC
RES
D0
D1
D2
D3
D4

D5
D6
D7
B0
X1
X2
1 2 3 4 5 6 7 8 9 10 11 12 13 14

LED 2 is connected to the second PWM output


16MHz
(PB2). In our program this output is controlled
100n by the two pushbuttons S1 and S2. To make
Figure 4.
22p 22p the program easy to read, the Alias instruc-
A pair of LEDs connected to 140064 - 14

the PWM outputs. tion is used to assign the button names to the
port inputs. This means that when you write If
1023. You could for example program the out- S1 = 0 Then in your code, Bascom knows that
put to switch off when the counter reaches 511, what you actually mean is If Pinc.1 = 0, so the
which results in a PWM signal with a 50% duty state of port pin PC1 has to be polled. Another
factor. This is achieved by repeatedly comparing important consideration is that the buttons are
the counter value with the programmed value connected to ground and therefore require pullup
in a compare unit. There are two compare units resistors. As a result, the program normally sees
in the microcontroller, so you can generate two the quiescent state S1 = 1. This only changes to
independent PWM signals with the same timer. S1 = 0 when someone presses the button. That
PWM1A is output on port pin PB1, while PWM1B makes things very simple. When you press S1
is output on pin PB2. That reminds us of some- you reduce the PWM output level (assuming it
thing. You guessed it: LED 2 is connected to PB2 is greater than 0), and when you press S2 you
through a 1 kΩ series resistor. Coincidence? Not raise the PWM output level (assuming it is less
at all, because now you can use the PWM signal than 1023). This proceeds in single steps if you
to control the brightness of the LED. press the button briefly, but if you press and hold
The program in Listing 4 uses the PWM1A out- the button it changes continuously at ten steps
put together with the A/D converter input ADC3, per second. The current output value is always
which is connected to the potentiometer. The shown on the LCD.
measured value of the potentiometer setting is
used as the comparison value for the PWM sig- Button polling
nal. If you set the potentiometer to mid-range, The program shows a very simple example of
the PWM output is a symmetrical square wave. how to use buttons and corresponding program
Everything from 0 to 1023 is possible. The actual branching. Of course, there are lots of other ways
output value is shown on the LCD. If you want to obtain the desired result. Developing the ideal
to look at the signal, you can connect a scope user interface for a given task is a fascinating
probe to PB1 (Arduino pin 9). job. You can configure a wide variety of things
with two buttons and a potentiometer. A lot can
What is the frequency of the PWM signal? That be achieved with just a few buttons.
depends on the frequency of the clock input to the The program uses everything that the Elektor
timer. It can be the clock signal from the Arduino shield has to offer. The LCD shows the two cur-
board (16 MHz), but it can also be a lower-fre- rent PWM values, the potentiometer controls the
quency signal derived from the clock signal by PWMA output, and the two buttons control the
passing it through a prescaler. Here the initializa- PWMB output and thereby LED 2. Is that really
tion instruction Prescale = 1 means that the full everything? Well, not quite—LED 1 isn’t doing

64 | July & August 2014 | www.elektor-magazine.com


Microcontroller Bootcamp

anything. So let’s plug a wire into PB1 (Arduino ness using the potentiometer. The LCD reveals
pin 9) and ADC2 (Arduino A2) to connect PWMA how well this went. Then the two players swap
to LED 1 through a 1 kΩ resistor and a jumper roles. All differences between the two values are
(Figure 4). Now you can control the brightness recorded. The player with the lowest score at the
of the LED with the potentiometer. end is the winner and is designated “Hawkeye”.
With two LEDs whose brightness can be set (140064-I)
independently, you have the makings of a little
Web Links
skill-testing game. The first player sets the bright-
ness of LED 2 to some arbitrary value using the [1] www.elektor-magazine.com/140064
buttons. Then this LED is covered, and the sec- [2] http://b-kainka.de/bastel49.htm (in German)
ond player tries to set LED 1 to the same bright- [3] http://en.wikipedia.org/wiki/Polarizer

MCS Boot Loader


Up to now we have described two MSC boot loader, you must configure
options for programming the Arduino: Bascom accordingly. Here again it is
using the Arduino boot loader or important to set the right COM port
using the ISP interface, which is also and the right baud rate, in this case
brought out on the Elektor shield. 19,200 (see the second screenshot).
With an external programmer, you
can also use the ISP interface to load There is another important setting
a different boot loader. on the MCS Loader tab. As you may
recall, data is transmitted to the
Bascom has the MCS boot loader, Arduino board over the USB bus,
which can be adapted to various but it arrives through a simulated
microcontrollers. That’s attractive RS232 port. All Arduino systems use
because it allows you to equip the RS232 DTR line as a Reset line;
different microcontroller boards a falling edge on this line triggers
with the same boot loader. The a reset. That’s what starts the boot
source code is included with the loader, because the microcontroller
Bascom example programs. All that runs the program code stored at the
is necessary for adaptation is to boot address (&H3C00) when it starts
configure the microcontroller type, up. This code waits for a specific
the clock frequency and the desired action from the PC. Either new
baud rate. The configuration for program comes down the pipe or it
the ATmega328P was not yet there, doesn’t, and then execution branches
but the adaptation was easy. The to the start of program memory at
fully adapted boot loader, including address zero. This process occurs
the source code and hex file, can with every reset, which is what allows
be downloaded from the Elektor Bascom to force a jump to the boot
website [1]. The files are called loader by changing the level on the
BootLoaderUno_16.bas (16 stands DTR line. Users have it easy because
for 16 MHz) and BootLoaderUno_16. they don’t have to press the reset
hex. Note that the fuse settings button themselves.
must be slightly different (see the
first AVR Studio screenshot) than
for the Arduino boot loader because
more memory space is needed.
The boot area is 1024 words with
the MSC boot loader and starts at
&H3C00. If you intend to use the

www.elektor-magazine.com | July & August 2014 | 65

You might also like