CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RS232 on laptop and
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Gon
Guest







RS232 on laptop and
PostPosted: Wed Feb 15, 2006 3:32 am     Reply with quote

Hello,

i have a little problem with RS232 on 2 computers :

When i try to get some ascii characters on a laptop with the serial port monitor, my PIC18F458 gets them with no problem with getc() function.

But when i try to do exactly the same thing but with my PC, it is not working at all...

Is there something that must be done for my PC to work like the laptop ?
Is there a difference of voltage level or something pretty much like this between these two computers?

Please let me know.

Many thanks.

Best regards.
Ttelmah
Guest







PostPosted: Wed Feb 15, 2006 6:26 am     Reply with quote

Are you sure you are talking to the right port on the PC?. Normally the problem tends to be the other way round, with laptop serial ports often tending to use slightly 'sub standard' voltages, and having an extra 'invisible' port at COM1, which drives the infra red communications, rather than a real port.
Disconnect your PIC circuit, and connect pin 2 on the PC com port, back to pin 3. This 'loops' the transmitted data back to the receive line. If you send with echo turned on, you should see every character appear twice, or if you send with echo turned off, you should see the characters once.
Check in control panel, that handshaking for the port is set to 'disabled', or 'XON/XOFF'. If this is not done, the port may be waiting to see an external handshake signal, that is not there.

Best Wishes
Gon
Guest







PostPosted: Wed Feb 15, 2006 7:41 am     Reply with quote

Everything is ok with the COM1 beacuse i only have one port on my PC, really similar to a laptop that has only one serial port which is COM1.

Quote:
Check in control panel, that handshaking for the port is set to 'disabled', or 'XON/XOFF'


Where is the control panel ? Is there something that would be changed in the PC to allow the COM1 ?

Many thanks.
Best regards.
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Wed Feb 15, 2006 7:57 am     Reply with quote

Assuming WindowsXP:

Start -> Control Panel -> System -> Hardware -> Device Manager -> Ports

Right click COM1 and select the Settings tab.

If you have an older version, it may be Start -> Settings -> Control Panel ...
_________________
The difference between genius and stupidity is that genius has its limits...
Gon
Guest







PostPosted: Wed Feb 15, 2006 8:04 am     Reply with quote

Hello,
thanks for help.

Still not working ...
Any other suggestion ?
Ttelmah
Guest







PostPosted: Wed Feb 15, 2006 8:20 am     Reply with quote

What is actually shown under the ports tab in control panel?. If it shows more than one com port, it may well be that your motherboard actually has two ports, but only one has an external connector!...
To change the handshake, double click on the port, then select 'port settings'. At the bottom of the entry list here, there is the handshake setting. Also below it, is a tab 'advanceddddd', and if you select this, you can set the actual port 'name' to be used.

Best Wishes
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Wed Feb 15, 2006 8:23 am     Reply with quote

In the Device Manager, was there a yellow circle with an exclamaton point in it over the COM1 line? This indicates that there is a problem with it.

Is the COM1 port enabled?

Have you ever used the COM1 port on your PC before for other things?

Is the COM1 port on a PCI serial port card rather than the motherboard itself? If it is a really new PC, the motherboard may not have a serial port connector and the serial port is provided by a plug in PCI card. I have had problems with this in the past.
_________________
The difference between genius and stupidity is that genius has its limits...
Gon
Guest







PostPosted: Wed Feb 15, 2006 8:34 am     Reply with quote

There is only one port COM on this motherboard.
There is no Exclamation point in the device manager.
I use the COM1 with the bootloader TinyBootloader with no problem to update the software, i can see what is coming from the PIC with the serial port monitor, but i can't 'send' any ascii character. The PIc doesn't 'see' any character sent.
There is only one other port which is the parallel port and is not used.

I tried Xon/Xoff and disabled for settings but still not working.

I suppose it should be a hardware feature but how could you explain that with a laptop there is no problem but with my PC, it is not working ...
Ttelmah
Guest







PostPosted: Wed Feb 15, 2006 8:45 am     Reply with quote

How is the circuit wired.
The obvious difference between the laptop, and the desktop PC, is that the latter, generally will have the case grounded, while the laptop will 'float', providing full isolation. You may have a problem, depending on how your PIC circuit is powered/connected.

Best Wishes
Gon
Guest







PostPosted: Wed Feb 15, 2006 8:59 am     Reply with quote

I don't really know what i can even do, because the circuit is wired as you mentionned before, on pins 2 and 3.

I have the ground which is on pin 5.
Do you think the serial port cable (which is different for the desktop computer cable and for the laptop) could be a problem ?

They are 2 different cables but they look the same ...
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Wed Feb 15, 2006 9:17 am     Reply with quote

I would try the cable you used with your laptop on your PC. There is a chance the other cable is broken or is a null modem cable.
_________________
The difference between genius and stupidity is that genius has its limits...
Gon
Guest







PostPosted: Wed Feb 15, 2006 9:22 am     Reply with quote

Ok,
i'll try then but i am not that sure that this would solve my problem.
If any other idea comes to your mind, let me know about it.

Many thanks anyway !
Ttelmah
Guest







PostPosted: Wed Feb 15, 2006 4:23 pm     Reply with quote

Gon wrote:
I don't really know what i can even do, because the circuit is wired as you mentionned before, on pins 2 and 3.

I have the ground which is on pin 5.
Do you think the serial port cable (which is different for the desktop computer cable and for the laptop) could be a problem ?

They are 2 different cables but they look the same ...

What I was asking about, is the actual wiring inside the unit (not just the serial connections), and in particular, how is the unit supplied with power?. The point is that if the PIC unit is itself earthed at some point, as is the PC, then you may be generating a 'ground loop', on the desktop PC, which would not occur on the laptop. How is the RS232 interface handled?.

Best Wishes
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Wed Feb 15, 2006 10:03 pm     Reply with quote

Hi,

The voltage level on a PC is +/- 12 and on the laptop it is +/- 5 V.

thanks
arunb
Ttelmah
Guest







Re: RE:
PostPosted: Thu Feb 16, 2006 4:13 am     Reply with quote

arunb wrote:
Hi,

The voltage level on a PC is +/- 12 and on the laptop it is +/- 5 V.

thanks
arunb

That is not necessarily the case. However it is common.
Hence my question about how the RS232 is handled.
If a proper RS232 buffer is being used, this should not matter, but if he is using one of the 'resistive/diode' clipper type connections, and even worse if there is a grounding problem somewhere, then the translation could be completely screwed....

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group