Skip to content

Commit e53e38b

Browse files
committed
MPAE-8144: Added projects and updated metadata.
1 parent 4a14993 commit e53e38b

38 files changed

+2129
-40
lines changed

.main-meta/main.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,51 @@
55
"metaDataVersion": "1.1.0",
66
"name": "com.microchip.mcu8.studio.project.atmega4809-getting-started-with-usart-studio",
77
"version": "1.0.0",
8-
"displayName": " ",
8+
"displayName": "Getting Started with USART",
99
"projectName": "atmega4809-getting-started-with-usart-studio",
10-
"shortDescription": "",
10+
"shortDescription": "This repository contains 5 bare metal code examples described in the TB3216-Getting Started with USART.",
1111
"ide": {
1212
"name": "STUDIO",
13-
"semverRange": ""
13+
"semverRange": ">=7.0.2397"
1414
},
1515
"compiler": [
1616
{
17-
"name": "",
18-
"semverRange": ""
17+
"name": "AVR-GCC",
18+
"semverRange": "^5.4.0"
1919
}
2020
],
2121
"dfp": {
22-
"name": "",
23-
"semverRange": ""
22+
"name": "ATmega_DFP",
23+
"semverRange": "^1.4.351"
2424
},
2525
"configurator": {
26-
"name": "",
27-
"semverRange": ""
26+
"name": "START",
27+
"semverRange": ">=1.7.360"
2828
},
2929
"device": {
3030
"metaDataVersion": "1.0.0",
3131
"category": "com.microchip.portal.contentRef",
3232
"content": {
3333
"metaDataVersion": "1.0.0",
3434
"category": "com.microchip.device",
35-
"name": "",
35+
"name": "ATmega4809",
3636
"versionRange": "*"
3737
}
3838
},
39-
"author": "",
39+
"author": "Microchip",
4040
"subcategories": [
41+
"START",
42+
[
43+
"Peripherals",
44+
"USART"
45+
],
46+
[
47+
"Development Kit",
48+
"ATmega4809 Xplained Pro"
49+
]
4150
],
4251
"peripherals": [
52+
"USART"
4353
],
4454
"keywords": [
4555
],
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
3+
<ProjectComponents>
4+
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
5+
<CApiVersion></CApiVersion>
6+
<CBundle></CBundle>
7+
<CClass>Device</CClass>
8+
<CGroup>Startup</CGroup>
9+
<CSub></CSub>
10+
<CVariant></CVariant>
11+
<CVendor>Atmel</CVendor>
12+
<CVersion>1.5.0</CVersion>
13+
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
14+
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
15+
<Description></Description>
16+
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
17+
<d4p1:anyType i:type="FileInfo">
18+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.5.362\include\</AbsolutePath>
19+
<Attribute></Attribute>
20+
<Category>include</Category>
21+
<Condition>C</Condition>
22+
<FileContentHash i:nil="true" />
23+
<FileVersion></FileVersion>
24+
<Name>include/</Name>
25+
<SelectString></SelectString>
26+
<SourcePath></SourcePath>
27+
</d4p1:anyType>
28+
<d4p1:anyType i:type="FileInfo">
29+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.5.362\include\avr\iom4809.h</AbsolutePath>
30+
<Attribute></Attribute>
31+
<Category>header</Category>
32+
<Condition>C</Condition>
33+
<FileContentHash>E1mt3ptORaPqOFQECBLDLA==</FileContentHash>
34+
<FileVersion></FileVersion>
35+
<Name>include/avr/iom4809.h</Name>
36+
<SelectString></SelectString>
37+
<SourcePath></SourcePath>
38+
</d4p1:anyType>
39+
<d4p1:anyType i:type="FileInfo">
40+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.5.362\templates\main.c</AbsolutePath>
41+
<Attribute>template</Attribute>
42+
<Category>source</Category>
43+
<Condition>C Exe</Condition>
44+
<FileContentHash>M2rkEYAqCt1LFMQOk0/PDQ==</FileContentHash>
45+
<FileVersion></FileVersion>
46+
<Name>templates/main.c</Name>
47+
<SelectString>Main file (.c)</SelectString>
48+
<SourcePath></SourcePath>
49+
</d4p1:anyType>
50+
<d4p1:anyType i:type="FileInfo">
51+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.5.362\templates\main.cpp</AbsolutePath>
52+
<Attribute>template</Attribute>
53+
<Category>source</Category>
54+
<Condition>C Exe</Condition>
55+
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</FileContentHash>
56+
<FileVersion></FileVersion>
57+
<Name>templates/main.cpp</Name>
58+
<SelectString>Main file (.cpp)</SelectString>
59+
<SourcePath></SourcePath>
60+
</d4p1:anyType>
61+
<d4p1:anyType i:type="FileInfo">
62+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.5.362\gcc\dev\atmega4809</AbsolutePath>
63+
<Attribute></Attribute>
64+
<Category>libraryPrefix</Category>
65+
<Condition>GCC</Condition>
66+
<FileContentHash i:nil="true" />
67+
<FileVersion></FileVersion>
68+
<Name>gcc/dev/atmega4809</Name>
69+
<SelectString></SelectString>
70+
<SourcePath></SourcePath>
71+
</d4p1:anyType>
72+
</Files>
73+
<PackName>ATmega_DFP</PackName>
74+
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.5.362/Atmel.ATmega_DFP.pdsc</PackPath>
75+
<PackVersion>1.5.362</PackVersion>
76+
<PresentInProject>true</PresentInProject>
77+
<ReferenceConditionId>ATmega4809</ReferenceConditionId>
78+
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
79+
<d4p1:string></d4p1:string>
80+
</RteComponents>
81+
<Status>Resolved</Status>
82+
<VersionMode>Fixed</VersionMode>
83+
<IsComponentInAtProject>true</IsComponentInAtProject>
84+
</ProjectComponent>
85+
</ProjectComponents>
86+
</Store>

One_Wire_Mode/One_Wire_Mode.cproj

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
3+
<PropertyGroup>
4+
<SchemaVersion>2.0</SchemaVersion>
5+
<ProjectVersion>7.0</ProjectVersion>
6+
<ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
7+
<ProjectGuid>{ff5de5c2-0859-4a14-80f5-f49a52360ebe}</ProjectGuid>
8+
<avrdevice>ATmega4809</avrdevice>
9+
<avrdeviceseries>none</avrdeviceseries>
10+
<OutputType>Executable</OutputType>
11+
<Language>C</Language>
12+
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
13+
<OutputFileExtension>.elf</OutputFileExtension>
14+
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
15+
<AssemblyName>One_Wire_Mode</AssemblyName>
16+
<Name>One_Wire_Mode</Name>
17+
<RootNamespace>One_Wire_Mode</RootNamespace>
18+
<ToolchainFlavour>Native</ToolchainFlavour>
19+
<KeepTimersRunning>true</KeepTimersRunning>
20+
<OverrideVtor>false</OverrideVtor>
21+
<CacheFlash>true</CacheFlash>
22+
<ProgFlashFromRam>true</ProgFlashFromRam>
23+
<RamSnippetAddress>0x20000000</RamSnippetAddress>
24+
<UncachedRange />
25+
<preserveEEPROM>true</preserveEEPROM>
26+
<OverrideVtorValue>exception_table</OverrideVtorValue>
27+
<BootSegment>2</BootSegment>
28+
<ResetRule>0</ResetRule>
29+
<eraseonlaunchrule>0</eraseonlaunchrule>
30+
<EraseKey />
31+
<AsfFrameworkConfig>
32+
<framework-data xmlns="">
33+
<options />
34+
<configurations />
35+
<files />
36+
<documentation help="" />
37+
<offline-documentation help="" />
38+
<dependencies>
39+
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
40+
</dependencies>
41+
</framework-data>
42+
</AsfFrameworkConfig>
43+
<avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
44+
<avrtoolserialnumber>ATML3074061800002074</avrtoolserialnumber>
45+
<avrdeviceexpectedsignature>0x1E9651</avrdeviceexpectedsignature>
46+
<avrtoolinterface>UPDI</avrtoolinterface>
47+
<com_atmel_avrdbg_tool_edbg>
48+
<ToolOptions>
49+
<InterfaceProperties>
50+
<UpdiClock>500000</UpdiClock>
51+
</InterfaceProperties>
52+
<InterfaceName>UPDI</InterfaceName>
53+
</ToolOptions>
54+
<ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
55+
<ToolNumber>ATML3074061800002074</ToolNumber>
56+
<ToolName>EDBG</ToolName>
57+
</com_atmel_avrdbg_tool_edbg>
58+
<avrtoolinterfaceclock>500000</avrtoolinterfaceclock>
59+
</PropertyGroup>
60+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
61+
<ToolchainSettings>
62+
<AvrGcc>
63+
<avrgcc.common.Device>-mmcu=atmega4809 -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.5.362\gcc\dev\atmega4809"</avrgcc.common.Device>
64+
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
65+
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
66+
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
67+
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
68+
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
69+
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
70+
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
71+
<avrgcc.compiler.symbols.DefSymbols>
72+
<ListValues>
73+
<Value>NDEBUG</Value>
74+
</ListValues>
75+
</avrgcc.compiler.symbols.DefSymbols>
76+
<avrgcc.compiler.directories.IncludePaths>
77+
<ListValues>
78+
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.5.362\include\</Value>
79+
</ListValues>
80+
</avrgcc.compiler.directories.IncludePaths>
81+
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
82+
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
83+
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
84+
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
85+
<avrgcc.linker.libraries.Libraries>
86+
<ListValues>
87+
<Value>libm</Value>
88+
</ListValues>
89+
</avrgcc.linker.libraries.Libraries>
90+
<avrgcc.assembler.general.IncludePaths>
91+
<ListValues>
92+
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.5.362\include\</Value>
93+
</ListValues>
94+
</avrgcc.assembler.general.IncludePaths>
95+
</AvrGcc>
96+
</ToolchainSettings>
97+
</PropertyGroup>
98+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
99+
<ToolchainSettings>
100+
<AvrGcc>
101+
<avrgcc.common.Device>-mmcu=atmega4809 -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.5.362\gcc\dev\atmega4809"</avrgcc.common.Device>
102+
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
103+
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
104+
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
105+
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
106+
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
107+
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
108+
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
109+
<avrgcc.compiler.symbols.DefSymbols>
110+
<ListValues>
111+
<Value>DEBUG</Value>
112+
</ListValues>
113+
</avrgcc.compiler.symbols.DefSymbols>
114+
<avrgcc.compiler.directories.IncludePaths>
115+
<ListValues>
116+
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.5.362\include\</Value>
117+
</ListValues>
118+
</avrgcc.compiler.directories.IncludePaths>
119+
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
120+
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
121+
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
122+
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
123+
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
124+
<avrgcc.linker.libraries.Libraries>
125+
<ListValues>
126+
<Value>libm</Value>
127+
</ListValues>
128+
</avrgcc.linker.libraries.Libraries>
129+
<avrgcc.assembler.general.IncludePaths>
130+
<ListValues>
131+
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.5.362\include\</Value>
132+
</ListValues>
133+
</avrgcc.assembler.general.IncludePaths>
134+
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
135+
</AvrGcc>
136+
</ToolchainSettings>
137+
</PropertyGroup>
138+
<ItemGroup>
139+
<Compile Include="main.c">
140+
<SubType>compile</SubType>
141+
</Compile>
142+
</ItemGroup>
143+
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
144+
</Project>

