WeActStudio / WeActStudio.MiniSTM32F4x1

MiniF4-STM32F401CEU6/STM32F411CEU6 Product Literature
685 stars 152 forks source link

Whether or not the PA10 port burned out from a level of 5 volts #44

Closed brightproject closed 1 year ago

brightproject commented 1 year ago

Hello @WeActStudio. When designing the board on which BlackPill stm32f401ccu6 was planned to be placed, I made a mistake when creating the CH340G circuit. photo1685817698 (2) It was necessary to power the microcircuit from 3.3 volt, either through a converter, or two diodes. ch340_ttl Or use a level shifter. qDDi9 But that's all I'll do in the next PCB. In general, I soldered the board, and it turns out that 5 volts were supplied to PA9 and PA10. My schematic((( Скриншот 19-07-2023 22 11 11 Pins TX/RX have a voltage level of the CH340G microcircuit, namely about 4.7-4.9 volts. And this level was fed to the inputs PA9/PA10, where 3.3. volt... The most interesting thing is that the whole scheme worked and gave me data from the gyroscope sensor in serial port.

void setup() 
{
Serial.begin(115200);
}
void loop() 
{
Serial.println("Hello World");
}

252343495-0610fea0-949a-4ca4-95e9-1b9b227c5ab5 I had an MPU9250 sensor connecting by I2C bus SDA-PB7, SCL-PB6 and the microcontroller received data on this bus from the sensor and transferred them to the UART port, i.e. COM port, which was created by the CH340G chip. I tested the board for about a week, and today the serial port stopped outputting data...only garbage. Скриншот 19-07-2023 23 09 55 I began to figure it out - when there is no device on the I2C bus, then the data quietly goes to the UART on the CH340G in the serial port, but even when there are devices, and the sketch is launched to check the address of the device, everything works. 252144560-ced03aaa-3e41-451f-be32-09c8125e005d When I install an MPU9250 sensor or another device on the I2C bus and issue a port to the serial, nothing is output to the UART. I have three BlackPills and I compared them. If the debug board is not in DFU mode, then on the legs PA9 and PA10 3.2 volts each. If I switch the board to DFU mode, then on two "serviceable" BlackPills I have voltage levels on PA9 and PA10 near zero (to be precise, 0.12 volts), and on the "faulty" BlackPlil one on PA9 0 volts, and on PA10 3.2 volts . If I press the RESET button, then the voltage level drops to PA9, and 3.2 volts remains on PA10. On the other two BlackPills and on PA9 and PA10, the level drops by 0 volts. I wrote a sketch to press the legs to a low level, and played around with the PA10 leg - and it is pressed to zero, only up to 0.45 volts, and then 3.2 volts. Sketch below.

void setup() {
  pinMode(PA10, OUTPUT); 
}

void loop() {
  digitalWrite(PA10, LOW); /
  delay(3000); /
  digitalWrite(PA10, HIGH); 
  delay(3000); 
}

The documentation says that PA10 is needed for OTG_USB. Скриншот 19-07-2023 23 47 13 In general, PA10 is data reception, how does it affect the output of information from the serial port? And I2C also fails ... maybe I have something with the timer? Скриншот 19-07-2023 23 50 16 What am I doing wrong, or did I spoil the stm32f401ccu6 output of PA10? The documentation says that all pins are 5 volt tolerant... 253820606-77796336-4507-47ab-b66d-d6c1d3f6b5a9 It’s very strange, if I don’t use the I2C bus, then I get the output to the serial PA10 without problems, as soon as the I2C bus works, except for the sketch address scanner, the serial port does not output anything.