Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 21st, 2005, 5:26 AM   #1
shadowhunter
Programmer
 
shadowhunter's Avatar
 
Join Date: Dec 2004
Location: Scotland
Posts: 66
Rep Power: 4 shadowhunter is on a distinguished road
Lightbulb Printer Port Programming

Hi all,
I am back again with another project for Uni.

My dilemma is that for a project I need to connect a circuit to the pc via an Interface card.

C++ is to be used in order to control the Printer port which connects said Interface card. C++ is how the disapated power in a small light bulb on the circuit will be controlled.

All I am asking is if anyone has any idea how I will go about this.

If anyone has any ideas I would be very grateful for the help.
shadowhunter.

Last edited by shadowhunter; Feb 21st, 2005 at 7:26 AM. Reason: Does not sound right
shadowhunter is offline   Reply With Quote
Old Feb 21st, 2005, 7:12 PM   #2
Light
Newbie
 
Join Date: Feb 2005
Location: USA, Western States
Posts: 4
Rep Power: 0 Light is on a distinguished road
Port Interface

First you have to decide which printer port you are going to use. I have a similar project in which I want to control external equipment from the serial port.

My problem is that my C tutor book tells me that the "Std Aux" function will allow me to send data through the serial port Com1. However, it does not help me with a description of the function or how it is used. See my thread and project. Light

May be the following will help you. It has been a while since I read and studied this but here goes. From a engineering stand point your computer's connection to the outside world is via either serial com ports (com1 and com 1) and the parallel port.

Information inside your computer is transfered via serial and parallel chips that move data or program instructions through the system and is controlled by a program running in the micro processor. The processor and all the digital devices are run by a master clock that generates a serial stream of clock bits that times all the transfers of data throughout the processor and other mother board circuity. This is all digital. Instructions and data is grouped by words that are addresses and words that are data.

In the processor most data is transfered in parallel because it is so much faster and more efficent.

When your program code moves data from the memory to a port it can go out as either a serial stream or a parallel stream of bits which are words. If it is to be presented as a parallel output it is put in a chip that allows the data to be transfered outside via a multiple output pin chip. To accomplish this the data is moved to a specific port and then an external parallel cable (under 20 feet) is hooked to you external card or device that you are sending the data to. The data must then be latched in with a hand shake (signal) between your card and the parallel port of the computer.

Like wise the serial ports each have a device that shifts data out as single bits one at a time that make up a word. The receiving card or cards( or circuit) at the other end of the cable or along it (which can be several hundred feet long) picks up the data stream and each card can decode its address and latch the words that belongs to it onto the card. There does not have to be a hand shake if all you are doing is sending data to the card. However, it can be set up to operate as both an input and transmitting port so that data can go both way.

To send data out the parallel port you will need to understand the protocal for data transfer using it. If you need information on how that protocal works I can probably find a book that you could use to build the interface needed.

Mean while if you can give me any ideas on my problem please read my post under C forum. good luck - Light
Light is offline   Reply With Quote
Old Feb 26th, 2005, 10:15 PM   #3
Light
Newbie
 
Join Date: Feb 2005
Location: USA, Western States
Posts: 4
Rep Power: 0 Light is on a distinguished road
Shadow Hunter:
Beside the information already provided think about this.

After rereading you message I think the answer you are looking for is to vary the voltage being fed to the bulb (on your circuit card) and thus you will increase the current flow. This will cause the light brightness to change.

One option you might try investigating is to use a digital to analog chip. You write a program that will allow you to output data over one of the computer output ports. That will allow you to feed in a digital code to an outside chip that controls an analog circuit. That chip will allow you to control the current flowing throught the bulb. ( Ie by increasing the voltage you drive more current through the circuit with the bulb).

Light
Light is offline   Reply With Quote
Old Feb 28th, 2005, 4:16 AM   #4
shadowhunter
Programmer
 
shadowhunter's Avatar
 
Join Date: Dec 2004
Location: Scotland
Posts: 66
Rep Power: 4 shadowhunter is on a distinguished road
Smile Printer Port Programming [Solved]

This thread has been solved I just can't remember how to change the title.
Thanks for all of your help,
shadowhunter

Last edited by shadowhunter; Feb 28th, 2005 at 4:18 AM. Reason: can't rememmber how to change main title
shadowhunter is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC