简体   繁体   English

引脚不输出 STM32F103C6T6

[英]Pins are not outputting STM32F103C6T6

I am trying to get the mentioned board working with just a basic program to turn on an LED.我试图让提到的电路板只使用一个基本程序来打开 LED。 I have FTDI pins Tx, Rx, VCC, and GND connected to A9, A10, 3.3, and GND of the board respectively.我将 FTDI 引脚 Tx、Rx、VCC 和 GND 分别连接到开发板的 A9、A10、3.3 和 GND。 I am able to successfully upload the program to the board from Arduino IDE over Serial successfully (see below).我能够通过串行成功地将程序从 Arduino IDE 上传到电路板(见下文)。

Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0412 (Low-density)
- RAM        : 10KiB  (512b reserved by bootloader)
- Flash      : 32KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory 
...
Wrote address 0x08002b98 (100.00%) Done.

Starting execution at address 0x08000000... done.

The PWR LED on the board is red while it's connected to the FTDI, however when I run the basic "Blink" program, the onboard LED (PC13) does not blink, I have also tried changing the pin in the code to digital output pins like PB12-PB15 with an LED and 220 ohm resistor connected between the output pin and GND but nothing happens.板上的 PWR LED 在连接到 FTDI 时呈红色,但是当我运行基本的“闪烁”程序时,板载 LED (PC13) 不闪烁,我还尝试将代码中的引脚更改为数字 output 引脚就像 PB12-PB15,在 output 引脚和 GND 之间连接了一个 LED 和 220 欧姆电阻,但没有任何反应。

Blink example code (2 = PC13)闪烁示例代码 (2 = PC13)

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin PB1 as an output.
  pinMode(2, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(2, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

The main reason I can think of this happening is because I initially had the FTDI in 5V mode connected to the 5V pin of the board.我能想到发生这种情况的主要原因是因为我最初将 5V 模式下的 FTDI 连接到电路板的 5V 引脚。 That shouldn't be an issue though because then what would be the point of the 5V pin?不过这应该不是问题,因为 5V 引脚的意义何在? If anyone has any ideas please let me know.如果有人有任何想法,请告诉我。

Pinout diagram引脚图在此处输入图像描述

The Arduino IDE board library by stm32duino that was recommended in the tutorial was outdated.教程中推荐的 stm32duino 的 Arduino IDE 开发板库已过时。 Using the library by ST Microelectronics to select my board in Arduino was the solution.使用 ST Microelectronics 的库到 select 我的电路板 Arduino 是解决方案。 The library index can be found here and should be added to the board manager.图书馆索引可以在这里找到,应该添加到董事会经理。 This allowed me to select the board STM32F1 Series.这使我能够使用 select 开发板 STM32F1 系列。 Now flashing my program onto the board works.现在将我的程序闪烁到电路板上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM