[TriLUG] C linux programming question

karl thiele karlthiele at nc.rr.com
Sat May 24 23:45:02 EDT 2003


Is it possible? yes. Done it from application and kernel space. Hey 
folks these all are interesting answers but there are devices just for 
this type of work called PLCs that work in many voltages and amps. PLC's 
are most often connected via RS-232 with some simple protocols. Now a 
PLC is a bit of overkill for a single state change in logic, but 
designed to work in. It would cost too much for this. I would also 
suppose there is a simple device that could be bought to sense the 
voltage drop and so indicate via raising/lowering a pin on RS232, simple 
ioctl can then detect that.  (change to software) You could make a 
pseudo device to monitor the state, then have an outstanding blocking 
read on the device, when the state changes the device returns the read. 
(back to hardware) I bet this would not take long to actually build a 
hardware device. Just have convert voltage/amps from the "always-on" to 
the correct voltage/amps on the rs-232. I can see we have no electrial 
engineers in this discussion. Do you want a device? Interesting enough 
for me to build one, give the the voltage and amps of the "always-on". 
 What is this "always-on" device? You will need to do a fair amount of 
conditioning from the car's electrical to your embedded board, check to 
see if the power supply for your car's computer can be used, maybe there 
is an aux power source plug. What is the "only on when running" pin? 
What is running?

interesting,

-karl

Greg Brown wrote:

> Hey all.  Is it possible, using C, to monitor voltage on one pin of a 
> serial port when voltage is supplied from an outside source or do I 
> have to knuckle under and learn some assembly for this task?  What I'm 
> after here is with an embedded linux machine mounted in a car and I 
> want to have power supplied by an always-on supply in the car.  I'd 
> also like to have a pin on a serial port connected to a "only on when 
> running" wire (somehow).  So when the voltage drops to zero on the 
> "only on when running" pin the embedded device will shut itself down 
> automatically (the device would be turned on manually via an "on" 
> button).
>
> Is this theoretically possible using C?
>
> Greg
>
> _______________________________________________
> TriLUG mailing list
>    http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
>    http://www.trilug.org/faq/TriLUG-faq.html
>





More information about the TriLUG mailing list