Skip to content

Commit 8a27e05

Browse files
committed
2 parents d4dab00 + 1b1b1c4 commit 8a27e05

File tree

5 files changed

+37
-26
lines changed

5 files changed

+37
-26
lines changed

PrimaryConverter/Firmware/Atmel/2020_srw_rc_car_primary/2020_srw_rc_car_primary.componentinfo.xml

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,57 @@
99
<CSub></CSub>
1010
<CVariant></CVariant>
1111
<CVendor>Atmel</CVendor>
12-
<CVersion>1.3.0</CVersion>
12+
<CVersion>1.6.0</CVersion>
1313
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
1414
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
1515
<Description></Description>
1616
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
1717
<d4p1:anyType i:type="FileInfo">
18-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\include</AbsolutePath>
18+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\</AbsolutePath>
1919
<Attribute></Attribute>
2020
<Category>include</Category>
2121
<Condition>C</Condition>
2222
<FileContentHash i:nil="true" />
2323
<FileVersion></FileVersion>
24-
<Name>include</Name>
24+
<Name>include/</Name>
2525
<SelectString></SelectString>
2626
<SourcePath></SourcePath>
2727
</d4p1:anyType>
2828
<d4p1:anyType i:type="FileInfo">
29-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\include\avr\iom328pb.h</AbsolutePath>
29+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\avr\iom328pb.h</AbsolutePath>
3030
<Attribute></Attribute>
3131
<Category>header</Category>
3232
<Condition>C</Condition>
33-
<FileContentHash>03gcldixSQsoDiJDaJRoYA==</FileContentHash>
33+
<FileContentHash>G+eVwKFAkNNs30Jr6aGylg==</FileContentHash>
3434
<FileVersion></FileVersion>
3535
<Name>include/avr/iom328pb.h</Name>
3636
<SelectString></SelectString>
3737
<SourcePath></SourcePath>
3838
</d4p1:anyType>
3939
<d4p1:anyType i:type="FileInfo">
40-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\templates\main.c</AbsolutePath>
40+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.c</AbsolutePath>
4141
<Attribute>template</Attribute>
4242
<Category>source</Category>
4343
<Condition>C Exe</Condition>
44-
<FileContentHash>GD1k8YYhulqRs6FD1B2Hog==</FileContentHash>
44+
<FileContentHash>KjvOcFWd++tbnsEMfVPd/w==</FileContentHash>
4545
<FileVersion></FileVersion>
4646
<Name>templates/main.c</Name>
4747
<SelectString>Main file (.c)</SelectString>
4848
<SourcePath></SourcePath>
4949
</d4p1:anyType>
5050
<d4p1:anyType i:type="FileInfo">
51-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\templates\main.cpp</AbsolutePath>
51+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.cpp</AbsolutePath>
5252
<Attribute>template</Attribute>
5353
<Category>source</Category>
5454
<Condition>C Exe</Condition>
55-
<FileContentHash>YXFphlh0CtZJU+ebktABgQ==</FileContentHash>
55+
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</FileContentHash>
5656
<FileVersion></FileVersion>
5757
<Name>templates/main.cpp</Name>
5858
<SelectString>Main file (.cpp)</SelectString>
5959
<SourcePath></SourcePath>
6060
</d4p1:anyType>
6161
<d4p1:anyType i:type="FileInfo">
62-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328pb</AbsolutePath>
62+
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega328pb</AbsolutePath>
6363
<Attribute></Attribute>
6464
<Category>libraryPrefix</Category>
6565
<Condition>GCC</Condition>
@@ -71,8 +71,8 @@
7171
</d4p1:anyType>
7272
</Files>
7373
<PackName>ATmega_DFP</PackName>
74-
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.3.300/Atmel.ATmega_DFP.pdsc</PackPath>
75-
<PackVersion>1.3.300</PackVersion>
74+
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/Atmel.ATmega_DFP.pdsc</PackPath>
75+
<PackVersion>1.6.364</PackVersion>
7676
<PresentInProject>true</PresentInProject>
7777
<ReferenceConditionId>ATmega328PB</ReferenceConditionId>
7878
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">

PrimaryConverter/Firmware/Atmel/2020_srw_rc_car_primary/2020_srw_rc_car_primary.cproj

