add ADC/DAC and PWM

This commit is contained in:
Edward Emelianov 2025-10-06 23:27:30 +03:00
parent 17b4d714e0
commit 24ddc7e1a6
16 changed files with 477 additions and 932 deletions

View File

@ -1,897 +1,8 @@
212010875057830
Package_TO_SOT_SMD
ATPAK-2
ATPAK SMD package, http://www.onsemi.com/pub/Collateral/ENA2192-D.PDF
ATPAK
0
7
3
Package_TO_SOT_SMD
Analog_KS-4
Analog Devices KS-4, http://www.analog.com/media/en/package-pcb-resources/package/pkg_pdf/sc70ks/ks_4.pdf
Analog Devices KS-4 (like EIAJ SC-82)
0
4
4
Package_TO_SOT_SMD
Diodes_SOT-553
Diodes SOT-553, https://www.diodes.com/assets/Package-Files/SOT553.pdf
SOT-553
0
5
5
Package_TO_SOT_SMD
HVSOF5
HVSOF5, http://rohmfs.rohm.com/en/techdata_basic/ic/package/hvsof5_1-e.pdf, http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/hall/bu52001gul-e.pdf
HVSOF5
0
5
5
Package_TO_SOT_SMD
HVSOF6
HVSOF6, http://rohmfs.rohm.com/en/techdata_basic/ic/package/hvsof6_1-e.pdf, http://rohmfs.rohm.com/en/products/databook/datasheet/ic/audio_video/video_amplifier/bh76106hfv-e.pdf
HVSOF6
0
7
7
Package_TO_SOT_SMD
Infineon_PG-HDSOP-10-1
Infineon PG-HDSOP-10-1 (DDPAK), 20.96x6.5x2.3mm, slug up (https://www.infineon.com/cms/en/product/packages/PG-HDSOP/PG-HDSOP-10-1/)
hdsop 10 ddpak
0
10
10
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-1
HSOF-8-1 [TOLL] power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-1/)
mosfet hsof toll
0
53
3
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-1_ThermalVias
HSOF-8-1 [TOLL] power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-1/)
mosfet hsof toll thermal vias
0
96
3
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-2
HSOF-8-2 [TOLL] power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-2/)
mosfet hsof toll
0
12
4
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-2_ThermalVias
HSOF-8-2 [TOLL] power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-2/)
mosfet hsof toll thermal vias
0
97
4
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-2_ThermalVias2
HSOF-8-2 [TOLL] power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-2/, https://www.infineon.com/dgdl/Infineon-ApplicationNote_600V_CoolMOS_C7_Gold_TOLL-AN-v01_00-EN.pdf?fileId=5546d4625b10283a015b144a1af70df6)
mosfet hsof toll thermal vias
0
159
4
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-3
HSOF-8-3 power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-3/)
mosfet hsof
0
25
4
Package_TO_SOT_SMD
Infineon_PG-HSOF-8-3_ThermalVias
HSOF-8-3 power MOSFET (http://www.infineon.com/cms/en/product/packages/PG-HSOF/PG-HSOF-8-3/)
mosfet hsof
0
64
4
Package_TO_SOT_SMD
Infineon_PG-TO-220-7Lead_TabPin8
Infineon PG-TO-220-7, Tab as Pin 8, see e.g. https://www.infineon.com/dgdl/Infineon-BTS50055-1TMC-DS-v01_00-EN.pdf?fileId=5546d4625a888733015aa9b0007235e9
Infineon PG-TO-220-7
0
12
8
Package_TO_SOT_SMD
LFPAK33
LFPAK33 SOT-1210 https://assets.nexperia.com/documents/outline-drawing/SOT1210.pdf
LFPAK33 SOT-1210
0
17
5
Package_TO_SOT_SMD
LFPAK56
LFPAK56 https://assets.nexperia.com/documents/outline-drawing/SOT669.pdf
LFPAK56 SOT-669 Power-SO8
0
18
5
Package_TO_SOT_SMD
Nexperia_CFP15_SOT-1289
Nexperia CFP15 (SOT-1289), https://assets.nexperia.com/documents/outline-drawing/SOT1289.pdf
SOT-1289 CFP15
0
8
3
Package_TO_SOT_SMD
OnSemi_ECH8
On Semiconductor ECH8, https://www.onsemi.com/pub/Collateral/318BF.PDF
ECH8 SOT28-FL SOT-28-FL
0
8
8
Package_TO_SOT_SMD
PQFN_8x8
Low Profile 8x8mm PQFN, Dual Cool 88, https://www.onsemi.com/pub/Collateral/FDMT80080DC-D.pdf
pqfn vdfn mosfet
0
9
3
Package_TO_SOT_SMD
PowerMacro_M234_NoHole
TO-50-4 Power Macro Package Style M234
TO-50-4 Power Macro Package Style M234
0
4
4
Package_TO_SOT_SMD
PowerMacro_M234_WithHole
TO-50-4 Power Macro Package Style M234
TO-50-4 Power Macro Package Style M234
0
4
4
Package_TO_SOT_SMD
Rohm_HRP7
Rohm HRP7 SMD package, http://rohmfs.rohm.com/en/techdata_basic/ic/package/hrp7_1-e.pdf, http://rohmfs.rohm.com/en/products/databook/datasheet/ic/motor/dc/bd621x-e.pdf
Rohm HRP7 SMD
0
69
7
Package_TO_SOT_SMD
SC-59
SC-59, https://lib.chipdip.ru/images/import_diod/original/SOT-23_SC-59.jpg
SC-59
0
3
3
Package_TO_SOT_SMD
SC-59_Handsoldering
SC-59, hand-soldering varaint, https://lib.chipdip.ru/images/import_diod/original/SOT-23_SC-59.jpg
SC-59 hand-soldering
0
3
3
Package_TO_SOT_SMD
SC-70-8
SC70-8
SC70-8
0
8
8
Package_TO_SOT_SMD
SC-70-8_Handsoldering
SC70-8, Handsoldering
SC70-8 Handsoldering
0
8
8
Package_TO_SOT_SMD
SC-82AA
SC-82AA
SC-82AA
0
4
4
Package_TO_SOT_SMD
SC-82AA_Handsoldering
SC-82AA
SC-82AA
0
4
4
Package_TO_SOT_SMD
SC-82AB
SC-82AB
SC-82AB
0
4
4
Package_TO_SOT_SMD
SC-82AB_Handsoldering
SC-82AB
SC-82AB
0
4
4
Package_TO_SOT_SMD
SOT-23
SOT, 3 Pin (https://www.jedec.org/system/files/docs/to-236h.pdf variant AB), generated with kicad-footprint-generator ipc_gullwing_generator.py
SOT TO_SOT_SMD
0
3
3
Package_TO_SOT_SMD
SOT-23-5
SOT, 5 Pin (https://www.jedec.org/sites/default/files/docs/Mo-178c.PDF variant AA), generated with kicad-footprint-generator ipc_gullwing_generator.py
SOT TO_SOT_SMD
0
5
5
Package_TO_SOT_SMD
SOT-23-5_HandSoldering
5-pin SOT23 package
SOT-23-5 hand-soldering
0
5
5
Package_TO_SOT_SMD
SOT-23-6
SOT, 6 Pin (https://www.jedec.org/sites/default/files/docs/Mo-178c.PDF variant AB), generated with kicad-footprint-generator ipc_gullwing_generator.py
SOT TO_SOT_SMD
0
6
6
Package_TO_SOT_SMD
SOT-23-6_Handsoldering
6-pin SOT-23 package, Handsoldering
SOT-23-6 Handsoldering
0
6
6
Package_TO_SOT_SMD
SOT-23-8
SOT, 8 Pin (https://www.jedec.org/sites/default/files/docs/Mo-178c.PDF variant BA), generated with kicad-footprint-generator ipc_gullwing_generator.py
SOT TO_SOT_SMD
0
8
8
Package_TO_SOT_SMD
SOT-23-8_Handsoldering
8-pin SOT-23 package, Handsoldering, http://www.analog.com/media/en/package-pcb-resources/package/pkg_pdf/sot-23rj/rj_8.pdf
SOT-23-8 Handsoldering
0
8
8
Package_TO_SOT_SMD
SOT-23W
SOT-23W http://www.allegromicro.com/~/media/Files/Datasheets/A112x-Datasheet.ashx?la=en&hash=7BC461E058CC246E0BAB62433B2F1ECA104CA9D3
SOT-23W
0
3
3
Package_TO_SOT_SMD
SOT-23W_Handsoldering
SOT-23W http://www.allegromicro.com/~/media/Files/Datasheets/A112x-Datasheet.ashx?la=en&hash=7BC461E058CC246E0BAB62433B2F1ECA104CA9D3
SOT-23W for handsoldering
0
3
3
Package_TO_SOT_SMD
SOT-23_Handsoldering
SOT-23, Handsoldering
SOT-23
0
3
3
Package_TO_SOT_SMD
SOT-89-3
SOT-89-3, http://ww1.microchip.com/downloads/en/DeviceDoc/3L_SOT-89_MB_C04-029C.pdf
SOT-89-3
0
3
3
Package_TO_SOT_SMD
SOT-89-3_Handsoldering
SOT-89-3 Handsoldering
SOT-89-3 Handsoldering
0
3
3
Package_TO_SOT_SMD
SOT-89-5
SOT-89-5, http://www.e-devices.ricoh.co.jp/en/products/product_power/pkg/sot-89-5.pdf
SOT-89-5
0
5
5
Package_TO_SOT_SMD
SOT-89-5_Handsoldering
SOT-89-5, http://www.e-devices.ricoh.co.jp/en/products/product_power/pkg/sot-89-5.pdf
SOT-89-5
0
5
5
Package_TO_SOT_SMD
SOT-143
SOT-143 https://www.nxp.com/docs/en/package-information/SOT143B.pdf
SOT-143
0
4
4
Package_TO_SOT_SMD
SOT-143R
SOT-143R, reverse pinning, https://www.nxp.com/docs/en/package-information/SOT143R.pdf
SOT-143R Reverse
0
4
4
Package_TO_SOT_SMD
SOT-143R_Handsoldering
SOT-143R, reverse pinning, Handsoldering, https://www.nxp.com/docs/en/package-information/SOT143R.pdf
SOT-143 Reverse Handsoldering
0
4
4
Package_TO_SOT_SMD
SOT-143_Handsoldering
SOT-143 Handsoldering https://www.nxp.com/docs/en/package-information/SOT143B.pdf
SOT-143 Handsoldering
0
4
4
Package_TO_SOT_SMD
SOT-223
module CMS SOT223 4 pins
CMS SOT
0
4
4
Package_TO_SOT_SMD
SOT-223-3_TabPin2
module CMS SOT223 4 pins
CMS SOT
0
4
3
Package_TO_SOT_SMD
SOT-223-5
module CMS SOT223 5 pins, http://ww1.microchip.com/downloads/en/DeviceDoc/51751a.pdf
CMS SOT
0
5
5
Package_TO_SOT_SMD
SOT-223-6
module CMS SOT223 6 pins, http://www.ti.com/lit/ds/symlink/tps737.pdf
CMS SOT
0
6
6
Package_TO_SOT_SMD
SOT-223-6_TabPin3
module CMS SOT223 6 pins, http://www.ti.com/lit/ds/symlink/tps737.pdf
CMS SOT
0
6
5
Package_TO_SOT_SMD
SOT-223-8
module CMS SOT223 8 pins, https://www.diodes.com/assets/Datasheets/ZXSBMR16PT8.pdf
CMS SOT
0
8
8
Package_TO_SOT_SMD
SOT-323_SC-70
SOT-323, SC-70
SOT-323 SC-70
0
3
3
Package_TO_SOT_SMD
SOT-323_SC-70_Handsoldering
SOT-323, SC-70 Handsoldering
SOT-323 SC-70 Handsoldering
0
3
3
Package_TO_SOT_SMD
SOT-343_SC-70-4
SOT-343, SC-70-4
SOT-343 SC-70-4
0
4
4
Package_TO_SOT_SMD
SOT-343_SC-70-4_Handsoldering
SOT-343, SC-70-4, Handsoldering
SOT-343 SC-70-4 Handsoldering
0
4
4
Package_TO_SOT_SMD
SOT-353_SC-70-5
SOT-353, SC-70-5
SOT-353 SC-70-5
0
5
5
Package_TO_SOT_SMD
SOT-353_SC-70-5_Handsoldering
SOT-353, SC-70-5, Handsoldering
SOT-353 SC-70-5 Handsoldering
0
5
5
Package_TO_SOT_SMD
SOT-363_SC-70-6
SOT-363, SC-70-6
SOT-363 SC-70-6
0
6
6
Package_TO_SOT_SMD
SOT-363_SC-70-6_Handsoldering
SOT-363, SC-70-6, Handsoldering
SOT-363 SC-70-6 Handsoldering
0
6
6
Package_TO_SOT_SMD
SOT-383F
8-pin SOT-383F, http://www.mouser.com/ds/2/80/CPDVR085V0C-HF-RevB-10783.pdf
SOT-383F
0
9
9
Package_TO_SOT_SMD
SOT-383FL
8-pin SOT-383FL package, http://www.onsemi.com/pub_link/Collateral/ENA2267-D.PDF
SOT-383FL
0
8
8
Package_TO_SOT_SMD
SOT-416
SOT-416, https://www.nxp.com/docs/en/package-information/SOT416.pdf
SOT-416
0
3
3
Package_TO_SOT_SMD
SOT-523
SOT523, https://www.diodes.com/assets/Package-Files/SOT523.pdf
SOT-523
0
3
3
Package_TO_SOT_SMD
SOT-543
SOT-543 4 lead surface package
SOT-543 SC-107A EMD4
0
4
4
Package_TO_SOT_SMD
SOT-553
SOT553
SOT-553
0
5
5
Package_TO_SOT_SMD
SOT-563
SOT563
SOT-563
0
6
6
Package_TO_SOT_SMD
SOT-665
SOT665
SOT-665
0
5
5
Package_TO_SOT_SMD
SOT-666
SOT666
SOT-666
0
6
6
Package_TO_SOT_SMD
SOT-723
http://toshiba.semicon-storage.com/info/docget.jsp?did=5879&prodName=RN1104MFV
sot 723
0
3
3
Package_TO_SOT_SMD
SOT-883
SOT-883, https://assets.nexperia.com/documents/outline-drawing/SOT883.pdf
SOT-883
0
3
3
Package_TO_SOT_SMD
SOT-886
SOT-886
SOT-886
0
6
6
Package_TO_SOT_SMD
SOT-963
SOT 963 6 pins package 1x0.8mm pitch 0.35mm
SOT 963 6 pins package 1x0.8mm pitch 0.35mm
0
6
6
Package_TO_SOT_SMD
SOT-1123
SOT-1123 small outline transistor (see http://www.onsemi.com/pub/Collateral/NST3906F3-D.PDF)
SOT-1123 transistor
0
3
3
Package_TO_SOT_SMD
SOT-1333-1
SOT-1333-1
SOT-1333-1
0
9
9
Package_TO_SOT_SMD
SOT-1334-1
SOT-1334-1
SOT-1334-1
0
14
14
Package_TO_SOT_SMD
SuperSOT-3
3-pin SuperSOT package https://www.fairchildsemi.com/package-drawings/MA/MA03B.pdf
SuperSOT-3 SSOT-3
0
3
3
Package_TO_SOT_SMD
SuperSOT-6
6-pin SuperSOT package http://www.mouser.com/ds/2/149/FMB5551-889214.pdf
SuperSOT-6 SSOT-6
0
6
6
Package_TO_SOT_SMD
SuperSOT-8
8-pin SuperSOT package, http://www.icbank.com/icbank_data/semi_package/ssot8_dim.pdf
SuperSOT-8 SSOT-8
0
8
8
Package_TO_SOT_SMD
TDSON-8-1
Power MOSFET package, TDSON-8-1, 5.15x5.9mm (https://www.infineon.com/cms/en/product/packages/PG-TDSON/PG-TDSON-8-1/)
tdson
0
14
5
Package_TO_SOT_SMD
TO-50-3_LongPad-NoHole_Housing
TO-50-3 Macro T Package Style M236
TO-50-3 Macro T Package Style M236
0
3
3
Package_TO_SOT_SMD
TO-50-3_LongPad-WithHole_Housing
TO-50-3 Macro T Package Style M236
TO-50-3 Macro T Package Style M236
0
3
3
Package_TO_SOT_SMD
TO-50-3_ShortPad-NoHole_Housing
TO-50-3 Macro T Package Style M236
TO-50-3 Macro T Package Style M236
0
3
3
Package_TO_SOT_SMD
TO-50-3_ShortPad-WithHole_Housing
TO-50-3 Macro T Package Style M236
TO-50-3 Macro T Package Style M236
0
3
3
Package_TO_SOT_SMD
TO-50-4_LongPad-NoHole_Housing
TO-50-4 Macro X Package Style M238
TO-50-4 Macro X Package Style M238
0
4
4
Package_TO_SOT_SMD
TO-50-4_LongPad-WithHole_Housing
TO-50-4 Macro X Package Style M238
TO-50-4 Macro X Package Style M238
0
4
4
Package_TO_SOT_SMD
TO-50-4_ShortPad-NoHole_Housing
TO-50-4 Macro X Package Style M238
TO-50-4 Macro X Package Style M238
0
4
4
Package_TO_SOT_SMD
TO-50-4_ShortPad-WithHole_Housing
TO-50-4 Macro X Package Style M238
TO-50-4 Macro X Package Style M238
0
4
4
Package_TO_SOT_SMD
TO-252-2
TO-252 / DPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO252/PG-TO252-3-1/
DPAK TO-252 DPAK-3 TO-252-3 SOT-428
0
7
3
Package_TO_SOT_SMD
TO-252-2_TabPin1
TO-252-2, tab to pin 1 https://www.wolfspeed.com/media/downloads/87/CSD01060.pdf
TO-252-2 diode
0
7
2
Package_TO_SOT_SMD
TO-252-3_TabPin2
TO-252 / DPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO252/PG-TO252-3-1/
DPAK TO-252 DPAK-3 TO-252-3 SOT-428
0
8
3
Package_TO_SOT_SMD
TO-252-3_TabPin4
TO-252 / DPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO252/PG-TO252-3-1/
DPAK TO-252 DPAK-3 TO-252-3 SOT-428
0
8
4
Package_TO_SOT_SMD
TO-252-4
TO-252 / DPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO252/PG-TO252-5-11/
DPAK TO-252 DPAK-5 TO-252-5
0
9
5
Package_TO_SOT_SMD
TO-252-5_TabPin3
TO-252 / DPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO252/PG-TO252-5-11/
DPAK TO-252 DPAK-5 TO-252-5
0
10
5
Package_TO_SOT_SMD
TO-252-5_TabPin6
TO-252 / DPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO252/PG-TO252-5-11/
DPAK TO-252 DPAK-5 TO-252-5
0
10
6
Package_TO_SOT_SMD
TO-263-2
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-3-1/
D2PAK DDPAK TO-263 D2PAK-3 TO-263-3 SOT-404
0
7
3
Package_TO_SOT_SMD
TO-263-2_TabPin1
TO-263 / D2PAK / DDPAK SMD package, tab to pin 1, https://www.wolfspeed.com/media/downloads/137/C3D06060G.pdf
D2PAK DDPAK TO-263 D2PAK-3 TO-263-3 SOT-404 diode
0
7
2
Package_TO_SOT_SMD
TO-263-3_TabPin2
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-3-1/
D2PAK DDPAK TO-263 D2PAK-3 TO-263-3 SOT-404
0
8
3
Package_TO_SOT_SMD
TO-263-3_TabPin4
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-3-1/
D2PAK DDPAK TO-263 D2PAK-3 TO-263-3 SOT-404
0
8
4
Package_TO_SOT_SMD
TO-263-4
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-5-1/
D2PAK DDPAK TO-263 D2PAK-5 TO-263-5 SOT-426
0
9
5
Package_TO_SOT_SMD
TO-263-5_TabPin3
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-5-1/
D2PAK DDPAK TO-263 D2PAK-5 TO-263-5 SOT-426
0
10
5
Package_TO_SOT_SMD
TO-263-5_TabPin6
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-5-1/
D2PAK DDPAK TO-263 D2PAK-5 TO-263-5 SOT-426
0
10
6
Package_TO_SOT_SMD
TO-263-6
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-7-1/
D2PAK DDPAK TO-263 D2PAK-7 TO-263-7 SOT-427
0
11
7
Package_TO_SOT_SMD
TO-263-7_TabPin4
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-7-1/
D2PAK DDPAK TO-263 D2PAK-7 TO-263-7 SOT-427
0
12
7
Package_TO_SOT_SMD
TO-263-7_TabPin8
TO-263 / D2PAK / DDPAK SMD package, http://www.infineon.com/cms/en/product/packages/PG-TO263/PG-TO263-7-1/
D2PAK DDPAK TO-263 D2PAK-7 TO-263-7 SOT-427
0
12
8
Package_TO_SOT_SMD
TO-263-9_TabPin5
TO-263 / D2PAK / DDPAK SMD package, http://www.ti.com/lit/ds/symlink/lm4755.pdf
D2PAK DDPAK TO-263 D2PAK-9 TO-263-9
0
14
9
Package_TO_SOT_SMD
TO-263-9_TabPin10
TO-263 / D2PAK / DDPAK SMD package, http://www.ti.com/lit/ds/symlink/lm4755.pdf
D2PAK DDPAK TO-263 D2PAK-9 TO-263-9
0
14
10
Package_TO_SOT_SMD
TO-268-2
TO-268/D3PAK SMD package, http://www.icbank.com/icbank_data/semi_package/to268aa_dim.pdf
D3PAK TO-268 D3PAK-3 TO-268-3
0
7
3
Package_TO_SOT_SMD
TO-269AA
SMD package TO-269AA (e.g. diode bridge), see http://www.vishay.com/docs/88854/padlayouts.pdf
TO-269AA MBS diode bridge
0
4
4
Package_TO_SOT_SMD
TO-277A
Thermal enhanced ultra thin SMD package; 3 leads; body: 4.3x6.1x0.43mm, https://www.vishay.com/docs/95570/to-277asmpc.pdf
TO-277A SMPC
0
12
3
Package_TO_SOT_SMD
TO-277B
TO-227B https://media.digikey.com/pdf/Data%20Sheets/Littelfuse%20PDFs/DST2050S.pdf
TO-277B
0
9
3
Package_TO_SOT_SMD
TSOT-23
3-pin TSOT23 package, http://www.analog.com.tw/pdf/All_In_One.pdf
TSOT-23
0
3
3
Package_TO_SOT_SMD
TSOT-23-5
TSOT, 5 Pin (https://www.jedec.org/sites/default/files/docs/MO-193D.pdf variant AB), generated with kicad-footprint-generator ipc_gullwing_generator.py
TSOT TO_SOT_SMD
0
5
5
Package_TO_SOT_SMD
TSOT-23-5_HandSoldering
5-pin TSOT23 package, http://cds.linear.com/docs/en/packaging/SOT_5_05-08-1635.pdf
TSOT-23-5 Hand-soldering
0
5
5
Package_TO_SOT_SMD
TSOT-23-6
TSOT, 6 Pin (https://www.jedec.org/sites/default/files/docs/MO-193D.pdf variant AA), generated with kicad-footprint-generator ipc_gullwing_generator.py
TSOT TO_SOT_SMD
0
6
6
Package_TO_SOT_SMD
TSOT-23-6_HandSoldering
6-pin TSOT23 package, http://cds.linear.com/docs/en/packaging/SOT_6_05-08-1636.pdf
TSOT-23-6 MK06A TSOT-6 Hand-soldering
0
6
6
Package_TO_SOT_SMD
TSOT-23-8
TSOT, 8 Pin (https://www.jedec.org/sites/default/files/docs/MO-193D.pdf variant BA), generated with kicad-footprint-generator ipc_gullwing_generator.py
TSOT TO_SOT_SMD
0
8
8
Package_TO_SOT_SMD
TSOT-23-8_HandSoldering
8-pin TSOT23 package, http://cds.linear.com/docs/en/packaging/SOT_8_05-08-1637.pdf
TSOT-23-8 Hand-soldering
0
8
8
Package_TO_SOT_SMD
TSOT-23_HandSoldering
5-pin TSOT23 package, http://cds.linear.com/docs/en/packaging/SOT_5_05-08-1635.pdf
TSOT-23 Hand-soldering
0
3
3
Package_TO_SOT_SMD
Texas_DRT-3
Texas Instrument DRT-3 1x0.8mm Pitch 0.7mm http://www.ti.com/lit/ds/symlink/tpd2eusb30.pdf
DRT-3 1x0.8mm Pitch 0.7mm
0
3
3
Package_TO_SOT_SMD
Texas_NDQ
Texas Instruments, NDQ, 5 pin (https://www.ti.com/lit/ml/mmsf022/mmsf022.pdf)
ti pfm dap
0
6
6
Package_TO_SOT_SMD
Texas_NDY0011A
TO-PMOD-11 11-pin switching regulator package, http://www.ti.com/lit/ml/mmsf025/mmsf025.pdf
Texas TO-PMOD NDY00011A
0
12
12
Package_TO_SOT_SMD
Texas_R-PDSO-G6
R-PDSO-G6, http://www.ti.com/lit/ds/slis144b/slis144b.pdf
R-PDSO-G6 SC-70-6
0
6
6
Package_TO_SOT_SMD
VSOF5
VSOF5
VSOF5
0
5
5
Package_TO_SOT_SMD
Vishay_PowerPAK_SC70-6L_Dual
Vishay PowerPAK SC70 dual transistor package http://www.vishay.com/docs/70487/70487.pdf
powerpak sc70 sc-70 dual
0
8
6
Package_TO_SOT_SMD
Vishay_PowerPAK_SC70-6L_Single
Vishay PowerPAK SC70 single transistor package http://www.vishay.com/docs/70486/70486.pdf
powerpak sc70 sc-70
0
6
3
1672845343065
pins
Pin1.5x2mm
THT pad as test Point, diameter 2.0mm, hole diameter 1.0mm
test point THT pad
0
1
1

View File

@ -1,7 +1,7 @@
| Pin # | Pin name | function | settings | comment |
| --------- | ------------- | ------------ | ------------ | ------------ |
| 1 | VBAT | | | |
| 3 | PC13 | | | |
| 2 | PC13 | | | |
| 3 | PC14 | | | |
| 4 | PC15 | | | |
| 5 | OCS_IN | | | |

View File

@ -0,0 +1,50 @@
| Pin # | Pin name | function | settings | comment |
| --------- | ------------- | ------------ | ------------ | ------------ |
| 1 | VBAT | | | |
| 2 | PC13 | | | |
| 3 | PC14 | | | |
| 4 | PC15 | | | |
| 5 | OCS_IN | | | |
| 6 | OSC_OUT | | | |
| 7 | NRST | | | |
| 8 | VSSA | | | |
| 9 | VDDA | | | |
| 10 | PA0 | ADC1 IN1 | AIN | Text1 |
| 11 | PA1 | ADC1 IN2 | AIN | Text2 |
| 12 | PA2 | | | |
| 13 | PA3 | | | |
| 14 | PA4 | DAC OUT1 | AIN | int. heater |
| 15 | PA5 | ADC2 IN2 | AIN | DAC control |
| 16 | PA6 | PWM1 /TIM3.1 | AF2 | ext. heater |
| 17 | PA7 | PWM2 | AF2 | propto humid |
| 18 | PB0 | PWM3 | AF2 | propto Text |
| 19 | PB1 | PWM4 /TIM3.4 | AF2 | propto tsky |
| 20 | PB2 | SPI CS | PP | BME select |
| 21 | PB10 | | | |
| 22 | PB11 | | | |
| 23 | VSS1 | | | |
| 24 | VDD1 | | | |
| 25 | PB12 | | | |
| 26 | PB13 | | | |
| 27 | PB14 | | | |
| 28 | PB15 | | | |
| 29 | PA8 | | | |
| 30 | PA9 | USART1 TX | AF7 | USART for |
| 31 | PA10 | USART1 RX | AF7 | optical conn.|
| 32 | PA11 | USBDM | AF14 | |
| 33 | PA12 | USBDP | AF14 | |
| 34 | PA13 | SWDIO | AF0 | |
| 35 | VSS2 | | | |
| 36 | VDD2 | | | |
| 37 | PA14 | SWCLK | AF0 | |
| 38 | PA15 | USB PULLUP | PP | |
| 39 | PB3 | SPI SCK | AF5 | SPI for |
| 40 | PB4 | SPI MISO | AF5 | BME280 |
| 41 | PB5 | SPI MOSI | AF5 | sensor |
| 42 | PB6 | I2C SCL | AF4 | I2C for |
| 43 | PB7 | I2C SDA | AF4 | MLX90640 |
| 44 | BOOT0 | | | |
| 45 | PB8 | | | |
| 46 | PB9 | | | |
| 47 | VSS3 | | | |
| 48 | VDD3 | | | |

View File

@ -0,0 +1,157 @@
/*
* This file is part of the ir-allsky project.
* Copyright 2025 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "adc.h"
/**
* @brief ADCx_array - arrays for ADC channels with median filtering:
* ADC1:
* 0 - Ch0 - ADC1_IN1
* 1 - Ch1 - ADC1_IN2
* 2 - internal Tsens - ADC1_IN16
* 3 - Vref - ADC1_IN18
* ADC2:
* 4 - AIN5/DAC_OUT1 - PA4 - DAC1_OUT1 (onboard heater?), PA5 - ADC2_IN2 (DAC output control)
*/
static uint16_t ADC_array[NUMBER_OF_ADC_CHANNELS*9];
TRUE_INLINE void calADC(ADC_TypeDef *chnl){
// calibration
// enable voltage regulator
chnl->CR = 0;
chnl->CR = ADC_CR_ADVREGEN_0;
// wait for 10us
uint16_t ctr = 0;
while(++ctr < 1000){nop();}
// ADCALDIF=0 (single channels)
if((chnl->CR & ADC_CR_ADEN)){
chnl->CR |= ADC_CR_ADSTP;
chnl->CR |= ADC_CR_ADDIS;
}
chnl->CR |= ADC_CR_ADCAL;
while((chnl->CR & ADC_CR_ADCAL) != 0 && ++ctr < 0xfff0){};
chnl->CR = ADC_CR_ADVREGEN_0;
// enable ADC
ctr = 0;
do{
chnl->CR |= ADC_CR_ADEN;
}while((chnl->ISR & ADC_ISR_ADRDY) == 0 && ++ctr < 0xfff0);
}
TRUE_INLINE void enADC(ADC_TypeDef *chnl){
// ADEN->1, wait ADRDY
chnl->CR |= ADC_CR_ADEN;
uint16_t ctr = 0;
while(!(chnl->ISR & ADC_ISR_ADRDY) && ++ctr < 0xffff){}
chnl->CR |= ADC_CR_ADSTART; /* start the ADC conversions */
}
/**
* ADC1 - DMA1_ch1
* ADC2 - DMA2_ch1
*/
// Setup ADC and DAC
void adc_setup(){
RCC->AHBENR |= RCC_AHBENR_ADC12EN; // Enable clocking
ADC12_COMMON->CCR = ADC_CCR_TSEN | ADC_CCR_VREFEN | ADC_CCR_CKMODE; // enable Tsens and Vref, HCLK/4
calADC(ADC1);
calADC(ADC2);
// ADC1: channels 1,2,16,18; ADC2: channel 2
ADC1->SMPR1 = ADC_SMPR1_SMP0 | ADC_SMPR1_SMP1;
ADC1->SMPR2 = ADC_SMPR2_SMP15 | ADC_SMPR2_SMP17;
// 4 conversions in group: 1->2->16->18
ADC1->SQR1 = (1<<6) | (2<<12) | (16<<18) | (18<<24) | (NUMBER_OF_ADC1_CHANNELS-1);
ADC2->SMPR1 = ADC_SMPR1_SMP1;
ADC2->SQR1 = (2<<6) | (NUMBER_OF_ADC2_CHANNELS-1);
// configure DMA for ADC
RCC->AHBENR |= RCC_AHBENR_DMA1EN | RCC_AHBENR_DMA2EN;
ADC1->CFGR = ADC_CFGR_CONT | ADC_CFGR_DMAEN | ADC_CFGR_DMACFG;
ADC2->CFGR = ADC_CFGR_CONT | ADC_CFGR_DMAEN | ADC_CFGR_DMACFG;
DMA1_Channel1->CPAR = (uint32_t) (&(ADC1->DR));
DMA1_Channel1->CMAR = (uint32_t)(ADC_array);
DMA1_Channel1->CNDTR = NUMBER_OF_ADC1_CHANNELS * 9;
DMA1_Channel1->CCR |= DMA_CCR_MINC | DMA_CCR_MSIZE_0 | DMA_CCR_PSIZE_0 | DMA_CCR_CIRC;
DMA1_Channel1->CCR |= DMA_CCR_EN;
DMA2_Channel1->CPAR = (uint32_t) (&(ADC2->DR));
DMA2_Channel1->CMAR = (uint32_t)(&ADC_array[ADC2START]);
DMA2_Channel1->CNDTR = NUMBER_OF_ADC2_CHANNELS * 9;
DMA2_Channel1->CCR |= DMA_CCR_MINC | DMA_CCR_MSIZE_0 | DMA_CCR_PSIZE_0 | DMA_CCR_CIRC;
DMA2_Channel1->CCR |= DMA_CCR_EN;
enADC(ADC1);
enADC(ADC2);
// enable DAC
RCC->APB1ENR |= RCC_APB1ENR_DAC1EN;
// DAC simple throw out constant value: output buffer disable, DAC ch1 enable
DAC->CR = DAC_CR_BOFF1 | DAC_CR_EN1;
// starting value: 0
DAC1->DHR12R1 = 0;
}
/**
* @brief getADCval - calculate median value for `nch` channel
* @param nch - number of channel
* @return
*/
uint16_t getADCval(int nch){
register uint16_t temp;
#define PIX_SORT(a,b) { if ((a)>(b)) PIX_SWAP((a),(b)); }
#define PIX_SWAP(a,b) { temp=(a);(a)=(b);(b)=temp; }
uint16_t p[9];
int adval = (nch >= NUMBER_OF_ADC1_CHANNELS) ? NUMBER_OF_ADC2_CHANNELS : NUMBER_OF_ADC1_CHANNELS;
int addr = (nch >= NUMBER_OF_ADC1_CHANNELS) ? nch - NUMBER_OF_ADC2_CHANNELS + ADC2START: nch;
for(int i = 0; i < 9; ++i, addr += adval) // first we should prepare array for optmed
p[i] = ADC_array[addr];
PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ;
PIX_SORT(p[0], p[1]) ; PIX_SORT(p[3], p[4]) ; PIX_SORT(p[6], p[7]) ;
PIX_SORT(p[1], p[2]) ; PIX_SORT(p[4], p[5]) ; PIX_SORT(p[7], p[8]) ;
PIX_SORT(p[0], p[3]) ; PIX_SORT(p[5], p[8]) ; PIX_SORT(p[4], p[7]) ;
PIX_SORT(p[3], p[6]) ; PIX_SORT(p[1], p[4]) ; PIX_SORT(p[2], p[5]) ;
PIX_SORT(p[4], p[7]) ; PIX_SORT(p[4], p[2]) ; PIX_SORT(p[6], p[4]) ;
PIX_SORT(p[4], p[2]) ;
return p[4];
#undef PIX_SORT
#undef PIX_SWAP
}
// get voltage @input nch (V)
float getADCvoltage(int nch){
float v = getADCval(nch);
v *= getVdd();
v /= 4096.f; // 12bit ADC
return v;
}
// return MCU temperature (degrees of celsius)
float getMCUtemp(){
// make correction on Vdd value
int32_t ADval = getADCval(ADC_TS);
float temperature = (float) *TEMP30_CAL_ADDR - ADval;
temperature *= (110.f - 30.f);
temperature /= (float)(*TEMP30_CAL_ADDR - *TEMP110_CAL_ADDR);
temperature += 30.f;
return(temperature);
}
// return Vdd (V)
float getVdd(){
float vdd = ((float) *VREFINT_CAL_ADDR) * 3.3f; // 3.3V
vdd /= getADCval(ADC_VREF);
return vdd;
}

View File

@ -0,0 +1,40 @@
/*
* This file is part of the ir-allsky project.
* Copyright 2025 Edward V. Emelianov <edward.emelianoff@gmail.com>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stm32f3.h>
#define NUMBER_OF_ADC1_CHANNELS (4)
#define NUMBER_OF_ADC2_CHANNELS (1)
// total number of channels - for array
#define NUMBER_OF_ADC_CHANNELS ((NUMBER_OF_ADC1_CHANNELS+NUMBER_OF_ADC2_CHANNELS))
// channels of ADC in array
#define ADC_AIN0 (0)
#define ADC_AIN1 (1)
#define ADC_TS (2)
#define ADC_VREF (3)
#define ADC_AIN5 (4)
// starting index of ADC2
#define ADC2START (9*NUMBER_OF_ADC1_CHANNELS)
void adc_setup();
float getMCUtemp();
float getVdd();
uint16_t getADCval(int nch);
float getADCvoltage(int nch);

Binary file not shown.

View File

@ -18,6 +18,8 @@
#include "BMP280.h"
#include "hardware.h"
#include "mlxproc.h"
#include "mlx90640.h"
static bme280_t environment; // current measurements
@ -49,17 +51,49 @@ TRUE_INLINE void iwdg_setup(){
TRUE_INLINE void gpio_setup(){
RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN; // for USART and LEDs
for(int i = 0; i < 10000; ++i) nop();
// USB - alternate function 14 @ pins PA11/PA12; SWD - AF0 @PA13/14
// USB - alternate function 14 @ pins PA11/PA12; SWD - AF0 @PA13/14; USB pullup - PA15
// PA6 - PWM for external heater (TIM3_CH1 or TIM16_CH1); PA7 - PWM propto (humidity - 50%)
GPIOA->AFR[0] = AFRf(2, 6) | AFRf(2, 7);
GPIOA->AFR[1] = AFRf(14, 11) | AFRf(14, 12);
GPIOA->MODER = MODER_AF(11) | MODER_AF(12) | MODER_AF(13) | MODER_AF(14) | MODER_O(15);
GPIOB->MODER = MODER_O(0) | MODER_O(1) | MODER_O(2);
GPIOA->MODER = MODER_AI(0) | MODER_AI(1) | MODER_AI(4) | MODER_AI(5) | MODER_AF(6) |
MODER_AF(7) | MODER_AF(11) | MODER_AF(12) | MODER_AF(13) | MODER_AF(14) | MODER_O(15);
// PB0 - PWM propto Text (<=20 - 0%, >=30 - 100%), PB1 - PWM propto (Text-Tsky) (<=-5 - 0%, >=+35 - 100%) PB2 - SPI_CS
GPIOB->AFR[0] = AFRf(2, 0) | AFRf(2, 1);
GPIOB->MODER = MODER_AF(0) | MODER_AF(1) | MODER_O(2);
pin_set(GPIOB, 1<<1);
SPI_CS_1();
}
// setup PWM (TIM3_CH1) for external heater management over optocoupler (active level - 0)
TRUE_INLINE void pwm_setup(){
RCC->APB1ENR |= RCC_APB1ENR_TIM3EN;
TIM3->CR1 = TIM_CR1_ARPE;
TIM3->PSC = 71; // 72M/72 = 1MHz; PWMfreq=1M/100=10kHz
// PWM mode 1 (active -> inactive), enable buffering
TIM3->CCMR1 = TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1PE |
TIM_CCMR1_OC2M_2 | TIM_CCMR1_OC2M_1 | TIM_CCMR1_OC2PE;
TIM3->CCMR2 = TIM_CCMR2_OC3M_2 | TIM_CCMR2_OC3M_1 | TIM_CCMR2_OC3PE |
TIM_CCMR2_OC4M_2 | TIM_CCMR2_OC4M_1 | TIM_CCMR2_OC4PE;
TIM3->CCR1 = 0; TIM3->CCR2 = 0; TIM3->CCR3 = 0; TIM3->CCR4 = 0;
TIM3->ARR = PWM_CCR_MAX-1; // 8bit PWM from 0 to 99
TIM3->BDTR |= TIM_BDTR_MOE; // enable main output
// enable PWM output, all outputs active - low
TIM3->CCER = TIM_CCER_CC1P | TIM_CCER_CC1E | TIM_CCER_CC2P | TIM_CCER_CC2E |
TIM_CCER_CC3P | TIM_CCER_CC3E | TIM_CCER_CC4P | TIM_CCER_CC4E;
TIM3->CR1 |= TIM_CR1_CEN; // run timer
}
// change PWM value in percents; return 0 if `val` is bad or `ch` not 0..3
int setPWM(uint8_t ch, uint8_t val){
if(ch > 3 || val > PWM_CCR_MAX) return 0;
volatile uint32_t *CCRs = &(TIM3->CCR1);
CCRs[ch] = val;
return 1;
}
void hw_setup(){
gpio_setup();
pwm_setup();
#ifndef EBUG
iwdg_setup();
#endif
@ -72,6 +106,21 @@ int bme_init(){
return 1;
}
// calculate mean sky temperature
static float Tsky(){
int nmeas = 0;
float Tacc = 0.f;
for(int n = 0; n < N_SENSORS; ++n){ // sum all sensors
float *im = mlx_getimage(n);
if(!im) continue;
for(int i = 0; i < MLX_PIXNO; ++i){
Tacc += im[i]; ++nmeas;
}
}
if(nmeas < MLX_PIXNO) return +1000.; // all very bad: no sensors found?
return (Tacc / (float)nmeas);
}
// process sensor and make measurements
void bme_process(){
static uint32_t Tmeas = 0;
@ -87,7 +136,20 @@ void bme_process(){
environment.T = Temperature;
environment.P = Pressure;
environment.H = Humidity;
// set PWM duty propto humidity
float h = (Humidity - 50.f) * 2.f;
if(h < 0.f) h = 0.f; else if(h > 100.f) h = 100.f;
setPWM(PWM_CH_HUMIDITY, (uint8_t)h);
environment.Tmeas = Tms;
// set PWM duty propto external T
float t = (Temperature + 20.f) * 2.f;
if(t < 0.f) t = 0.f; else if(t > 100.f) t = 100.f;
setPWM(PWM_CH_TEXT, (uint8_t)t);
// set PWM propto skyqual
environment.Tsky = Tsky();
float q = (35.f - Temperature + environment.Tsky) * 2.5f;
if(q < 0.f) q = 0.f; else if(q > 100.f) q = 100.f;
setPWM(PWM_CH_TSKY, (uint8_t)q);
}
if(Tms - Tmeas > ENV_MEAS_PERIOD-1){
if(BMP280_start()) Tmeas = Tms;

View File

@ -32,11 +32,26 @@
// interval of environment measurements, ms
#define ENV_MEAS_PERIOD (10000)
// External heater PWM: TIM3_CH1 or TIM16_CH1
// Max PWM CCR1 value (->1)
#define PWM_CCR_MAX (100)
// PWM channels (start from 0 - CH1)
// external heater
#define PWM_CH_HEATER (0)
// propto humidity (the higher - the brighter)
#define PWM_CH_HUMIDITY (1)
// propto external T (the higher - the brighter)
#define PWM_CH_TEXT (2)
// propto Tsky - Text (the higher - the brighter)
#define PWM_CH_TSKY (3)
typedef struct{
float T; // temperature, degC
float Tdew; // dew point, degC
float P; // pressure, Pa
float H; // humidity, percents
float Tsky; // mean Tsky, degC
// TODO: add here values of NTC on ADC channels 1/2
uint32_t Tmeas; // time of measurement
} bme280_t;
@ -46,3 +61,4 @@ void hw_setup();
int bme_init();
void bme_process();
int get_environment(bme280_t *env);
int setPWM(uint8_t ch, uint8_t val);

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 17.0.1, 2025-10-05T00:09:36. -->
<!-- Written by QtCreator 17.0.1, 2025-10-06T23:24:05. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@ -1,5 +1,7 @@
BMP280.c
BMP280.h
adc.c
adc.h
hardware.c
hardware.h
i2c.c

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 344 B

View File

@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "adc.h"
#include "hardware.h"
#include "i2c.h"
#include "mlxproc.h"
@ -44,12 +45,13 @@ int main(void){
}
USBPU_OFF();
hw_setup();
adc_setup();
i2c_setup(I2C_SPEED_400K);
bme_init();
USB_setup();
usart_setup(115200);
USBPU_ON();
uint32_t ctr = Tms, Tlastima[N_SESORS] = {0};
uint32_t ctr = Tms, Tlastima[N_SENSORS] = {0};
mlx_continue(); // init state machine
while(1){
IWDG->KR = IWDG_REFRESH;
@ -77,7 +79,7 @@ int main(void){
}
}
mlx_process();
if(cartoon) for(int i = 0; i < N_SESORS; ++i){ // USB-only
if(cartoon) for(int i = 0; i < N_SENSORS; ++i){ // USB-only
uint32_t Tnow = mlx_lastimT(i);
if(Tnow != Tlastima[i]){
fp_t *im = mlx_getimage(i);

View File

@ -41,15 +41,15 @@ extern volatile uint32_t Tms;
// current state and state before `stop` called
static mlx_state_t MLX_state = MLX_RELAX, MLX_oldstate = MLX_RELAX;
static int errctr = 0; // errors counter - cleared by mlx_continue
static uint32_t Tlastimage[N_SESORS] = {0};
static uint32_t Tlastimage[N_SENSORS] = {0};
// subpages and configs of all sensors
// 8320 bytes:
static int16_t imdata[N_SESORS][REG_IMAGEDATA_LEN];
static int16_t imdata[N_SENSORS][REG_IMAGEDATA_LEN];
// 8340 bytes:
static uint16_t confdata[N_SESORS][MLX_DMA_MAXLEN];
static uint8_t sens_addresses[N_SESORS] = {0x10<<1, 0x11<<1, 0x12<<1, 0x13<<1, 0x14<<1}; // addresses of all sensors (if 0 - omit this one)
static uint8_t sensaddr[N_SESORS];
static uint16_t confdata[N_SENSORS][MLX_DMA_MAXLEN];
static uint8_t sens_addresses[N_SENSORS] = {0x10<<1, 0x11<<1, 0x12<<1, 0x13<<1, 0x14<<1}; // addresses of all sensors (if 0 - omit this one)
static uint8_t sensaddr[N_SENSORS];
// get compile-time size: (gcc shows it in error message)
//char (*__kaboom)[sizeof( confdata )] = 1;
@ -63,7 +63,7 @@ static int sensno = -1;
mlx_state_t mlx_state(){ return MLX_state; }
// set address
int mlx_setaddr(int n, uint8_t addr){
if(n < 0 || n > N_SESORS) return 0;
if(n < 0 || n > N_SENSORS) return 0;
if(addr > 0x7f) return 0;
sens_addresses[n] = addr << 1;
Tlastimage[n] = Tms; // refresh counter for autoreset I2C in case of error
@ -106,8 +106,8 @@ static int nextsensno(int s){
return -1;
}
int next = s + 1;
for(; next < N_SESORS; ++next) if(sensaddr[next]) break;
if(next == N_SESORS) return nextsensno(-1); // roll to start
for(; next < N_SENSORS; ++next) if(sensaddr[next]) break;
if(next == N_SENSORS) return nextsensno(-1); // roll to start
D(i2str(next)); DB('('); D(i2str(s)); DB(')'); DN(" - new sensor number");
return next;
}
@ -115,7 +115,7 @@ static int nextsensno(int s){
// count active sensors
int mlx_nactive(){
int N = 0;
for(int i = 0; i < N_SESORS; ++i) if(sensaddr[i]) ++N;
for(int i = 0; i < N_SENSORS; ++i) if(sensaddr[i]) ++N;
return N;
}
@ -230,7 +230,7 @@ MLX90640_params *mlx_getparams(int n){
uint32_t mlx_lastimT(int n){ return Tlastimage[n]; }
fp_t *mlx_getimage(int n){
if(n < 0 || n >= N_SESORS || !sensaddr[n]) return NULL;
if(n < 0 || n >= N_SENSORS || !sensaddr[n]) return NULL;
MLX90640_params *p = get_parameters(confdata[n]);
if(!p) return NULL;
fp_t *ready_image = process_image(imdata[n]);

View File

@ -23,7 +23,7 @@
#include "mlx90640.h"
// amount of sensors processing
#define N_SESORS (5)
#define N_SENSORS (5)
// maximal errors number to stop processing
#define MLX_MAX_ERRORS (11)

View File

@ -20,6 +20,7 @@
#include <stm32f3.h>
#include <string.h>
#include "adc.h"
#include "hardware.h"
#include "i2c.h"
#include "mlxproc.h"
@ -89,12 +90,16 @@ const char *const helpstring =
"i0..4 - setup I2C with speed 10k, 100k, 400k, 1M or 2M (experimental!)\n"
"p - pause MLX\n"
"s - stop MLX (and start from zero @ 'c')\n"
"A - get ADC values\n"
"C - \"cartoon\" mode on/off (show each new image) - USB only!!!\n"
"Dn - dump MLX parameters for sensor number n\n"
"Ia addr [n] - set device address for interactive work or (with n) change address of n'th sensor\n"
"Ir reg n - read n words from 16-bit register\n"
"Iw words - send words (hex/dec/oct/bin) to I2C\n"
"Is - scan I2C bus\n"
"M - get MCU temperature and Vdd value\n"
"O - set output of DAC (0..4095)\n"
"Px - set PWM output (0..100%) or get current value\n"
"Us - send string 's' to other interface\n"
;
@ -140,7 +145,7 @@ static int getsensnum(const char *buf){
if(!buf || !*buf) return -1;
uint32_t num;
const char *nxt = getnum(buf, &num);
if(!nxt || nxt == buf || num >= N_SESORS) return -1;
if(!nxt || nxt == buf || num >= N_SENSORS) return -1;
return (int) num;
}
@ -311,7 +316,7 @@ TRUE_INLINE void listactive(){
uint8_t *ids = mlx_activeids();
sendfun->S("Found "); sendfun->P('0'+N);
sendfun->S(" active sensors:"); N();
for(int i = 0; i < N_SESORS; ++i)
for(int i = 0; i < N_SENSORS; ++i)
if(ids[i]){
sendfun->S("SENSID");
sendfun->S(u2str(i)); sendfun->P('=');
@ -331,6 +336,7 @@ TRUE_INLINE void getenv(){
bme280_t env;
if(!get_environment(&env)) sendfun->S("BADENVIRONMENT\n");
sendfun->S("TEMPERATURE="); sendfun->S(float2str(env.T, 2));
sendfun->S("\nSKYTEMPERATURE="); sendfun->S(float2str(env.Tsky, 2));
sendfun->S("\nPRESSURE_HPA="); sendfun->S(float2str(env.P/100.f, 2));
sendfun->S("\nPRESSURE_MM="); sendfun->S(float2str(env.P * 0.00750062f, 2));
sendfun->S("\nHUMIDITY="); sendfun->S(float2str(env.H, 2));
@ -339,6 +345,43 @@ TRUE_INLINE void getenv(){
N();
}
TRUE_INLINE const char *DAC_chval(const char *buf){
uint32_t D;
const char *nxt = getnum(buf, &D);
if(!nxt || nxt == buf || D > 4095) return ERR;
DAC1->DHR12R1 = D;
return OK;
}
TRUE_INLINE void getADC(){
sendfun->S("AIN0="); sendfun->S(u2str(getADCval(ADC_AIN0)));
sendfun->S("\nAIN1="); sendfun->S(u2str(getADCval(ADC_AIN1)));
sendfun->S("\nAIN5="); sendfun->S(u2str(getADCval(ADC_AIN5)));
N();
}
TRUE_INLINE void getMCUvals(){
sendfun->S("MCUTEMP="); sendfun->S(float2str(getMCUtemp(), 2));
sendfun->S("\nMCUVDD="); sendfun->S(float2str(getVdd(), 2));
N();
}
TRUE_INLINE const char* setpwm(const char *buf){
uint32_t D;
if(!buf || !*buf){
sendfun->S("PWM1="); sendfun->S(u2str(TIM3->CCR1));
sendfun->S("\nPWM2="); sendfun->S(u2str(TIM3->CCR2));
sendfun->S("\nPWM3="); sendfun->S(u2str(TIM3->CCR3));
sendfun->S("\nPWM4="); sendfun->S(u2str(TIM3->CCR4));
N();
return NULL;
}
const char *nxt = getnum(buf, &D);
if(!nxt || nxt == buf || !setPWM(PWM_CH_HEATER, D)) return ERR;
return OK;
}
/**
* @brief parse_cmd - user string parser
* @param buf - user data
@ -349,32 +392,32 @@ const char *parse_cmd(char *buf, int sendto){
if(!buf || !*buf) return NULL;
chsendfun(sendto);
if(buf[1]){
switch(*buf){ // "long" commands
switch(*buf++){ // "long" commands
case 'a':
return chhwaddr(buf + 1);
return chhwaddr(buf);
case 'd':
return drawimg(buf+1, 1);
return drawimg(buf, 1);
case 'g':
return drawimg(buf+1, 2);
return drawimg(buf, 2);
case 'i':
return setupI2C(buf + 1);
return setupI2C(buf);
case 'm':
return drawimg(buf+1, 0);
return drawimg(buf, 0);
case 't':
getimt(buf + 1); return NULL;
getimt(buf); return NULL;
case 'D':
dumpparams(buf + 1);
dumpparams(buf);
return NULL;
break;
case 'I':
buf = omit_spaces(buf + 1);
buf = omit_spaces(buf);
switch(*buf){
case 'a':
return chaddr(buf + 1);
return chaddr(buf);
case 'r':
return rdI2C(buf + 1);
return rdI2C(buf);
case 'w':
return wrI2C(buf + 1);
return wrI2C(buf);
case 's':
i2c_init_scan_mode();
return OK;
@ -382,16 +425,23 @@ const char *parse_cmd(char *buf, int sendto){
return ERR;
}
break;
case 'O':
return DAC_chval(buf);
case 'P':
return setpwm(buf);
case 'U':
if(sendto == SEND_USB) chsendfun(SEND_USART);
else chsendfun(SEND_USB);
if(sendfun->S(buf + 1) && N()) return OK;
if(sendfun->S(buf) && N()) return OK;
return ERR;
default:
return ERR;
}
}
switch(*buf){ // "short" (one letter) commands
case 'A':
getADC();
break;
case 'c':
mlx_continue(); return OK;
break;
@ -416,6 +466,11 @@ const char *parse_cmd(char *buf, int sendto){
case 'G':
getst();
break;
case 'M':
getMCUvals();
break;
case 'P':
return setpwm(NULL);
case 'R':
NVIC_SystemReset();
break;

View File

@ -1,2 +1,2 @@
#define BUILD_NUMBER "36"
#define BUILD_DATE "2025-10-05"
#define BUILD_NUMBER "44"
#define BUILD_DATE "2025-10-06"

50
F3:F303/STM32F303C.md Normal file
View File

@ -0,0 +1,50 @@
| Pin # | Pin name | function | settings | comment |
| --------- | ------------- | ------------ | ------------ | ------------ |
| 1 | VBAT | | | |
| 2 | PC13 | | | |
| 3 | PC14 | | | |
| 4 | PC15 | | | |
| 5 | OCS_IN | | | |
| 6 | OSC_OUT | | | |
| 7 | NRST | | | |
| 8 | VSSA | | | |
| 9 | VDDA | | | |
| 10 | PA0 | | | |
| 11 | PA1 | | | |
| 12 | PA2 | | | |
| 13 | PA3 | | | |
| 14 | PA4 | | | |
| 15 | PA5 | | | |
| 16 | PA6 | | | |
| 17 | PA7 | | | |
| 18 | PB0 | | | |
| 19 | PB1 | | | |
| 20 | PB2 | | | |
| 21 | PB10 | | | |
| 22 | PB11 | | | |
| 23 | VSS1 | | | |
| 24 | VDD1 | | | |
| 25 | PB12 | | | |
| 26 | PB13 | | | |
| 27 | PB14 | | | |
| 28 | PB15 | | | |
| 29 | PA8 | | | |
| 30 | PA9 | | | |
| 31 | PA10 | | | |
| 32 | PA11 | | | |
| 33 | PA12 | | | |
| 34 | PA13 | | | |
| 35 | VSS2 | | | |
| 36 | VDD2 | | | |
| 37 | PA14 | | | |
| 38 | PA15 | | | |
| 39 | PB3 | | | |
| 40 | PB4 | | | |
| 41 | PB5 | | | |
| 42 | PB6 | | | |
| 43 | PB7 | | | |
| 44 | BOOT0 | | | |
| 45 | PB8 | | | |
| 46 | PB9 | | | |
| 47 | VSS3 | | | |
| 48 | VDD3 | | | |