二:STM32ADC_Arduio

The STM32 is a family of microcontroller ICs based on the 32-bit RISC ARM Cortex-M7FCortex-M4FCortex-M3Cortex-M0+, and Cortex-M0 cores.[1]STMicroelectronics licenses the ARM Processor IP from ARM Holdings. The ARM core designs have numerous configurable options, and ST chooses the individual configuration to use for each design. ST attaches their own peripherals to the core before converting the design into a silicon die. The following tables summarize the STM32 microcontroller families.

The STM32 is a family of microcontroller ICs based on the 32-bit RISC ARM Cortex-M7FCortex-M4FCortex-M3Cortex-M0+, and Cortex-M0 cores.[1]STMicroelectronics licenses the ARM Processor IP from ARM Holdings. The ARM core designs have numerous configurable options, and ST chooses the individual configuration to use for each design. ST attaches their own peripherals to the core before converting the design into a silicon die. The following tables summarize the STM32 microcontroller families.

Family: [xx][1][73]

Code

Core

Max freq [MHz]

Max FLASH [KB]

Max SRAM [KB]

Target

F0

CortexM0

48

256

32

Mainstream

F1

CortexM3

72

1024

96

Mainstream

F2

CortexM3

120

1024

128

High performance

F3

CortexM4

72

512

80

Mainstream

F4

CortexM4

180

2048

384

High performance

F7

CortexM7

216

2048

512

High performance

H7

CortexM7

400

2048

1024

High performance

L0

CortexM0+

32

192

20

Low power

L1

CortexM3

32

512

80

Low power

L4

CortexM4

80

1024

320

Low power


 

 

Pins for STM32F103 series

 

 

 

 

 

 

 

64 Pins

 

100Pins

144 Pins

 

 

 

 

 

STM32F103ZET6 PINS FOR ADC

 

                                              STM32F103ZET6 ADC PINS                                                    

Channel

ADC1 IO

ADC2 IO

ADC3 IO

Channel0

PA0

PA0

PA0

Channel1

PA1

PA1

PA1

Channel2

PA2

PA2

PA2

Channel3

PA3

PA3

PA3

Channel4

PA4

PA4

PF7

Channel5

PA5

PA5

PF7

Channel6

PA6

PA6

PF8

Channel7

PA7

PA7

PF9

Channel8

PB0

PB0

PF10

Channel9

PB1

PB1

Interior VSS

Channel10

PC0

PC0

PC0

Channel11

PC1

PC1

PC1

Channel12

PC2

PC2

PC2

Channel13

PC3

PC3

PC3

Channel14

PC4

PC4

Interior VSS

Channel15

PC5

PC5

Interior VSS

Channel16

Interior temperature

Interior VSS

Interior VSS

Channel17

Interior Vrefint

Interior VSS

Interior VSS

 

 

Second : The ADC for STM32 by Arduino

 

Step 1: Seek the list about pins ,get your choice of pin for ADC. I get the PA3. 

 

Step 2: Begin your coding.

       I will list two ways to get the pot’s voltage by ADC.

 

       The first one’s code: 

 

 

The second code:

About the second one , I get the example of Github’s package.

 

 

 

There are six Arduino projects

 

      Open the file called STM32ADC.c, I find the functions for coding . Using    these API we should make some change ,like the pins .We should find the pins than we choose named PA3 .Don’t care the D23 ,D33 and so on ,you can find the at boards.h ,so just named the pins as usual cause computer knows those .The function you can also know from the notes .

To get the ADC knowledge you can seek them in internet . They will sure you better than me . You’d must know some key words ,like channel ,sample rate … and better to get how ADC work and working process.

      
      
      
      
      
      
      
      
      
      
      
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值