10 years, 6 months ago.

SERIAL data on PC.

Hi, I am trying to transfer a serial data using RS232 communication.The task I am able to do correctly but on COM port I am able to see the data only if the cable available with the board is plugged in.This board gets initialized as COM5 and through the COM5 only I am able see data on Hyperterminal.Is there any method by which I am able to connect the serial cable only and get that data.Please advice.My tx is p13 and rx is p14.

It might help to say what platform you are using, from later responses it appears you may be using the Freescale KL25Z rather than one of the NXP MBEDs.

posted by Oliver Broad 15 Oct 2013

3 Answers

10 years, 6 months ago.

Possibly you have not changed the declaration of your serial port to indicate the different pins.

If you have:

Serial pc(USBTX, USBRX);

you need to change it to:

Serial pc(p13, p14);

Accepted Answer

I have given the settings as

Serial pc(USBTX, USBRX); Serial uart(p13, p14);

Can I send data through both the USB and the serial lines..?Here USB is working and serial data comes on the COM5 port when KL25 is inserted..But COM1 is the place where I am inserting the RS232 cable.So I should get data at the COM1 port without inserting KL25 cable...

posted by Ranjith.R Nair 15 Oct 2013

It would be handy if you clearly tell what you have and what you are doing. Because the RS232 cable you are using is new here. Are you sure it is COM1, and how are you connecting the mbed to the cable?

posted by Erik - 15 Oct 2013

I have made a base board taking the lines p13,p14 and through a serial driver IC (MAX232) and also USB connections from D+,D-,gnd. The data send through the USB I am able to receive on hyperterminal through virtuaI port COM3. I have tested the COM1 port of my PC with another board(which is already with me).Now COM1 is absolutely working fine.When the base board is connected to my mbed board, I should get the data as per the program on COM1. Now I am not getting the data on COM1 port, but I am getting data on COM5 when KL25 is inserted.Instead of COM5 can I get data of RS232 on COM1 without inserting KL25 ?

posted by Ranjith.R Nair 15 Oct 2013

Okay now the first part is (finally) clear.

But what does the KL25 has to do with it? Aren't you using an LPC1768? And if you have a KL25 which seperately sends data, then what does that have to do with your problem? Does it show the data that goes to COM1 on COM5 if you insert the KL25?

Make a simple program that shows your problem and possibly even draw your setup, because I at least can't understand how you put it together.

posted by Erik - 15 Oct 2013
10 years, 6 months ago.

So you want to show the data on your PC without using the USB<>Serial bridge? You can connect p13 and p14 to the serial port of your computer via a level shifter (MAX232s are popular). That is assuming your PC has a serial (COM) port.

Alternative is using an external USB <> Serial bridge IC, FTDI chips are popular for that.

Hi,Thanks for the reply.But in my case without inserting KL25 cable the serial communication is not recognized.When KL25 is inserted a COM port is generated (COM5) and then using hyper terminal we can see the data.Without inserting KL25 is it possible to see com (in my case COM1) data...?

posted by Ranjith.R Nair 11 Oct 2013

p13 and p14 don't exist on a KL25. And you want to receive data without a connection existing? Either I misunderstand you, or you want data to somehow transport itself to your computer without any connection? How do you see that happening?

posted by Erik - 11 Oct 2013

thats right.But in this case on PC side I am using hyper terminal.So when a COM5 port get initialized while I plug KL25...,only then I am able to see the data.Actually I am connecting serial bus to COM1.But data comes on COM5,..Any other driver available on PC side (to see data on COM1 port)...?

posted by Ranjith.R Nair 11 Oct 2013

But what is on COM1? You say yourself COM5 is your mbed. So you need to listen on COM5. Data doesn't magically get transported to a random COM port.

So what is COM1 supposed to be?

posted by Erik - 11 Oct 2013
10 years, 6 months ago.

COM1-4 are typically assigned to physical COM ports on a computer, COM5 and up are virtual ones from USB. Most newer computers don't have physical COM ports any more, though some mainboards still have the connectors meaning you can "hack" the ports back in.

Its possible to reassign a USB virtual COM port to a lower number to allow older terminal software to access it.