LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 06-17-2005, 10:29 AM   #1
ecsed
Registered User
 
Registered: Jun 2005
Location: Graz/Austria
Distribution: RedHat Linux
Posts: 11

Rep: Reputation: 0
Question Erroneous PPC SIO Tx-driver


Dear Madam, dear Sir, ECS.ed.2005.06.17

below I give you some details to my MPC885 SIO-driver implementation, 3 test examples and some questions. Could your hardware/software engineers please give me some hints how to overcome the problem?

Implementation:
- configuration as described previous to read()/write() operations
- write() operations in a separate write-thread
- read() operations in a separate read-thread
- 38400 Bd, 8N1
- OS: Linux 2.4.26 für PPC

Example 1:
exactly 10 characters handed over to SIO by POSIX write (rCmd->sioHandle, ...): "0123456789"
exactly 22 characters monitored at the DCE-pin of the SCC-UART: "0123456789^@0123456789"

Example 2:
exactly 2 characters handed over to SIO by POSIX write (rCmd->sioHandle, ...): "01"
exactly 6 characters monitored at the DCE-pin of the SCC-UART: "01^@01"

Example 3:
exactly 5 characters handed over to SIO by POSIX write (rCmd->sioHandle, ...): "01234"
exactly 12 characters monitored at the DCE-pin of the SCC-UART: "01234^@01234"

Q1: Why does the >>POSIX-driver<< repeat the output character sequece plus "^@"?
Q2: Why does the >>MPC-SCC hardware<< repeat the output character sequece plus "^@"?
Q3: Are there other reasons for that behaviour than configuration errors or hardware features?

Thank you for your help.
Best regards
Egon

-------------
fcntl (sioHandle, F_SETFL, O_ASYNC);

sioConfigData.c_cflag = CLOCAL | CREAD;
sioConfigData.c_cflag &= ~PARENB;
sioConfigData.c_cflag &= ~CSTOPB;
sioConfigData.c_cflag &= ~CSIZE;
sioConfigData.c_cflag |= CS8;

sioConfigData.c_iflag = 0;

sioConfigData.c_oflag = 0;
sioConfigData.c_oflag &= ~OPOST;

sioConfigData.c_cc[VINTR] = 0;
sioConfigData.c_cc[VQUIT] = 0;
sioConfigData.c_cc[VERASE] = 0;
sioConfigData.c_cc[VKILL] = 0;
sioConfigData.c_cc[VEOF] = 0;
sioConfigData.c_cc[VTIME] = 0;
sioConfigData.c_cc[VMIN] = 1;
sioConfigData.c_cc[VSWTC] = 0;
sioConfigData.c_cc[VSTART] = 0;
sioConfigData.c_cc[VSTOP] = 0;
sioConfigData.c_cc[VSUSP] = 0;
sioConfigData.c_cc[VEOL] = 0;
sioConfigData.c_cc[VREPRINT] = 0;
sioConfigData.c_cc[VDISCARD] = 0;
sioConfigData.c_cc[VWERASE] = 0;
sioConfigData.c_cc[VLNEXT] = 0;
sioConfigData.c_cc[VEOL2] = 0;

retCode = tcsetattr (sioHandle, TCSADRAIN, &sioConfigData); ...
-------------
sioHandle = open (devString, O_RDWR | O_NONBLOCK | O_NOCTTY); ...
-------------
bytesRead = read (rCmd->sioHandle, rxBuffer, MAXIMUM_SIO_READ_BUFFER_LENGTH); ...
-------------
if ((i = write (rCmd->sioHandle, rCmd->data, rCmd->dataLength)) != -1) ...
-------------
 
  


Reply


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
mandrake 10.2 for ppc PerfectHairForever Linux - Newbie 7 06-30-2005 10:58 PM
erroneous touchpad behavior Mr_C Linux - Laptop and Netbook 2 04-10-2005 07:24 PM
Mobility ATI 9700 driver for MDK PPC? cbenson Mandriva 1 02-05-2005 12:09 AM
yellowdog PPC catizirto Linux - Newbie 11 10-12-2003 05:06 AM
vmware + ppc BTseapig Linux - General 1 11-06-2002 05:57 PM


All times are GMT -5. The time now is 07:35 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration