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

How to read and write on tx and rx

Postby GianlucaLaManna » Mon Jan 18, 2016 12:38 pm

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: 11153
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 391 times
Been thanked: 322 times
Contact:

Re: How to read and write on tx and rx

Postby Giovanni » Mon Jan 18, 2016 1:22 pm

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
Location: Palermo, Italy

Re: How to read and write on tx and rx

Postby GianlucaLaManna » Mon Jan 18, 2016 1:30 pm

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: 11153
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 391 times
Been thanked: 322 times
Contact:

Re: How to read and write on tx and rx

Postby Giovanni » Mon Jan 18, 2016 1:33 pm

Correct.

Giovanni

GianlucaLaManna
Posts: 25
Joined: Fri Mar 13, 2015 12:12 pm
Location: Palermo, Italy

Re: How to read and write on tx and rx

Postby GianlucaLaManna » Mon Jan 18, 2016 1:38 pm

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
Location: Palermo, Italy

Re: How to read and write on tx and rx

Postby GianlucaLaManna » Mon Jan 18, 2016 4:37 pm

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.


Return to “SPC56x Support”

Who is online

Users browsing this forum: No registered users and 1 guest