Serial interface RS-232 C# app data recive issue
-
Sry for the wierd title. I made a simple program to dump data from a serial COM port. My question is how to wire the device to the serial female port so that the computer can recive the data. I am using a parallax Ping))) sensor that is already programmed to a basic stamp microcontroller. If i run the signal wire to the serial port pin 2, will I need to attach serial port pin 5 (signal ground) to the ground on the microcontroller in orderto recive a signal in the com port? The ping has an onboard A/D converter so the data is digital. P.S. If analog "data" is sent into the serial port raw, will it be converted by to computer or will bad things happen (i.e. nothing).
-
Sry for the wierd title. I made a simple program to dump data from a serial COM port. My question is how to wire the device to the serial female port so that the computer can recive the data. I am using a parallax Ping))) sensor that is already programmed to a basic stamp microcontroller. If i run the signal wire to the serial port pin 2, will I need to attach serial port pin 5 (signal ground) to the ground on the microcontroller in orderto recive a signal in the com port? The ping has an onboard A/D converter so the data is digital. P.S. If analog "data" is sent into the serial port raw, will it be converted by to computer or will bad things happen (i.e. nothing).
The subject line was quite OK. However this is not a C# question, so you're in the wrong forum. yes, you must connect the GND pin of the PC serial port to the GND potential of your peripheral. no, you can't feed analog signals into your PC's serial port. yes, you can cause permanent damage when treating your serial port pins badly. since you feel the need to ask, don't try this on your motherboard's serial port, as repairing it would be expensive; use either a plug-in serial card or a USB-to-RS232C cable instead. PS: there are several CodeProject articles that discuss the use of serial ports. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
-
Sry for the wierd title. I made a simple program to dump data from a serial COM port. My question is how to wire the device to the serial female port so that the computer can recive the data. I am using a parallax Ping))) sensor that is already programmed to a basic stamp microcontroller. If i run the signal wire to the serial port pin 2, will I need to attach serial port pin 5 (signal ground) to the ground on the microcontroller in orderto recive a signal in the com port? The ping has an onboard A/D converter so the data is digital. P.S. If analog "data" is sent into the serial port raw, will it be converted by to computer or will bad things happen (i.e. nothing).
You will need to convert the logic-level (5 volt) signals from the microcontroller into the RS-232 level signals that the computer requires. See this article about the very useful MAX232 chip: http://en.wikibooks.org/wiki/Serial_Programming/MAX232_Driver_Receiver[^]