2 posts / 0 new
Last post
Krixen
Offline
Last seen:3 years 7 months ago
加入:2015-09-28 16:27
UART not working

I have uploaded the 5.0.4 uart2_async keil project. I built it and then ran a debug session and hit run.
I am simply running in a while(1) loop:

uart2_print_string("A").

I have probed the pin P0.4 (port 0, pin 4) which is the default in the program with only one time it was actually printing something.
I then changed it to Pin 0.2 (port 0, pin 2) and I see nothing.

我也试着改变波特率to 9K6 instead of 115K2.

Any idea what I may be doing wrong? I a reading it on terraterm with the correct settings using a separate USB cable (prolific)

Device:
MT_dialog
Offline
Last seen:1 month 6 days ago
工作人员
加入:2015-06-08 11:34
Hi Krixen,

Hi Krixen,

As far as i understand you ve changed in the user_periph_setup.h file from UART2_TX_PIN / GPIO_PIN_4 to UART2_TX_PIN / GPIO_PIN_2, by doing that you have changed the pin that is used as a UART from P04 to P02 so you have to change the wire and connect from P02 to the UART RX.

Thanks MT_dialog