LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 10-30-2007, 05:12 PM   #1
damip
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Rep: Reputation: 0
Unhappy USB-RS232 communication problem (I think)


Hello,
This is my first *real* message on this forum.
I've built an analog->digital circuit using a PIC16F876.
It looks like this :
http://82.246.130.67/numer_circuit.jpg
It is 5V-powered and uses a 4MHz quartz.
Here is the PIC C code :
http://82.246.130.67/prog.txt
Now, I'd like to connect it to my laptop (Lenovo 3000 c200 ; ubuntu gusty gibbon). As I've not any serial port on this computer, (I've only got USB ports), I've bought a USB->RS232 adapter. It seems to be recognized, and a device, /dev/ttyUSB0 is created. Finally, I give me all rights on it.
I've also created a C program that will show the curves of the analog PIC inputs in realtime.
Here it is :
http://82.246.130.67/graphe.tar.gz
It is coded using code::blocks ide and uses SDL to display the curves and standard IO functions on my usb serial port (open, read, write).
Now, there is a small problem in all that :
IT DOES NOT WORK
Nothing is received by the program while the PIC is constantly sending data on the serial port.

Please help me.
I've been searching for the problem for 12 days...

Thank you.
 
Old 10-31-2007, 09:57 AM   #2
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
have you tested the usb-2-serial converter to ensure everything is working as expected ?

Use minicom and an external modem, or hook up a loopback on the serial port and test...

Loopback wiring diagram

Loopback plug
 
  


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
Serial (RS232) communication is one-way anroy Linux - Hardware 5 08-25-2007 02:35 PM
usb / rs232 drivers anoopn@ieee.org Programming 2 01-16-2006 03:26 PM
USB communication problem dasw127 Linux - Hardware 0 08-23-2005 04:28 AM
USB>RS232 versus PCMCIA>RS232 jayhel Linux - Laptop and Netbook 2 08-04-2005 07:09 PM
USB - Serial RS232 Adapter blox Linux - Hardware 3 01-28-2005 11:58 AM


All times are GMT -5. The time now is 12:54 PM.

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