One_Wire_Mode/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!-- Please do not change this logo with link -->
2+
[![MCHP](../images/microchip.png)](https://www.microchip.com)
3+
4+
# One Wire Mode
5+
6+
This program shows how to configure the Universal Synchronous and Asynchronous Receiver and Transmitter (USART) in one wire mode. In this mode the Receive (RX) and Transmit (TX) functions use the same pin and the communication becomes half duplex. All the transmitted characters loop-back to the receive buffer and can be compared to check for bus conflicts.
7+
The applications sends the string 'Microchip.\r\n' every 500 ms through the pin used for both RX and TX.
8+
9+
10+
## Related Documentation
11+
More details and code examples on the ATMEGA4809 can be found at the following links:
12+
- [TB3216-Getting Started with USART](https://ww1.microchip.com/downloads/en/Appnotes/TB3216-Getting-Started-with-USART-90003216B.pdf)
13+
- [ATMEGA4809 Product Page](https://www.microchip.com/wwwproducts/en/ATMEGA4809)
14+
- [ATMEGA4809 Code Examples on GitHub](https://github.com/microchip-pic-avr-examples?q=atmega4809)
15+
- [ATMEGA4809 Project Examples in START](https://start.atmel.com/#examples/ATMEGA4809XplainedPro)
16+
17+
## Software Used
18+
- Microchip Studio 7.0.2397 or newer [(microchip.com/mplab/microchip-studio)](https://www.microchip.com/mplab/microchip-studio)
19+
- ATmega_DFP 1.5.362 or newer Device Pack
20+
21+
## Hardware Used
22+
- ATMEGA4809 Xplained Pro [(ATMEGA4809-XPRO)](https://www.microchip.com/developmenttools/ProductDetails/ATMEGA4809-XPRO)
23+
24+
## Setup
25+
The ATMEGA4809 Xplained Pro Development Board is used as test platform.
26+
27+
<br><img src="../images/atmega4809_xplainedpro.jpg" height="300">
28+
29+
The following configurations must be made for this project:
30+
31+
- System clock configured for 3.33 MHz
32+
- Global interrupts enabled
33+
34+
Initialize the USART1 instance with the following configurations:
35+
- 9600 baud rate
36+
- 8 data bits
37+
- no parity bit
38+
- 1 stop bit
39+
- Loop back mode enabled
40+
- RX and TX enabled
41+
- Receive Interrupt enabled
42+
43+
|Pin | Configuration |
44+
| :---------------------: | :-------------------------------------------------: |
45+
| PC0 | RX/TX - digital input (initial configuration) |
46+
47+
Note: The pin PC0 is configured as output when the microcontroller transmits messages, but it is configured as input in all the other cases.
48+
49+
## Operation
50+
1. Connect the board to the PC.
51+
52+
2. Open the **atmega4809-getting-started-with-usart-studio.atsln** solution in Microchip Studio.
53+
54+
3. Set the **One_Wire_Mode** project as Start Up project. Right click on the project in the **Solution Explorer** tab and click **Set as StartUp Project**.
55+
56+
<br><img src="../images/Start_Up_Project.PNG" height="500">
57+
58+
4. Build the **One_Wire_Mode** project: right click on the **atmega4809-getting-started-with-usart-studio** solution and select Build Solution.
59+
60+
<br><img src="../images/Build_Solution.PNG" height="500">
61+
62+
5. Select the ATMEGA4809 Xplained Pro in the Connected Hardware Tool section of the project settings:
63+
- Right click on the project and click **Properties**;
64+
- Click on the **Tool** tab.
65+
- Select the ATMEGA4809 Xplained Pro (click on the **SN**) in the **Selected debugger/programmer** section, and save (CTRL + S):
66+
67+
<br><img src="../images/Select_Tool.PNG" height="500">
68+
69+
6. Program the project to the board. Then, click on the **Debug** tab and click Start Debugging and Break.
70+
71+
<br><img src="images/StartDebugandBreak.png" height="300">
72+
73+
7. Enable two breakpoints, as presented in the image below, and click Continue.
74+
75+
<br><img src="images/breakpoints.png" height="235">
76+
77+
## Demo
78+
79+
When sending characters, the received one works as an acknowledgement. If the received character is the same with the sent one, the transmission is successfull.
80+
<br><img src="images/demo1.png" width="500">
81+
82+
This image shows the string received in a terminal software.
83+
84+
<br><img src="images/string_microchip.PNG" width="500">
85+
86+
87+
## Summary
88+
89+
This project shows how to use the USART peripheral in One-Wire mode, in which both the transmitting and the receiving will be implemented using the same pin.
37.7 KB
Loading

One_Wire_Mode/images/breakpoints.png

22.6 KB
Loading

One_Wire_Mode/images/demo1.png

23.1 KB
Loading
28.9 KB
Loading

0 commit comments

Comments
 (0)