Skip to content

Commit

Permalink
update: increase adc sampling time to 20us
Browse files Browse the repository at this point in the history
  • Loading branch information
luftaquila committed Jul 29, 2024
1 parent e233565 commit 42eec4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion device/firmware/Core/Src/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void MX_ADC1_Init(void)
*/
sConfig.Channel = ADC_CHANNEL_VREFINT;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_7CYCLES_5;
sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
Expand Down Expand Up @@ -96,6 +96,7 @@ void MX_ADC1_Init(void)
*/
sConfig.Channel = ADC_CHANNEL_TEMPSENSOR;
sConfig.Rank = ADC_REGULAR_RANK_5;
sConfig.SamplingTime = ADC_SAMPLETIME_55CYCLES_5;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
Expand Down
2 changes: 1 addition & 1 deletion device/firmware/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Tue Jul 30 00:42:25 KST 2024]
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Tue Jul 30 02:11:00 KST 2024]
##########################################################################################################################

# ------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions device/firmware/firmware.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ ADC1.Rank-2\#ChannelRegularConversion=2
ADC1.Rank-3\#ChannelRegularConversion=3
ADC1.Rank-4\#ChannelRegularConversion=4
ADC1.Rank-5\#ChannelRegularConversion=5
ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_7CYCLES_5
ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_7CYCLES_5
ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_7CYCLES_5
ADC1.SamplingTime-4\#ChannelRegularConversion=ADC_SAMPLETIME_7CYCLES_5
ADC1.SamplingTime-5\#ChannelRegularConversion=ADC_SAMPLETIME_7CYCLES_5
ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_239CYCLES_5
ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_239CYCLES_5
ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_239CYCLES_5
ADC1.SamplingTime-4\#ChannelRegularConversion=ADC_SAMPLETIME_239CYCLES_5
ADC1.SamplingTime-5\#ChannelRegularConversion=ADC_SAMPLETIME_55CYCLES_5
ADC1.master=1
CAD.formats=
CAD.pinconfig=
Expand Down

0 comments on commit 42eec4b

Please sign in to comment.