Skip to content

Commit 545737d

Browse files
Sindre MidjaasSindre Midjaas
authored andcommitted
MPAE-18955: Readme updates from PR
1 parent feb3604 commit 545737d

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed

README.md

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33

44
# Getting Started With the tinyAVR® 1-series
55

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).
77

88
This training includes three assignments covering topics such as:
99
- 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 Variable Pulse Width (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
1414

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.
1616

1717
## Related Documentation
1818

1919
- [Training Manual - Getting Started With the tinyAVR® 1-series](https://www.microchip.com/DS40001949)
20-
- [ATtiny817 Device Page](https://www.microchip.com/wwwproducts/en/ATtiny817)
20+
- [ATtiny817 device page](https://www.microchip.com/wwwproducts/en/ATtiny817)
2121

2222
## Software Used
2323

@@ -32,18 +32,18 @@ The code in this repository is configured using MCC Melody for all three assignm
3232
- One female-to-female wire
3333
- Internet connection
3434

35-
## Assignment 1: LED TOGGLE Application
35+
## Assignment 1: LED Toggle Application
3636

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).
3838

3939
On the ATtiny817 Xplained Pro board, LED0 is connected to pin PB4, and the push-button (SW0) is connected to pin PB5.
4040

4141
For application:
42-
- Peripherals used: GPIO (PB4, PB5).
43-
- Clock: 3.33 MHz.
42+
- Peripherals used: GPIO (PB4, PB5)
43+
- Clock: 3.33 MHz
4444

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.
4747
<p><img src="images/assignment1_mcc_pin_grid_view.jpg" width="600"/></p>
4848

4949
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
6262

6363
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.
6464

65-
The project from Assignment1: LED TOGGLE Application will be
65+
The project from Assignment 1: LED Toggle Application will be
6666
reconfigured to add drivers for TCA, TCB, Event System, RTC, and USART.
6767

6868
For the application the peripherals used are:
@@ -76,48 +76,50 @@ Clock:
7676
- 3.33 MHz main clock
7777
- 1 kHz RTC clock
7878

79-
### Physical setup
79+
### Physical Setup
8080

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.
82-
<p><img src="images/assignment2_connection_1.PNG" width="500"/></p>
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 board switch intensity gradually down until it resets.
82+
<p><img src="images/assignment2_connection_1.png" width="500"/></p>
8383

8484
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.
85-
<p><img src="images/assignment2_connection_2.PNG" width="500"/></p>
85+
<p><img src="images/assignment2_connection_2.png" width="500"/></p>
8686

87-
### MCC setup
87+
### MCC Setup
8888

8989
An overview of the MCC setup is shown in the image below:
9090

9191
<p><img src="images/assignment2_mcc_overview.jpg" width="600"/></p>
9292

9393
#### TCA
94-
In the TCA peripheral set the Requested Period to 30.33 &micro;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 &micro;s, set Waveform Generation Mode to Single Slope PWM, enable Compare Channel 0 Enable and set Duty Cycle 0 to 10.
9595

9696
<p><img src="images/assignment2_mcc_tca.jpg" width="600"/></p>
9797

9898
#### RTC
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). 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).
100100

101101
<p><img src="images/assignment2_mcc_rtc.jpg" width="600"/></p>
102+
103+
Ensure that the Overflow Interrupt Enable is enabled.
102104
<p><img src="images/assignment2_mcc_rtc_interrupt.jpg" width="600"/></p>
103105

104106
#### Interrupt Manager
105-
In the System>Interrupt Manager enable Global Interrupt Enable.
107+
In the System>Interrupt Manager, enable Global Interrupt Enable.
106108

107109
<p><img src="images/assignment2_mcc_interrupt_manager.jpg" width="600"/></p>
108110

109111
#### TCB
110-
In the TCB peripheral set Timer Mode to FRQPW(Input Capture Frequency and Pulse-Width Measurement mode) and enable Event Input Capture Enable.
112+
In the TCB peripheral, set Timer Mode to FRQPW (Input Capture Frequency and Pulse-Width Measurement mode) and enable Event Input Capture Enable.
111113

112114
<p><img src="images/assignment2_mcc_tcb.jpg" width="600"/></p>
113115

114-
#### Event System(EVSYS)
115-
In the EVSYS peripheral connect GENERATORS>ASYNCCH0>PORTA_PIN5 to the CHANNELS>ASYNCCH0, then further connect CHANNELS>ASYNCCH0 to USERS>TCB0.
116+
#### Event System (EVSYS)
117+
In the EVSYS peripheral, connect GENERATORS>ASYNCCH0>PORTA_PIN5 to the CHANNELS>ASYNCCH0, then further connect CHANNELS>ASYNCCH0 to USERS>TCB0.
116118

117119
<p><img src="images/assignment2_mcc_evsys.jpg" width="600"/></p>
118120

119121
#### USART
120-
In the USART enable Redirect Printf to UART.
122+
In the USART, enable Redirect Printf to UART.
121123

122124
<p><img src="images/assignment2_mcc_usart.jpg" width="600"/></p>
123125

@@ -127,13 +129,13 @@ In the USART0_Peripheral disable Enable USART Receiver since the receiver is not
127129

128130
## Assignment 3: Basis of a Binary Frequency-Shift Keying Scheme
129131

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.
131133

132134
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
133135
pass on to the output based on the state of a third input signal as shown in the image below.
134136

135137
CCL Input/Output Waveform
136-
<p><img src="images/assignment3_waveform.PNG" width="600"/></p>
138+
<p><img src="images/assignment3_waveform.png" width="600"/></p>
137139

138140

139141
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
153155
By using the same clock source as the RTC function, the PIT can request an interrupt or trigger an output
154156
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).
155157

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.
157159
For this application, the peripherals used are:
158160
- TCA (waveform output WO0 on PB0)
159161
- PIT (event output)
@@ -165,12 +167,12 @@ Clock details:
165167
- 3.33 MHz main clock
166168
- PIT 32 kHz
167169

168-
### Physical setup
170+
### Physical Setup
169171

170172
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.
171-
<p><img src="images/assignment3_connection.PNG" width="500"/></p>
173+
<p><img src="images/assignment3_connection.png" width="500"/></p>
172174

173-
### MCC setup
175+
### MCC Setup
174176

175177
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.
176178

@@ -183,13 +185,13 @@ In the CCL peripheral go the settings for LUT1. Enable LUT1 and enable LUT outpu
183185
<p><img src="images/assignment3_mcc_ccl_lut1_1.jpg" width="600"/></p>
184186
<p><img src="images/assignment3_mcc_ccl_lut1_2.jpg" width="600"/></p>
185187

186-
#### Event System(EVSYS)
187-
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.
188190

189191
<p><img src="images/assignment3_mcc_evsys.jpg" width="600"/></p>
190192

191193
#### RTC
192-
In the RTC peripheral enable PIT Enable in the Periodic Interrupt Timer.
194+
In the RTC peripheral, enable PIT Enable in the Periodic Interrupt Timer.
193195

194196
<p><img src="images/assignment3_mcc_pit.jpg" width="600"/></p>
195197

@@ -201,9 +203,9 @@ In the RTC peripheral enable PIT Enable in the Periodic Interrupt Timer.
201203

202204
3. Open the project in MPLAB X IDE.
203205

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.
205207

206208
5. Build the solution and program the ATtiny817.
207209

208210
## 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

Comments
 (0)