kopia lustrzana https://github.com/sq2ips/m20-custom-firmware
Added NTC external temperature sensor support
rodzic
f87eabdcd2
commit
1651f03614
|
@ -17,7 +17,7 @@
|
|||
#define QRG_FSK4 435100000 // Frequency fo horus modulation (in Hz)
|
||||
|
||||
#define PA_FSK4 10 // RF power setting for horus transmission values 0-63
|
||||
#define RF_BOOST_ACTIVE 0 // RF booster enabled for transmissions about 15dB gain, but more power consumed - normally should be ON(1).
|
||||
#define RF_BOOST_ACTIVE 1 // RF booster enabled for transmissions about 15dB gain, but more power consumed - normally should be ON(1).
|
||||
|
||||
#define ADF_FREQ_CORRECTION 19 // correction of frequency from crystal inaccuracy in 270Hz steps. To be individually set for each sonde.
|
||||
|
||||
|
@ -36,6 +36,11 @@
|
|||
#define SCRAMBLER
|
||||
/*-----------------------*/
|
||||
|
||||
/* NTC settings */
|
||||
#define NTC_GPIO_Port NTC_36K_GPIO_Port // resistor select
|
||||
#define NTC_Pin NTC_36K_Pin
|
||||
/*--------------*/
|
||||
|
||||
/* GPS configuration */
|
||||
#define AscentRateTime 10 // Time of ascent rate mesure
|
||||
|
||||
|
|
|
@ -84,6 +84,8 @@ void main_loop(void);
|
|||
#define LED_GPIO_Port GPIOC
|
||||
#define LPS_CS_Pin LL_GPIO_PIN_4
|
||||
#define LPS_CS_GPIO_Port GPIOA
|
||||
#define NTC_ADC_Pin LL_GPIO_PIN_4
|
||||
#define NTC_ADC_GPIO_Port GPIOC
|
||||
#define BAT_ADC_Pin LL_GPIO_PIN_0
|
||||
#define BAT_ADC_GPIO_Port GPIOB
|
||||
#define RF_Boost_Pin LL_GPIO_PIN_12
|
||||
|
@ -104,6 +106,14 @@ void main_loop(void);
|
|||
#define POWER_ON_GPIO_Port GPIOA
|
||||
#define ADF_CE_Pin LL_GPIO_PIN_3
|
||||
#define ADF_CE_GPIO_Port GPIOB
|
||||
#define NTC_475K_Pin LL_GPIO_PIN_4
|
||||
#define NTC_475K_GPIO_Port GPIOB
|
||||
#define NTC_36K_Pin LL_GPIO_PIN_5
|
||||
#define NTC_36K_GPIO_Port GPIOB
|
||||
#define NTC_12K_Pin LL_GPIO_PIN_6
|
||||
#define NTC_12K_GPIO_Port GPIOB
|
||||
#define NTC_330K_Pin LL_GPIO_PIN_9
|
||||
#define NTC_330K_GPIO_Port GPIOB
|
||||
#ifndef NVIC_PRIORITYGROUP_0
|
||||
#define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bit for pre-emption priority,
|
||||
4 bits for subpriority */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* horus.c
|
||||
* Based onhttps://github.com/whallmann/RS41HUP_V2/blob/master/horus_l2.c
|
||||
* Based on https://github.com/whallmann/RS41HUP_V2/blob/master/horus_l2.c
|
||||
* Adapted by SQ2IPS
|
||||
*/
|
||||
|
||||
|
@ -60,7 +60,6 @@ void interleave(unsigned char *inout, int nbytes, int dir)
|
|||
nearest prime to nbits. It also uses storage, is run on every call,
|
||||
and has an upper limit. Oh Well, still seems to interleave OK. */
|
||||
i = 1;
|
||||
uint16_t imax = sizeof(primes)/sizeof(uint16_t);
|
||||
while ((primes[i] < nbits) && (i < 77))
|
||||
i++;
|
||||
b = primes[i-1];
|
||||
|
|
1903
m20/Core/Src/main.c
1903
m20/Core/Src/main.c
Plik diff jest za duży
Load Diff
|
@ -1,5 +1,5 @@
|
|||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [4.5.0-RC5] date: [Tue Feb 25 13:01:11 CET 2025]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [4.5.0-RC5] date: [Wed Mar 05 19:56:45 CET 2025]
|
||||
##########################################################################################################################
|
||||
|
||||
# ------------------------------------------------
|
||||
|
|
77
m20/m20.ioc
77
m20/m20.ioc
|
@ -1,4 +1,7 @@
|
|||
#MicroXplorer Configuration settings - do not modify
|
||||
ADC.ContinuousConvMode=DISABLE
|
||||
ADC.IPParameters=ContinuousConvMode,Overrun
|
||||
ADC.Overrun=ADC_OVR_DATA_OVERWRITTEN
|
||||
CAD.formats=[]
|
||||
CAD.pinconfig=Dual
|
||||
CAD.provider=
|
||||
|
@ -31,32 +34,37 @@ Mcu.Name=STM32L051R(6-8)Tx
|
|||
Mcu.Package=LQFP64
|
||||
Mcu.Pin0=PC13
|
||||
Mcu.Pin1=PC14-OSC32_IN
|
||||
Mcu.Pin10=PB13
|
||||
Mcu.Pin11=PB14
|
||||
Mcu.Pin12=PB15
|
||||
Mcu.Pin13=PC7
|
||||
Mcu.Pin14=PC8
|
||||
Mcu.Pin15=PC9
|
||||
Mcu.Pin16=PA8
|
||||
Mcu.Pin17=PA9
|
||||
Mcu.Pin18=PA10
|
||||
Mcu.Pin19=PA12
|
||||
Mcu.Pin10=PB12
|
||||
Mcu.Pin11=PB13
|
||||
Mcu.Pin12=PB14
|
||||
Mcu.Pin13=PB15
|
||||
Mcu.Pin14=PC7
|
||||
Mcu.Pin15=PC8
|
||||
Mcu.Pin16=PC9
|
||||
Mcu.Pin17=PA8
|
||||
Mcu.Pin18=PA9
|
||||
Mcu.Pin19=PA10
|
||||
Mcu.Pin2=PH0-OSC_IN
|
||||
Mcu.Pin20=PC10
|
||||
Mcu.Pin21=PC11
|
||||
Mcu.Pin22=PB3
|
||||
Mcu.Pin23=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin24=VP_SYS_VS_Systick
|
||||
Mcu.Pin25=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin26=VP_TIM22_VS_ClockSourceINT
|
||||
Mcu.Pin20=PA12
|
||||
Mcu.Pin21=PC10
|
||||
Mcu.Pin22=PC11
|
||||
Mcu.Pin23=PB3
|
||||
Mcu.Pin24=PB4
|
||||
Mcu.Pin25=PB5
|
||||
Mcu.Pin26=PB6
|
||||
Mcu.Pin27=PB9
|
||||
Mcu.Pin28=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin29=VP_SYS_VS_Systick
|
||||
Mcu.Pin3=PH1-OSC_OUT
|
||||
Mcu.Pin30=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin31=VP_TIM22_VS_ClockSourceINT
|
||||
Mcu.Pin4=PA4
|
||||
Mcu.Pin5=PA5
|
||||
Mcu.Pin6=PA6
|
||||
Mcu.Pin7=PA7
|
||||
Mcu.Pin8=PB0
|
||||
Mcu.Pin9=PB12
|
||||
Mcu.PinsNb=27
|
||||
Mcu.Pin8=PC4
|
||||
Mcu.Pin9=PB0
|
||||
Mcu.PinsNb=32
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32L051R6Tx
|
||||
|
@ -124,6 +132,30 @@ PB3.GPIOParameters=GPIO_Label
|
|||
PB3.GPIO_Label=ADF_CE
|
||||
PB3.Locked=true
|
||||
PB3.Signal=GPIO_Output
|
||||
PB4.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PB4.GPIO_Label=NTC_475K
|
||||
PB4.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||
PB4.GPIO_PuPd=GPIO_NOPULL
|
||||
PB4.Locked=true
|
||||
PB4.Signal=GPIO_Output
|
||||
PB5.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PB5.GPIO_Label=NTC_36K
|
||||
PB5.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||
PB5.GPIO_PuPd=GPIO_NOPULL
|
||||
PB5.Locked=true
|
||||
PB5.Signal=GPIO_Output
|
||||
PB6.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PB6.GPIO_Label=NTC_12K
|
||||
PB6.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||
PB6.GPIO_PuPd=GPIO_NOPULL
|
||||
PB6.Locked=true
|
||||
PB6.Signal=GPIO_Output
|
||||
PB9.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||
PB9.GPIO_Label=NTC_330K
|
||||
PB9.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||
PB9.GPIO_PuPd=GPIO_NOPULL
|
||||
PB9.Locked=true
|
||||
PB9.Signal=GPIO_Output
|
||||
PC10.Locked=true
|
||||
PC10.Mode=Asynchronous
|
||||
PC10.Signal=LPUART1_TX
|
||||
|
@ -138,6 +170,11 @@ PC14-OSC32_IN.GPIOParameters=GPIO_Label
|
|||
PC14-OSC32_IN.GPIO_Label=LED
|
||||
PC14-OSC32_IN.Locked=true
|
||||
PC14-OSC32_IN.Signal=GPIO_Output
|
||||
PC4.GPIOParameters=GPIO_Label
|
||||
PC4.GPIO_Label=NTC_ADC
|
||||
PC4.Locked=true
|
||||
PC4.Mode=IN14
|
||||
PC4.Signal=ADC_IN14
|
||||
PC7.GPIOParameters=GPIO_Label
|
||||
PC7.GPIO_Label=ADF_CLK
|
||||
PC7.Locked=true
|
||||
|
|
Ładowanie…
Reference in New Issue