ch55xduino - CH552 serial print to txd port

OP #7617082
Rate this post
useful
not useful

Hi,

Im working on a CH552 project using ch55xduino IDE with a Development Board: “CH552 Core Board by WeActStudio”

I trying to write a simple text “Hello,World" to an cpu port (31) TXD.

But can not get the code working, can any give me hand with the code

Has anybody used Serial0.println or Serial1.println

USBSerial_print(“Hello,World”); works perfect !

Code:

void setup() { Serial1.begin(9600); while (!Serial1); }

void loop() { Serial1.println("Hello,World"); delay(1000); }

OP #7617420
Rate this post
useful
not useful

Hello Thomas,

Thanks for your suggestions, unfortunately I'm still not getting any data out on ant of the ports.

I have tried to connect my serial capture program ( RealTerm ) to any port without result.

When I connect Rx to TX my serial capture program, the capture program echo what I type, so I'm sure the capture program works fine.

I also have no compile error, so looks like CHxxDuino accept:

  • Serial0_println("Hello World");
  • Serial1_println("Hello World");

USBSerial_println("Hello World"); works fine ! using Arduino Serial Monitor.

Any other suggestions ?

void setup() { }

void loop() { Serial0_println("Hello World"); // print to P1.7 Serial1_println("Hello World"); // print to P3.1 USBSerial_println("Hello World"); // print to USB ( Works fine ) delay(100); }

#7617676
Rate this post
useful
not useful

I dont use Arduino code on that board, so my knowledge is very limited.

But here is the thing: Output on TX0 or TX1 usually requires to TI =1 (U1TI = 1) in Non Interrupt mode to signal the transmiter is empty. I suppose this is done in Serial0_begin() and Serial1_begin().

void setup() { Serial0_begin(9600); Serial1_begin(9600); }

void loop() { Serial0_println("Hello World0"); // print to P1.7 Serial1_println("Hello World1"); // print to P3.1 USBSerial_println("Hello World"); // print to USB ( Works fine ) delay(100); }

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now