LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   TLC549 A/D-Converter communication in C (https://www.linuxquestions.org/questions/programming-9/tlc549-a-d-converter-communication-in-c-559715/)

dopehouse 06-06-2007 04:52 PM

TLC549 A/D-Converter communication in C
 
Hi Folks!

At school we build a temperature gauger. The device is connected to the serial port and uses the TLC549 A/D-Converter. The board layout can be found at http://www.wvss-projekte.de/index.ph...ekte&prj=tmess sorry, it's only in german. Our teacher has made a program for that device, but it's only for windows (runs in wine, too) but I want to program a Linux native version.

My problem is, that I don't know, how to communicate with the TCL549 with the Linux (POSIX) functions. I found a kernel modul, but that's not running with the 2.6 Linux Kernel.

Another try was with the outb, inb and ioperm functions, which gave me a segmentation fault as root and no connection as normal user.

A second try was with the open and fnctl functions. But I don't know how to change the state on specific lines of the serial port.

I hope, that someone has a solution for that problem.

PS: It's the first time that I make a program on this low level (near the hardware).

macemoneta 06-08-2007 02:37 AM

You can use this example to get you started. For more examples, use Google.

dopehouse 06-08-2007 05:41 AM

Thank you for your answer. But in the meantime I already found some code examples and the program I wrote is nearly ready. If it's ready, I'll post the sources here. But it can take a few days, because I'm on a holliday trip ne for 1 week.

dopehouse 06-13-2007 10:15 AM

If you're interested in a library to communicate with the TLC548/549 family of A/D-converters, you can now visit http://sourceforge.net/projects/libtlc54x and get a copy of the library I build to get my device working.

If want to build the temperature gauge from http://www.wvss-projekte.de/index.ph...ekte&prj=tmess you can use the following tool and the library, to get the temperature data. http://www.dopehouse.dyndns.org/Software/T-Mess-Linux

The tool shows the temperature in celsius, but it's easy to show it as fahrenheit. You just need to convert celsius to fahrenheit.

°F=(°C*(9/5))+32


All times are GMT -5. The time now is 02:51 AM.