Microchip Technology Parrot Manual de usuario

Parrot Hardware
Parrot (Voice Recorder) with ATtiny817 Hardware User's
Guide
Introduction
This user guide describes an audio demo board based on the ATtiny817, a high-performance tinyAVR® 8-
bit microcontroller.
The Parrot field engagement board can be used as a voice recorder to record, play back, browse, and
erase voice data. This application helps the user to quickly evaluate the ADC and DAC features of the
microcontroller.
The firmware and accompanying application note ( AVR42777) is available on Atmel START http://
start.atmel.com/.
Features
• Voice Record and Playback
• Electret Microphone
• Volume Control
• 8Mb SPI Data Flash
• Single-Wire Programming via UPDI
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 1

Table of Contents
Introduction......................................................................................................................1
Features.......................................................................................................................... 1
1. Block Diagram........................................................................................................... 3
2. Hardware Details....................................................................................................... 4
2.1. Microphone...................................................................................................................................4
2.2. Filter for ADC................................................................................................................................4
2.3. Microcontroller..............................................................................................................................5
2.3.1. ADC............................................................................................................................... 6
2.3.2. DAC............................................................................................................................... 6
2.4. Filter for DAC................................................................................................................................7
2.5. Power Amplifier............................................................................................................................ 8
2.6. User Interfaces............................................................................................................................. 9
2.6.1. Buttons...........................................................................................................................9
2.6.2. LEDs..............................................................................................................................9
2.7. External Data Flash....................................................................................................................10
2.8. UPDI Programming Interface..................................................................................................... 10
3. Firmware Programming........................................................................................... 12
3.1. Connection................................................................................................................................. 12
3.2. Firmware.................................................................................................................................... 12
3.3. Programming..............................................................................................................................12
4. Revision History.......................................................................................................14
5. Object of Declaration............................................................................................... 15
The Microchip Web Site................................................................................................ 16
Customer Change Notification Service..........................................................................16
Customer Support......................................................................................................... 16
Microchip Devices Code Protection Feature................................................................. 16
Legal Notice...................................................................................................................17
Trademarks................................................................................................................... 17
Quality Management System Certified by DNV.............................................................18
Worldwide Sales and Service........................................................................................19
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 2

1. Block Diagram
ATtiny817
DACADC
SPI
Data Flash
OP
AMP Filter Power
AMP
REC PLAY/STOP BACK FORWARD
GPIO x6
PWR REC
GPIO x2
5V
3.3V
Volume
Control
ERASE
LDO
3.3V
User
The Parrot field engagement board demonstrates the capabilities of the ATtiny817 with audio processing,
using its ADC and DAC peripherals. It is possible to record, playback, erase, rewind, and fast forward by
using the buttons.
As shown in the figure above, once the “REC” (record) button is pressed, the electret microphone starts
to detect an analog sound signal. The sound signal will be processed in the front-end operation amplifier
and a low-pass filter will be applied to the signal. The signal will then be digitized by the ADC of the
ATtiny817 microcontroller. The converted sound data is stored in the external data Flash through the SPI
interface. When the button is pressed again, this recording process is stopped.
Once the “PLAY/STOP” button is pressed, the sound data stored in the data Flash is read and converted
to an analog signal through the DAC on the MCU. The analog signal is then sent through a low-pass filter
before it is sent to the amplifier with the set volume. This allows the user to listen to the previously
recorded sound. If the button is pressed again, the play process is stopped.
The board is supplied with +5V from the Micro-USB interface with ESD protection. The applied LDO can
source out 150mA @ 3.3V system power.
Figure 1-1. Parrot Board
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 3

2. Hardware Details
2.1 Microphone
The device is a general low-cost electret microphone. See the table below for technical parameters.
It is highly recommended to keep the microphone at least 10cm away from the sound source to avoid
peak clipping or distortion of the signal.
Table 2-1. Microphone Parameters
Parameters Value
Manufacturer part number BL-MP6022P-2C-44DB
Standard operation voltage (DC) 2V
Active current <0.5mA
Sensitivity (1kHz, 0dB=1V/Pa) -44dB ±3dB
S/N ratio 58dB
Impedance < 2.2kΩ
Frequency (Hz) 20-16,000
Directivity Omnidirectional
2.2 Filter for ADC
As shown in the figure below, the power for the microphone is VCC_P3V3, which is filtered by a low-pass
filter to reduce noise from the power supply.
Typically, the original voice signal is quite weak, with measured amplitude around 10mV (less than
50mV). So the signal must be amplified and filtered accordingly. To make sure that the signal can be
amplified without being distorted, a voltage offset is required.
Figure 2-1. Microphone Circuit
1uF
C19
10k
R21
VCC_P3V3
SGND
TP5
BL-MP6022P-2C-44DB
1
2
G
GND
S
D
Microphone
MIC1
SGND
3.3nF
C20
SGND
C17
4.7uF
100k
R18
100nF
C15
2k
R19
SGND
39k
R20
24k
R26
VCC_P3V3
ADC_VF_HALF
18k
R40
1uF
C18
As shown in the figure below, the original signal is processed in a 4-order Sallen-Key Butterworth low-
pass filter. The filter is designed to have a gain of 50 and a cut-off frequency of 4kHz. The amplified signal
is connected to the MCU ADC input 11 (pin PB0_AIN11).
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 4

Figure 2-2. Amplifier and Filter Circuit
Mic. with Pre-Amplification and filter
TP6
-
+5
6
7
U5B
MCP6002-I/SN
10nF
C39
5.6k
R39
1.5nF
C24
100nF
C22
GND
VCC_P3V3
15k
R42
PB0_AIN11 -
+3
2
1
84
U5A
MCP6002-I/SN
SGND
VCC_P3V3
15k
R24
2.4k
R25
SGND
GND
1uF
C23
0R
R44
10nF
C21
2.2nF
C16
11k
R23
6.8k
R22
SGNDSGND
2.4k
R43
1uF
C40
SGND GND
J6
18k
R40
0R
R41
The real filter response vs. frequency curve based on measured data is shown in the figure below.
Figure 2-3. Gain vs. Frequency Curve for the Low-pass Filter of the MIC
2.3 Microcontroller
The ATtiny817 is a tinyAVR 8-bit microcontroller with up to 8KB Flash, 512 bytes of SRAM, and 128 bytes
of EEPROM in a 14-, 20-, and 24-pin package.
The microcontroller uses the latest technologies from Microchip Technology Inc. with a flexible and low-
power architecture including Event System and SleepWalking, accurate analog features, and advanced
peripherals.
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 5

2.3.1 ADC
The Analog-to-Digital Convert (ADC) peripheral features a 10-bit successive approximation ADC with
capability of a sampling rate of up to 150ksps. The ADC is connected to a 12-channel Analog Multiplexer,
which allows twelve single-ended voltage inputs. The single-ended voltage inputs refer to 0V (GND).
For more detail, refer to the latest data sheet of ATtiny817 available at http://www.microchip.com/
wwwproducts/en/attiny817.
Figure 2-4. ATtiny817 ADC Block Diagram
ADC
AIN0
AIN11
DAC
VREF
RES
CTRLA
MUXPOS
EVCTRL
CTRLC
WINLT
WINHT
Internal ref
VDD
Reference sel.
prescaler
COMMAND
+
accumulate
Start
Conversion
Threshold
(IRQ)
Result Ready
(IRQ)
Enable,
Resolution
...
CTRLB
Number of
Accumulated
Samples
<
>
AIN1
VREF
TEMP
2.3.2 DAC
The Digital-to-Analog Converter (DAC) converts a digital value to a voltage. ATtiny817 features an 8-bit
Resistor String type DAC, capable of converting 350,000 samples per second (350ksps), with the internal
Voltage Reference (VREF) as upper limit for conversion. The DAC has one continuous time output with
high drive capabilities, which is able to drive a 5kΩ or 50pF load. The DAC has one analog output pin
(DACOUT), namely the PA06, that must be configured before it can be used.
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 6

Figure 2-5. ATtiny817 DAC Block Diagram
DAC
DATA Output
Driver
CTRLA
8
ENABLE
OUTEN
VREF
peripherals
other
OUT
2.4 Filter for DAC
This filter is an 8-order Butterworth low-pass filter with 1V/V gain. The cut-off frequency is designed to be
4kHz with 0.5dB allowable pass band ripple.
Figure 2-6. 8-order Low-pass Chebyshev Filter
TP4
-
+
3
2
1
84
U3A
MCP6002-I/SN
-
+
5
6
7
U3B
MCP6002-I/SN
-
+
3
2
1
84
U2A
MCP6002-I/SN
-
+
5
6
7
U2B
MCP6002-I/SN
PA6_DACOUT
1uF
C5
150k
R5
100k
R6
150k
R1
470pF
C8
SGND
220pF
C1
GND
VCC_P3V3
330k
R7
180k
R8
330k
R2
270pF
C9
SGND
100pF
C2
330k
R9
300k
R10
330k
R3
330pF
C10
SGND
47p
C3
330k
R11
270k
R12
330k
R4
1nF
C11
SGND
18pF
C4
GND
VCC_P3V3
C6
1uF
OP AMP Filter
100nF
C12
GND
VCC_P3V3
100nF
C13
GND
VCC_P3V3
SGND
39k
R16
24k
R17
VCC_P3V3
100nF
C14
DAC_VF_HALF
As shown in the figure below, the curve is based on measured data of the filter on the board.
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 7

