You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-37Lines changed: 39 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,21 @@
3
3
4
4
# Getting Started With the tinyAVR® 1-series
5
5
6
-
This repository contains training examples on the Microchip tinyAVR® 1-series. Follow the [Training Manual - Getting Started With the tinyAVR® 1-series](https://www.microchip.com/DS40001949) from Microchip for full step-by-step description. The training is carried out on a ATtiny817 Xplained Pro board. The projects in this repository are made in MPLAB® X with MPLAB® Code Configurator (MCC). While the Training manual explains steps in Atmel Studio with Atmel START, this document will go through how to complete them in MPLAB® X with MPLAB® Code Configurator (MCC).
6
+
This repository contains training examples on the Microchip tinyAVR® 1-series. Follow the [Training Manual - Getting Started With the tinyAVR® 1-series](https://www.microchip.com/DS40001949) from Microchip for full step-by-step instructions. The training is carried out on a ATtiny817 Xplained Pro board. The projects in this repository are made in MPLAB® X IDE with MPLAB® Code Configurator (MCC). While the training manual explains steps in Atmel Studio with Atmel START, this document will go through how to complete them in MPLAB X IDE with MPLAB Code Configurator (MCC).
7
7
8
8
This training includes three assignments covering topics such as:
9
9
- PINMUX driver configuration and check LED toggle on button press
10
-
- Generate a PWM by using timer counter A (TCA) and implement Variable-Pulse-Width by using the RTC interrupt
11
-
- Duty cycle and frequency measurement using input capture mode of TCB
12
-
- USART configuration
13
-
- CCL (Configurable Custom Logic): A programmable logic peripheral, which can be connected to the device pins, events, or peripherals, which allows the user to eliminate external logic gates for simple glue logic functions.
10
+
- Generate a Pulse Width Modulation (PWM) by using Timer/Counter Type A (TCA) and implement VariablePulseWidth (VPW) by using the Real-Time Counter (RTC) interrupt
11
+
- Duty cycle and frequency measurement using input capture mode of Timer/Counter Type B (TCB)
12
+
-Universal Synchronous and Asynchronous Receiver and Transmitter (USART) configuration
13
+
- CCL (Configurable Custom Logic): A programmable logic peripheral, which can be connected to the device pins, events, or peripherals, which allows the user to eliminate external logic gates for simple glue logic functions
14
14
15
-
The code in this repository is configured using MCC Melody for all three assignments. Refer to the [Training Manual - Getting Started With the tinyAVR® 1-series](https://www.microchip.com/DS40001949) for additional information on how to configure from scratch.
15
+
The code in this repository is configured using MCC Melody for all three assignments. Refer to the [Training Manual - Getting Started With the tinyAVR® 1-series](https://www.microchip.com/DS40001949) for additional information.
16
16
17
17
## Related Documentation
18
18
19
19
-[Training Manual - Getting Started With the tinyAVR® 1-series](https://www.microchip.com/DS40001949)
@@ -32,18 +32,18 @@ The code in this repository is configured using MCC Melody for all three assignm
32
32
- One female-to-female wire
33
33
- Internet connection
34
34
35
-
## Assignment 1: LED TOGGLE Application
35
+
## Assignment 1: LED Toggle Application
36
36
37
-
An application will be developed that controls the LED using the push-button on the board. The LED will be OFF while holding the button down, default state is LED ON.
37
+
An application will be developed to control the LED using the push-button on the board. The LED will be OFF while holding the button down(default state is LED ON).
38
38
39
39
On the ATtiny817 Xplained Pro board, LED0 is connected to pin PB4, and the push-button (SW0) is connected to pin PB5.
40
40
41
41
For application:
42
-
- Peripherals used: GPIO (PB4, PB5).
43
-
- Clock: 3.33 MHz.
42
+
- Peripherals used: GPIO (PB4, PB5)
43
+
- Clock: 3.33 MHz
44
44
45
-
### MCC setup
46
-
This section shows how this example is set up in MCC. In the pin grid view, set PB4 to ouput and PB5 to input. On the ATtiny817 Xplained Pro these pins are connected to LED0 and SW0 respectively.
45
+
### MCC Setup
46
+
This section shows how this example is set up in MCC. In the pin grid view, set PB4 to ouput and PB5 to input. On the ATtiny817 Xplained Pro board, these pins are connected to LED0 and SW0, respectively.
In the pins tab, name the pins and set SW0 to Pull-up.
@@ -62,7 +62,7 @@ The TCA waveform output will be used as input to the TCB through the Event Syste
62
62
63
63
Single-Slope PWM Generation mode will be used for TCA. Here, the period is controlled by the PER register, while the values of the CMPn compare register controls the duty cycle of the waveform generated (WG) output, the WOn. The counter value is compared to the CMPx registers and the PER register to set the waveform period or pulse width.
64
64
65
-
The project from Assignment1: LED TOGGLE Application will be
65
+
The project from Assignment 1: LED Toggle Application will be
66
66
reconfigured to add drivers for TCA, TCB, Event System, RTC, and USART.
67
67
68
68
For the application the peripherals used are:
@@ -76,48 +76,50 @@ Clock:
76
76
- 3.33 MHz main clock
77
77
- 1 kHz RTC clock
78
78
79
-
### Physical setup
79
+
### Physical Setup
80
80
81
-
1. Use the female-to-female wire to connect PB0 to PB4, connecting the PWM signal to LED0 on the ATtiny817 Xplained Pro. With this configuration you will see LED0 on your bord switch intensity gradually down until it resets.
1. Use the female-to-female wire to connect PB0 to PB4, connecting the PWM signal to LED0 on the ATtiny817 Xplained Pro. With this configuration you will see LED0 on your board switch intensity gradually down until it resets.
2. Use the female-to-female wire to connect PB0 to PA5, connecting the PWM signal to the Event System. With this configuration the ATtiny817 Xplained Pro will send the calculated duty cycle and frequency to the terminal using the USART peripheral.
In the TCA peripheral set the Requested Period to 30.33 µs, set Waveform Generation Mode to Single Slope PWM, enable Compare Channel 0 Enable and set Duty Cycle 0 to 10.
94
+
In the TCA peripheral, set the Requested Period to 30.33 µs, set Waveform Generation Mode to Single Slope PWM, enable Compare Channel 0 Enable and set Duty Cycle 0 to 10.
In the RTC peripheral set Prescaling Factor to RTC Clock/32 to get a 1024 Hz RTC Clock. Set Period to 0.5(500 ms). Ensure that the Overflow Interrupt Enable is enabled.
99
+
In the RTC peripheral, set Prescaling Factor to RTC Clock/32 to get a 1024 Hz RTC Clock. Set Period to 0.5(500 ms).
@@ -127,13 +129,13 @@ In the USART0_Peripheral disable Enable USART Receiver since the receiver is not
127
129
128
130
## Assignment 3: Basis of a Binary Frequency-Shift Keying Scheme
129
131
130
-
The CCL (Configurable Custom Logic) module is a programmable logic peripheral, which can be connected to the pins, events, or peripherals on the device. It allows the user to eliminate external logic gates for simple glue logic functions.
132
+
The CCL module is a programmable logic peripheral, which can be connected to the pins, events, or peripherals on the device. It allows the user to eliminate external logic gates for simple glue logic functions.
131
133
132
134
In this assignment, a small CCL-based application will be developed. It will blink an LED at two different frequencies depending on whether a button is depressed or not. Two pulse trains of different frequencies will be generated and routed to the CCL. The CCL will be configured to select which of the pulse trains to
133
135
pass on to the output based on the state of a third input signal as shown in the image below.
Here, output = input1 when input3 is LOW, and output = input2 when input3 is HIGH.
@@ -153,7 +155,7 @@ The RTC peripheral offers two timing functions; the Real-Time Counter (RTC) and
153
155
By using the same clock source as the RTC function, the PIT can request an interrupt or trigger an output
154
156
event on every nth clock period. n can be selected from {4, 8, 16,.. 32768}. Here the Event System will be configured to output events from the PIT. The event signals from the PIT has the form of clock signals with periods corresponding to the respective number of the RTC clock periods. This application uses the event signal corresponding to 8192 RTC clock periods. The event signal from the PIT has a frequency of 32 kHz/8192 = 3.9 Hz (period approximately 250 ms).
155
157
156
-
The project from assignment 2 will be reconfigured to add the CCL driver and edit the Event System and RTC driver.
158
+
The project from Assignment 2 will be reconfigured to add the CCL driver and edit the Event System and RTC driver.
157
159
For this application, the peripherals used are:
158
160
- TCA (waveform output WO0 on PB0)
159
161
- PIT (event output)
@@ -165,12 +167,12 @@ Clock details:
165
167
- 3.33 MHz main clock
166
168
- PIT 32 kHz
167
169
168
-
### Physical setup
170
+
### Physical Setup
169
171
170
172
1. Use the female-to-female wire to connect PA7 to PB4, connecting the CCL output signal to LED0 on the ATtiny817 Xplained Pro. LED0 will switch intensity gradually down until it resets. When the button is held down LED0 will blink with a approximate frequency of 3.9 Hz.
An overview of the MCC setup used in assignment 3 is shown in the image below. Remaining peripherals from assignment 2 can be deleted or just left as is. TCA0 is used with the same setup as assignment 2.
176
178
@@ -183,13 +185,13 @@ In the CCL peripheral go the settings for LUT1. Enable LUT1 and enable LUT outpu
In the EVSYS peripheral connect GENERATORS>ASYNCCH1>PORTB_PIN5 to the CHANNELS>ASYNCCH1, then further connect CHANNELS>ASYNCCH1 to USERS>CCL LUT1 Event 0. Also connect GENERATORS>ASYNCCH3>PIT_DIV8192 to the CHANNELS>ASYNCCH3, then further connect CHANNELS>ASYNCCH3 to USERS>CCL LUT1 Event 1.
188
+
#### Event System(EVSYS)
189
+
In the EVSYS peripheral, connect GENERATORS>ASYNCCH1>PORTB_PIN5 to the CHANNELS>ASYNCCH1, then further connect CHANNELS>ASYNCCH1 to USERS>CCL LUT1 Event 0. Also connect GENERATORS>ASYNCCH3>PIT_DIV8192 to the CHANNELS>ASYNCCH3, then further connect CHANNELS>ASYNCCH3 to USERS>CCL LUT1 Event 1.
@@ -201,9 +203,9 @@ In the RTC peripheral enable PIT Enable in the Periodic Interrupt Timer.
201
203
202
204
3. Open the project in MPLAB X IDE.
203
205
204
-
4. For assignment 2 and 3 connect the female-to-female wire according to the Physical setup.
206
+
4. For Assignment 2 and 3 connect the female-to-female wire according to the Physical Setup.
205
207
206
208
5. Build the solution and program the ATtiny817.
207
209
208
210
## Conclusion
209
-
This training exercise demonstrated the different peripherals of tinyAVR 1-series, how to use the Event System to generate Event and how to use CCL to generate output.
211
+
This training exercise demonstrated the different peripherals of the tinyAVR 1-series, how to use the Event System to generate an Event and how to use CCL to generate an output.
0 commit comments