5214 views|8 replies

931

Posts

3

Resources
The OP
 

Please tell me about the PB pin of GD32E230C [Copy link]

I am going to drive the RD117 module, which uses I2C for communication. I originally planned to use firmware I2C, but the development board has directly connected I2C to AT24C02, which is not convenient to share with RD117 (although I can disconnect pin 1 of AT24C02 and use a jumper as a chip select signal, but RD117 does not have a pin for chip select control). I looked up relevant information and determined to use PB3, PB5 and PB8 to control RD117. The arrangement of the pins on the board is shown in the figure below:
But when testing, I found that PB3 and PB8 were occupied by an unknown function of the system. PB3 outputted a clock-like waveform, and PB8 continuously outputted some data, as shown in the figure below. I can be sure that these signals are not generated by my code, but I can't find out which function of the system occupied them. In addition, PB5 cannot be controlled, as if it has failed. My configuration code is as follows. There should be no problem, right?
  • rcu_periph_clock_enable(RCU_GPIOB); //Turn on PB clock
  • gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_5);
  • gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5);
Copy code
I have been working on this for two days and still have no idea. Please help me, thank you!

This post is from GD32 MCU

Latest reply

In the Debug interface, open Peripherals--->system--->GPIO--->GPIOB. You can see the register configuration of PB. According to the manual analysis, I tested it with an oscilloscope and a logic analyzer yesterday. Your problem will not be reproduced.  Details Published on 2019-4-18 09:02
 

530

Posts

4

Resources
2
 
Looking at the diagram, you have no problem using these three GPIOs. Based on these things alone, it is difficult to determine why PB5 has the failure you mentioned. Generally speaking, you can first try to see if PB5 can output high and low levels normally, just use an external meter to measure it, and then use a delay to see if it can output a square wave. This generally determines whether the GPIO works normally. The situation you described is probably that other header files or modules use this GPIO, or there is a problem with your program. It is recommended that you upload all the programs so that we can help you do further analysis.
This post is from GD32 MCU
 
 
 

931

Posts

3

Resources
3
 
I connected an LED light to the PB5 pin for testing, and flipped the pin state every 500 milliseconds, but the LED light did not respond. I also connected LED lights to the PB3 and PB8 pins for testing, and these two pins can light up the LED lights. There is no problem with the LED lights being pulled down or pulled up, which means that these two pins have square wave outputs, but I don’t know which code controls this output. I am sure that these codes have not been written, and I can’t find the use of these two pins in the development board information. I checked the data sheet and couldn’t find the reason. Below is the relevant code. I configured the PB5 pin at the beginning of the main function, and then flipped the pin state every 500 milliseconds in the loop.
  1. rcu_periph_clock_enable(GPIOB); gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_5); gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5); gpio_bit_set(GPIOB,GPIO_PIN_5); //Pull the pin high//draw_test(); while(1){ // loop(); //Call the blood oxygen heart rate detection processing module gui_test(); //Dynamic drawing test/ if (ms > 499) //Half second processing { ms = 0; half_seco(); gpio_bit_toggle(GPIOB,GPIO_PIN_5);
复制代码
This post is from GD32 MCU
 
 
 

931

Posts

3

Resources
4
 
Because of multiple tests, the whole program is a bit messy and has not been cleaned up yet. Now it is packaged as follows: test1.rar (513.11 KB, downloads: 9)
This post is from GD32 MCU
 
 
 

4

Posts

0

Resources
5
 
I tested your program and found that PB5 can be flipped.
This post is from GD32 MCU

Comments

Thanks for the help in testing. The flipping of PB5 has been solved, but the reasons for PB3 and PB8 are still unknown.  Details Published on 2019-4-16 10:50
 
 
 

931

Posts

3

Resources
6
 
Teng Zhifeng posted on 2019-4-15 20:07 I tested your program and found that PB5 can be flipped.
Thank you for your help in testing. The flipping of PB5 has been solved, but the reasons for PB3 and PB8 are still unclear.
This post is from GD32 MCU
 
 
 

4

Posts

0

Resources
7
 
Here, the DEBUG test shows that the PB3 and PB8 of the GD32E230C-EVEAL board are in input mode and will not output a high level. Please check your hardware and test it again with DEBUG.

Image 2.jpg (52.63 KB, downloads: 0)

Image 2.jpg
This post is from GD32 MCU
 
 
 

931

Posts

3

Resources
8
 
Thank you for your help! How to use DEBUG to test pins?
This post is from GD32 MCU
 
 
 

4

Posts

0

Resources
9
 
In the Debug interface, open Peripherals--->system--->GPIO--->GPIOB. You can see the register configuration of PB. According to the manual analysis, I tested it with an oscilloscope and a logic analyzer yesterday. Your problem will not be reproduced.
This post is from GD32 MCU
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list