Page 1 of 1

How to read and write on tx and rx

Posted: Mon Jan 18, 2016 12:38 pm
by GianlucaLaManna
Hello.
I use SPC560P - DISP.

I enabled the serial communication LIN1. Then I set the pins TX and RX: TX output and RX input.
This is my code:

Code: Select all

sdStart(&SD2, NULL);
chprintf((BaseSequentialStream *)&SD2, "V \r\n");

but it does not work.
Use SD1 because SD2 I use it with USB / Teraterm.

Re: How to read and write on tx and rx

Posted: Mon Jan 18, 2016 1:22 pm
by Giovanni
Hi,

Are I/O pins configured properly? also check clock settings.

SPC5Studio examples use serial ports, try starting from one of those.

Giovanni

Re: How to read and write on tx and rx

Posted: Mon Jan 18, 2016 1:30 pm
by GianlucaLaManna
Yes I know, but they don't use the rx and tx pad.
With the pin map wizard I set the pin 99 in RX and the pin 26 in TX.The function to write a character on the serial TX / RX is chprintf? It correct?

Re: How to read and write on tx and rx

Posted: Mon Jan 18, 2016 1:33 pm
by Giovanni
Correct.

Giovanni

Re: How to read and write on tx and rx

Posted: Mon Jan 18, 2016 1:38 pm
by GianlucaLaManna
Ok I try to control the setting of the pin and I'll know. Thanks

Re: How to read and write on tx and rx

Posted: Mon Jan 18, 2016 4:37 pm
by GianlucaLaManna
The software is ok. I think it's a problem of hardware setting.

I solved using SD1 and with 2 jumper using pins tx and rx near the programmer.
I'm using a bluetooth module and the tx and rx I take them in those two pins.
So use the same port. In fact I have the same output of Tera Term, and on the console of my smartphone.
So, for me, the thread is solved. I can communicate via Bluetooth. I have to see better setting some hardware jumpers.
Thank you.