LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-24-2018, 10:07 PM   #1
cdr_nitjsr@yahoo.com
LQ Newbie
 
Registered: Oct 2012
Posts: 10

Rep: Reputation: Disabled
serial port and parallel port signal types


Hi friends.
I want to know what is the basic diff between output of par and serial port of a Pc. As i know that serial port understands only ascii data and not non ascii(level signal). pralallel ports give non ascii output ie Ttl level signal. please tell me im right or wrong. Can seral ports also understand non ascii data ??. these are my doubts.
 
Old 05-25-2018, 12:22 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Rep: Reputation: 270Reputation: 270Reputation: 270
Data is data: ASCII is a way to interpret data: it's all just numbers. Parallel and serial ports carry data. Serial ports carry it 1 bit at a time; parallel ports carry it 8 bits at a time. Despite this, parallel ports were never much faster, and just about every other communication protocol (e.g., USB, SATA) carries data serially.

Are you really using serial and parallel ports? I haven't seen a new computer with them in 10 years. They're so much slower and flakier than everything else.
 
1 members found this post helpful.
Old 05-25-2018, 07:35 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,593

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
Yes. Signal levels have nothing to do with the actual transmitted data. Original RS-232 is +/- 15 VDC ( actual voltage depends on hardware) and the parallel port is TTL 0-5 VDC. While the typical serial port setting uses 8 bits that means the actual data can be anything from 0x00 - 0xff.
How you interpret that data is up to you.
 
1 members found this post helpful.
Old 05-25-2018, 01:41 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,939

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
Kind of a confusing question. The common serial port on a PC is controlled by a UART chip. Each model of computer may have slightly different uart's. That uart chip design is the key to how it can be used rather than the way the signal is inputted or outputted.

In a very simple sense, a serial is a bit by bit per clock while parallel is a set of signals per clock.

Again the features of the pc design could dictate all sorts of variations on power and current and timing.
 
1 members found this post helpful.
Old 05-25-2018, 04:04 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
I still use parallel port. Although I recently got a usb to parallel port adapter, so I could throw out the tank of an old machine. Although I only got it to use my tank of an old printer. Which I assume pre-dates the days of vendor locked print cartridges that think they're empty at 20% left. With an RPi 3B+ as the print server, which is about the size of one of the print cartridges.
 
1 members found this post helpful.
Old 05-25-2018, 08:25 PM   #6
cdr_nitjsr@yahoo.com
LQ Newbie
 
Registered: Oct 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
So can i write program on pc to output irig-b signal output. I have seen that people mostly use printer port or par port for output a Irig signal . can we use serial port for the same.?
 
Old 05-25-2018, 09:20 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,593

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
Not really. IRIG-B unmodulated signal is typically a TTL signal which is why the parallel port is used. The serial port is a +/- signal level which probably will not work.
 
1 members found this post helpful.
Old 05-27-2018, 04:45 PM   #8
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,671

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
The parallel port on a PC was also known as the Centronics port, taking its name from the Centronics company which sold dot matrix line printers. The port supplies eight bits plus a strobe bit which is used to clock the separate eight bits into a register within the printer so it could be decoded into which wire in the seven bit printhead "fires" to mark the paper. A character matrix of 7 x 5 dots was common. Centronics folded in 1987.

Parallel data transfer requires that the data bits are clocked to de-skew the information. (transmission of multiple bits down a parallel cable can mean that due to propagation delays in the cable, the data pulses can arrive at their destination at slightly different times, the clock or strobe pulse samples the data on the bus and de-skews it.)
The faster the data transfer speed, the greater chance the data will be incorrectly de-skewed causing corruption.

I believe the parallel port was capable of 150Kbits/sec

As mentioned above parallel data transfer to and from peripherals is now mainly via serial links as greater speed can be achieved. eg. PATA drives have been superseded by SATA, fibre links are mono directional serial with an RX and TX fibre, ethernet, including WiFi is serial.

My

Play Bonny!

 
Old 05-27-2018, 07:08 PM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
There is an important difference in the parallel and the serial port from a hardware point of view. Although you could theoretically access a few serial signal lines like RTS and CTS, the actual RxD and TxD cannot be accessed. You send a byte to the serial port, it is serialized and sent. The serializing is performed in hardware. You can write a byte to the serial port, and further than that you cannot access. Some serial chips allow you to set the handshake lines programmatically, other do not.

The lines of the parallel port however can be accessed individually. Note however that in Linux only kernel drivers have access to the hardware. You'd need a driver which is able to access the parallel port. I am not sure if these drivers are available by default in a normal installation, or that you have to use something like the Comedi drivers. Normally the printer port is controlled through the LP device, which is not suitable in your case.

What hardware will you use? Current PC's do not have serial and parallel ports anymore. Unless you install an interface card. You might consider the Raspberry Pi which has digital I/O. There are driver API's available for various languages.

jlinkels
 
Old 05-29-2018, 01:07 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,939

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
OP, are you trying to take some GPS box and input time into a pc?
 
Old 05-29-2018, 03:10 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,593

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
Quote:
Originally Posted by cdr_nitjsr@yahoo.com View Post
So can i write program on pc to output irig-b signal output. I have seen that people mostly use printer port or par port for output a Irig signal . can we use serial port for the same.?
I assume the OP wanted to create a Time Code Generator but never really posted exactly what they really need i.e. modulated or unmodulated signal or why then needed IRIG-B. With any serious project I would purchase a GPS TCG.

I found a program many years ago that was written for BSD that used the audio output to generate an IRIG-B modulated signal but didn't take to time to debug it and get it to compile with linux.
 
Old 05-29-2018, 05:34 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,939

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
Thanks for correcting me on that.
 
Old 05-29-2018, 06:11 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,593

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
Don't thank me yet. I've been wrong a few times...

IRIG-B is basically a series of pulses of varying widths that define reference points, binary 0 and binary 1. As stated earlier unmodulated code is a TTL signal which requires only one signal pin. NTP does have an audio driver to decode an IRIG-B signal but using GPS is more accurate.
 
Old 05-30-2018, 10:57 AM   #14
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
PATA was formerly known as IDE, which renamed circa 2006-ish.
 
Old 06-02-2018, 08:09 AM   #15
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
Quote:
PATA was formerly known as IDE, which renamed circa 2006-ish.

And has nothing whatsoever to do with serial or parallel communication.

Parallel ports tend to be information only whereas serial ports are often used in direct control of ancillary hardware.

Last edited by dave@burn-it.co.uk; 06-02-2018 at 08:11 AM.
 
  


Reply

Tags
linux, serial port


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
serial v/s parallel port sagitalk Programming 7 02-26-2009 10:33 AM
Parallel Port & Serial Port device identification helpmeforlinux Linux - Hardware 3 01-02-2007 01:15 AM
Serial/Parallel/Game Port Interfacing sparkyssb Programming 8 06-29-2006 01:41 PM
serial and parallel port with DMESG command froglinux Linux - Hardware 1 06-16-2006 08:51 PM
serial/parallel port marco_aq Linux - Networking 1 10-12-2001 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration