How to read and write on tx and rx

ChibiOS public support forum for topics related to the STMicroelectronics SPC56x family of automotive micro-controllers.
Post Reply
GianlucaLaManna
Posts: 25
Joined: Fri Mar 13, 2015 12:12 pm

How to read and write on tx and rx

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How to read and write on tx and rx

Post 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
GianlucaLaManna
Posts: 25
Joined: Fri Mar 13, 2015 12:12 pm

Re: How to read and write on tx and rx

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How to read and write on tx and rx

Post by Giovanni »

Correct.

Giovanni
GianlucaLaManna
Posts: 25
Joined: Fri Mar 13, 2015 12:12 pm

Re: How to read and write on tx and rx

Post by GianlucaLaManna »

Ok I try to control the setting of the pin and I'll know. Thanks
GianlucaLaManna
Posts: 25
Joined: Fri Mar 13, 2015 12:12 pm

Re: How to read and write on tx and rx

Post 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.
Post Reply