+21-10
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
</dependencies>
4141
</framework-data>
4242
</AsfFrameworkConfig>
43-
<avrtool>com.atmel.avrdbg.tool.medbg</avrtool>
44-
<avrtoolserialnumber>ATML2523052700001642</avrtoolserialnumber>
43+
<avrtool>com.atmel.avrdbg.tool.ispmk2</avrtool>
44+
<avrtoolserialnumber>000200122158</avrtoolserialnumber>
4545
<avrdeviceexpectedsignature>0x1E9516</avrdeviceexpectedsignature>
4646
<com_atmel_avrdbg_tool_medbg>
4747
<ToolOptions>
@@ -65,23 +65,34 @@
6565
</ToolNumber>
6666
<ToolName xmlns="">Simulator</ToolName>
6767
</com_atmel_avrdbg_tool_simulator>
68-
<avrtoolinterfaceclock>0</avrtoolinterfaceclock>
68+
<avrtoolinterfaceclock>125000</avrtoolinterfaceclock>
6969
<com_atmel_avrdbg_tool_ispmk2>
7070
<ToolOptions>
7171
<InterfaceProperties>
72-
<IspClock>0</IspClock>
72+
<IspClock>125000</IspClock>
7373
</InterfaceProperties>
7474
<InterfaceName>ISP</InterfaceName>
7575
</ToolOptions>
7676
<ToolType>com.atmel.avrdbg.tool.ispmk2</ToolType>
7777
<ToolNumber>000200122158</ToolNumber>
7878
<ToolName>AVRISP mkII</ToolName>
7979
</com_atmel_avrdbg_tool_ispmk2>
80+
<custom>
81+
<ToolOptions xmlns="">
82+
<InterfaceProperties>
83+
</InterfaceProperties>
84+
<InterfaceName>ISP</InterfaceName>
85+
</ToolOptions>
86+
<ToolType xmlns="">custom</ToolType>
87+
<ToolNumber xmlns="">
88+
</ToolNumber>
89+
<ToolName xmlns="">Custom Programming Tool</ToolName>
90+
</custom>
8091
</PropertyGroup>
8192
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
8293
<ToolchainSettings>
8394
<AvrGcc>
84-
<avrgcc.common.Device>-mmcu=atmega328pb -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328pb"</avrgcc.common.Device>
95+
<avrgcc.common.Device>-mmcu=atmega328pb -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega328pb"</avrgcc.common.Device>
8596
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
8697
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
8798
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
@@ -96,7 +107,7 @@
96107
</avrgcc.compiler.symbols.DefSymbols>
97108
<avrgcc.compiler.directories.IncludePaths>
98109
<ListValues>
99-
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.3.300\include</Value>
110+
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
100111
</ListValues>
101112
</avrgcc.compiler.directories.IncludePaths>
102113
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
@@ -110,7 +121,7 @@
110121
</avrgcc.linker.libraries.Libraries>
111122
<avrgcc.assembler.general.IncludePaths>
112123
<ListValues>
113-
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.3.300\include</Value>
124+
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
114125
</ListValues>
115126
</avrgcc.assembler.general.IncludePaths>
116127
</AvrGcc>
@@ -119,7 +130,7 @@
119130
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
120131
<ToolchainSettings>
121132
<AvrGcc>
122-
<avrgcc.common.Device>-mmcu=atmega328pb -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328pb"</avrgcc.common.Device>
133+
<avrgcc.common.Device>-mmcu=atmega328pb -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega328pb"</avrgcc.common.Device>
123134
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
124135
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
125136
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
@@ -134,7 +145,7 @@
134145
</avrgcc.compiler.symbols.DefSymbols>
135146
<avrgcc.compiler.directories.IncludePaths>
136147
<ListValues>
137-
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.3.300\include</Value>
148+
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
138149
</ListValues>
139150
</avrgcc.compiler.directories.IncludePaths>
140151
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
@@ -149,7 +160,7 @@
149160
</avrgcc.linker.libraries.Libraries>
150161
<avrgcc.assembler.general.IncludePaths>
151162
<ListValues>
152-
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.3.300\include</Value>
163+
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
153164
</ListValues>
154165
</avrgcc.assembler.general.IncludePaths>
155166
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>

PrimaryConverter/Firmware/Atmel/2020_srw_rc_car_primary/adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ uint16_t adc_read(uint8_t channel) {
135135
void adc_convert_all() {
136136
for (uint8_t i = 0; i < SAMPLING_SIZE; i++) {
137137
adc_voltage_conv[i] = (((uint32_t)adc_voltage[i] * V_ref) / A_int) * V_GAIN;
138-
adc_current_conv[i] = ((uint32_t)adc_current[i] * V_ref) / A_int;
138+
adc_current_conv[i] = (((uint32_t)adc_current[i] * V_ref) / A_int) * C_GAIN;
139139
adc_temp1_conv[i] = ((3500 - (int32_t)(((uint32_t)adc_temp1[i] * V_ref) / A_int)) / 22);
140140
adc_temp2_conv[i] = ((3500 - (int32_t)(((uint32_t)adc_temp2[i] * V_ref) / A_int)) / 22);
141141
adc_temp3_conv[i] = ((3500 - (int32_t)(((uint32_t)adc_temp3[i] * V_ref) / A_int)) / 22);

PrimaryConverter/Firmware/Atmel/2020_srw_rc_car_primary/adc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
//threshold values for protection -> trigger halt ***UPDATE FOR FINAL IMPLEMENTATION***
1212
#define rated_V 721 //~60V
13-
#define rated_C 1023 //for testing only
13+
#define rated_C 125 //~2A
1414
#define rated_T1 550 //~78deg
1515
#define rated_T2 550 //~78deg
1616
#define rated_T3 550 //~78deg
1717

1818
#define V_GAIN (28500 / 1100)
19-
#define C_GAIN
19+
#define C_GAIN 5
2020

2121
#define ADC_used 5 //number of adc channels in use
2222

PrimaryConverter/Firmware/Atmel/2020_srw_rc_car_primary/usart0.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void usart0_transmit_data()
8888
sprintf(buffer_temp1, "TEMP1: %ld deg\n\r", adc_get_avg_temp1());
8989
sprintf(buffer_temp2, "TEMP2: %ld deg\n\r", adc_get_avg_temp2());
9090
sprintf(buffer_temp3, "TEMP3: %ld deg\n\r", adc_get_avg_temp3());
91-
sprintf(buffer_isens, "ISENS: %ld mV\n\r", adc_get_avg_current());
91+
sprintf(buffer_isens, "ISENS: %ld mA\n\r", adc_get_avg_current());
9292
sprintf(buffer_vsens, "VSENS: %ld mV\n\r\n\r", adc_get_avg_voltage());
9393

9494
usart0_transmit_string("ADC_DATA\n\r--------\n\r");

0 commit comments

Comments
 (0)