Figure 2-7. Gain vs. Frequency Curve for the 8-order Low-pass Filter
2.5 Power Amplifier
Figure 2-8. Power Amplifier for the Speaker
MCP6002-I/SN
C6
1uF
TP3
GND
10R
R14
47nF
C7
110k
R13
VCC_VBUS_P5V0
TP1
TP2
BTL AMP for Speaker
SGND
8 ohm, 2W
Speaker 2831
1
2
SP1
3
2
8
1
4
5
6
7
U1
LM386M-1
3
2
8
1
4
5
6
7
U4
LM386M-1
GND
VCC_VBUS_P5V0
WH0141-1(14*1) B10K
1 3
2
VR1
POT_METER_3P S2B-PH-K-S
1
2
J1
HEADER-2
100k
R15
SGND
C38
4.7uF
VCC_VBUS_P5V0
GND
SGND
As shown in the figure above, the LM386M-1 amplifier device is powered by USB +5V. The gain from the
power amplifier circuit is fixed to 20 V/V. The input of this circuit is the analog output of the 8-order low
power filter for the DAC.
In front of the power amplifier, one variable resistor (VR1) and a couple of relative resistors construct a
simple circuit for the users to adjust the loudspeaker volume.
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 8

2.6 User Interfaces
2.6.1 Buttons
There are six functional buttons on the board:
• “REC” button, to start or stop the microphone recording
• “PLAY/STOP” button, to playback the recorded sound
• “BACK” button, to jump to previous sound data
• “FORWARD” button, to jump to forward sound data
• “ERASE” button, to erase sound data
• “USER” button, reserved for users
Figure 2-9. Buttons
13
4 2
SKRAAKE010
SW1
GND
100k
R28
User Button
PC5_USER_BTN
100nF
C30
VCC_P3V3
TP8
1 3
42
SKRAAKE010
SW2
100nF
C33
GND
REC.
R34
1k
1 3
42
SKRAAKE010
SW3
100nF
C34
GND
PLAY/STOP
R35
1k
1 3
42
SKRAAKE010
SW4
100nF
C35
GND
BACK
R36
1k
1 3
42
SKRAAKE010
SW5
100nF
C36
GND
FORWARD
R37
1k
TP17 TP18 TP19 TP20
PB5
PB6
PB7
PA7
1 3
42
SKRAAKE010
SW6
100nF
C37
GND
ERASE
R38
1k
TP21
PB4
This button is
reserved for user.
Table 2-2. Pin Map for the Buttons
Button Name I/O Pin
REC PB4
PLAY/STOP PB5
BACK PB6
FORWARD PB7
ERASE PA7
USER PC5
2.6.2 LEDs
There are two LEDs on the board, as shown in the figure below. The firmware determines the use of the
LEDs.
Figure 2-10. Status LEDs
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 9

Table 2-3. Pin Map for the LEDs
Recommended LEDs name ATtiny817 I/O pin Color
Power LED PB3 Green
Record LED PB2 Red
2.7 External Data Flash
This data Flash from Microchip is an 8Mb SPI serial Flash. It supports single voltage read and write
operations under 2.7-3.6V power supply.
Figure 2-11. External Data Flash
Table 2-4. Pinout for the SPI Interface
SPI Signal Name MCU SPI Pin Data Flash Pin
SCK PA3 pin #6
SS PA4 pin #1
MISO PA2 pin #2
MOSI PA1 pin #5
2.8 UPDI Programming Interface
The ATtiny817 supports UPDI (Unified Program and Debug Interface), which is a Microchip proprietary
interface for external programming and on-chip debugging of a device.
Atmel-ICE supports the UPDI interface. The 2x3 connector for the interface is a 2.54mm pitch through-
hole header.
Parrot Hardware
© 2017 Microchip Technology Inc. User Guide DS40001916A-page 10
Tabla de contenidos

















