Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with a project

Status
Not open for further replies.
Ports primer

Hi again Helz15 :)
Ok, let's see if we can get you up to speed with a sort of "computer ports primer"... *very deep breath*

First detail in case you didn't know it: all the ports described here use digital signals of one form or another, rather than analogue. I trust you understand this ok so I won't go into it further here.

RS-232 is the electrical standard used on computer "serial ports", aka "com ports". So the terms are often (perhaps wrongly?) used interchangeably. Most computers will have 2, 1, or maybe 0 (on very modern ones) serial ports! If you have any 9 pin "D-plugs" (see later images) around the back of your computer, probably next to your "parallel port", those would be serial ports. Note that the 2nd serial ports of some MUCH older computers have 25 pins instead, which can make those ones quite easy to confuse with the parallel port :eek: To interface with a serial port, it's easiest to use the MAX232 (or similar) chips mentioned, because RS232 uses quite odd voltages and these chips convert those signals to and from the 0/5V ones we often prefer to use in our circuits. Serial ports have few signal lines: one in either direction for data, which is sent 1 bit at a time, and some others for such details as "flow control". They used to be used for modems, and occasionally for mice.

As you guessed, yes: "parallel ports" are one of the various ones whose connectors have the screws in. They're 25-pin D plugs, and their main use is in connecting (older) printers to the computer, so they're usually just called "printer ports". I mentioned that some very old computers also have 25-pin serial ports- if you have one (you'll see illustrated further on) then you can tell them apart by the gender of the connectors. My own personal, subjective and very very limited experience of interfacing circuits with parallel ports was not too great, but other people have managed ok and plenty of commercial hardware used to use them happily for all sorts of things. There's good reasons why my experience was quite probably irrelevant. Parallel ports use either 0-5V, or 0-3.3V signals (never heard of any other levels but I could be wrong). They have quite a few signal lines, mostly from the computer to the device (because they're mostly for printers).

WHAT THEY LOOK LIKE:

If you have a relatively modern computer with these ports, it should look a bit like this: **broken link removed**
(colours may vary?) Note that the TOP one there is the "parallel port" or "printer port", hence the printer icon. The other two smaller ones are the serial ports, hence the little "binary stream" icons next to them. That coverplate there ALSO has an icon for "monitor" next to one, because they make such plates for lots of different motherboards, and some would have a different connector there! :eek: But VGA monitor sockets do look different enough if you look properly, and you couldn't fit a serial plug into one, so no worries. Eh, unless you bought the wrong type of plug too :rolleyes:

If you have a MUCH older computer, your serial ports will probably look like on this page: https://computer.howstuffworks.com/serial-port2.htm
But that's quite a big "if" :D Obviously though, merely having backplates like that (which almost all PCs have) but with other connectors on them, doesn't mean that those connectors are old serial ports! :D (Sorry if that sounds too obvious)

As I said, I think SOME new computers don't have ANY RS232 serial ports, and maybe no parallel printer ports either! :( USB is a very different sort of serial port (actually a "bus") that is replacing them for most new commercial hardware. But it's much harder (not impossible!) for hobbyists like us to work with :( If you have only USB, and no serial(RS232) or parallel ports at all, you should let us know so we can help figure out what options are available to you. But it sounds as though you do have some anyway??

Ok, sorry that was so very long (maybe I should copy it to a page of my site for future), but it did sound like these details were new to you. Hope it helped! :)
 
Analogue-to-digital convertor

helz15 said:
Ah, so is this 'Dual channel 12bit A/D convertor type MCP3202' like a component that i can add on to my circuit? If it is, that sounds good. If not, how do i use it?
Eh, yes and no, ish. The terms "A/D convertor", "ADC", and various others, refer to an "analogue to digital convertor" (eh, "analog" if you're American I guess). They take an analog signal (normally a voltage, BUT you can get some ADCs which also read a current directly; I don't know if these are as common but it shouldn't matter...) and convert it into digital data (IE: 1s and 0s, expressed in whatever manner), which is then more compatible with your computer's ports. That's not all you'd have to do to get it into the computer, you'd need to get it the right voltage levels etc too and maybe send it in serial (bit-at-a-time) fashion too, but...

As for that "yes and no, ish" answer, well ADCs come in various forms. The MCP3202 mentioned would be a single component to use in your circuit, yes. It'd be an integrated circuit (IC, a chip) like your 555 timer. But you can also get other brands and types of ADC, and you can build them yourself from parts (with effort), and many microcontrollers come with them built-in.

Here, BTW, is another quite different idea, as all this might be getting a bit much for you perhaps, I dunno. You quite surely either have a sound card in your computer, or else on-board sound stuff built into the motherboard. AFAIK, basically all the interfaces for these also have a 15-pin port for joysticks (and also for MIDI), apart from the audio plugs. Yes, it's a bit odd that these are on sound cards, but that's not my fault :D Anyway, the joysticks these work with use variable resistors basically. So the joystick ports are already designed to read analogue levels, if you can get the signals into a form that the ports will like. Your basic programs would PROBABLY be able to read the values from ports, although they'd probably also need calibrating somehow, and I don't know how hard that would be.

I don't know exactly how doable this is though, in terms of hardware or programming. And very little sense of how to go about it. Anybody got any ideas? Could the current be sent directly if suitably scaled? I expect it'd read out nonlinearly if so? :confused:
 
helz15 said:
Ah, so is this 'Dual channel 12bit A/D convertor type MCP3202' like a component that i can add on to my circuit? If it is, that sounds good. If not, how do i use it?

hi heltz,
Has Tomble answered your question OK, or do you want more information?

The MCP3302 connects to the PC's printer port and controlled/output as SPI using a program in the PC.

Get the datasheet for the MCP3202 from www.datasheetarchive.com
 
Thanks Chaps,

I think that is enough information to get me going, but i'm sure i will be back.

Many thanks for all your help, its very much appreciated.

H.
 
Hey cool, good luck! :)

BTW, did anybody have any thoughts on my joystick port suggestion up there? It may easily have got buried in the monstrous heap of info I'd gone and posted :rolleyes: (sorry!)
 
For RS 232 you can use MAX 232 IC, this converts TTL voltage levels to RS 232 +12/-12 levels.

But I think you will still need a mcu for this, as RS 232 sends/receives ASCII characters, you could also develop a program in C to toggle the RS 232 port lines (namely RTS, DTR etc).

If you are not interested in a mcu, you might find the parallel port easy to use, as the port contains several output pins and input pins. Control of these pins can be easily done through software.

thanks
a
 
Hi guys,

I have another question to go with this project.

Will i need a buffer in the computor to store information?
I was thinking of sending the infomation every couple of seconds.

Thanks :p

H.
 
There are multimeters with a port connection built-in. few of them were reviewed in the Elektor magazine in one of their recent issues.
 
mvs sarma said:
There are multimeters with a port connection built-in. few of them were reviewed in the Elektor magazine in one of their recent issues.

Does this mean if i replace the AVO (to measure current) on my circuit with a resistor and measure the voltage over the resistor using one of these mulitmeters i can basically plug it straight into the computer?

If this is the case, this sounds excellent, however, i don't think i will be able to do that, as this is a college project and it may make it a bit to 'thin on the ground'.
Although it may be good for testing the initial part of my circuit.

I may have simplified this too much, but it think the basic stages involved in my project are:

- Set up the circuit as shown in the diagram (attached to a previous post)
- Replace the AVO with a resistor (don't know what size) to get a voltage reading.
- use an A/D converter (although i think this is in the chip)
- use a MAX232 chip to make it that RS232 thing
- plug into parrallel port
- use a buffer to store data

Have i understood what i have been told, or am i missing something?

I was also reading through other posts to see if i could find anything simular and i found one where someone was talking about using an AVR or PIC microprocessor as a local controller.
It said this would do the A/D conversion at a specified interval and log the data.
Would this be suitable for my project?

Thanks.
 
try ICL7109 applications and it should be possible to make a device to work with PC
 
Damn, sorry, I've been busy with my own "computer ports" problem (*shudder*) for the past week or so, so I've not been on the site.

A very quick answer whilst I have time:
-You only need to get RS232 voltage levels if you're interfacing with a SERIAL port. DO NOT use a MAX232 or similar to interface with a parallel port!!!! I don't know whether they'd go "bang" or not but regardless, it isn't correct. Parallel ports work with normal 0-5V levels.
-You normally only need a buffer in the computer if you're receiving data that is in some way serial.
-In the case of receiving data through the serial ports themselves in the standard serial port transmission method, there are buffers already in the port, you just set the right speed etc, and read what the operating system gives you. You don't "create" a buffer!
-In the case of reading individual pins of the serial port directly, you bypass the buffer, but you won't be doing this in your case. That's for weird applications.
-In the case of the parallel port, AFAIK there is no buffer built into the port, but USUALLY you don't need one. If you're sending data 4 bits at a time (out of 8 or 10 bits per word to be sent), you would need some software buffer in your receiver program, to reassemble the sample data. This could get messy.
-If you're transmitting the sample data through the parallel port 8 or so bits at a time, you don't need a buffer, you just need to do whatever you want to do with the data, like send it to a file or something. I'm not sure what you're doing with it.

IMPORTANT BIT:
If you're sending the data serially (either 1 bit at a time through the serial port, OR 4 bits at a time over the parallel port), then you most likely need to use a microcontroller, else the hardware will get pretty complicated. The pro side of this is that many microcontrollers have built in ADC, so less components for that. The con of it is that you'd need to be able to program the thing.

If you're not going to do that then you should do as various people had suggested and use a separate ADC chip and send it through the parallel port. Presumably this requires setting the parallel port to be ECP or EPP or bidirectional or whatever the thing is, to be able to send more than 4 bits back to the PC, because AFAIK the "standard printer port" type arrangement doesn't allow for that. I expect someone else can explain that bit.

Now, can someone else fill in the blanks on that? Because I'm not sufficiently knowledgeable about parallel ports, and am rather tied up with this networking crap I have to work on. :(
 
Oh I am really getting myself confused, I underestimated how hard this was going to be. :confused:

Ok, so I need to decide if I am using the serial or parallel port before I start making things go bang! :eek:

So if I was to go down the rout of the serial port, then I will need a chip that has an A/D converter and makes the RS232 voltage levels.

Now I don’t know anything about programming microcontrollers, but this is a college project, so I will find out what microcontrollers the college have the facilities to program (as I am assuming you need equipment to do this?)

So then, the basic stages involved in my project will be:
Set up the circuit as shown in the diagram (attached to a previous post)
Replace the AVO with a resistor (don't know what size) to get a voltage reading.
Find a chip that makes it RS232
Use a microcontroller (with A/D converter)
plug into Serial port

Then I am hoping I will be able to see the voltage reading in a computer program such as Visual basic (or any other easily available computer program).


Thanks for being so patient with me!
 
helz15 said:
Oh I am really getting myself confused, I underestimated how hard this was going to be. :confused:
Well, I may have made things SOUND more confusing than they need to be. If so, sorry :D

Ok, so I need to decide if I am using the serial or parallel port before I start making things go bang! :eek:
Well yes, each port is dealt with pretty differently in numerous ways.

So if I was to go down the rout of the serial port, then I will need a chip that has an A/D converter and makes the RS232 voltage levels.
IF you go down that route, then you'd have to have those things, but they wouldn't have to be in the same chip. You'd probably have a microcontroller with the A/D converter, and that'd send out serial data at "TTL logic levels" (0-5V), and then feed that to a MAX232 type chip to get the RS232 voltages. But that remains an "if". Other people's suggestion of using the parallel port would probably be better, depending on what you can do.

Now I don’t know anything about programming microcontrollers, but this is a college project, so I will find out what microcontrollers the college have the facilities to program (as I am assuming you need equipment to do this?)
The hardware for programming PIC microcontrollers, if you use those, can be relatively simple. But you also need various pieces of programming software, and to know a language you can effectively program the chip with. So if you don't have ANY experience with microcontrollers, then you might get terribly bogged down with all this, which would be a very good reason to use the parallel port approach instead, if you can. OR maybe that gameport approach might be workable somehow? :confused:

So then, the basic stages involved in my project will be: (...)
If you were using the serial port approach, it would be VAGUELY like that, but it looks somewhat out of order. Gimme a little while and I'll knock out a simple diagram (not schematic, sorry). It might clarify things.

Meanwhile, as this is cropping up and I keep forgetting to ask: Can you program, and if so, in which languages?
 
As far as programming is concerned, technically, no I cannot program, however, my brother is a computer programmer and is willing to ‘help’ me with that bit, he can program in Java, PL/SQL, Ruby, PHP, C#, and a bit in VB.

I am happy to change to using the parallel port if you think that would be easier for me, I really am happy to go down the route you think is best/easiest.
 
Block Diagram

Ok, as I'd gone and made things overly confusing, here's that diagram. It doesn't include the software on the PCs I'm afraid. View attachment serial-vs-parallel.pdf

FWIW if it's not clear, it's probably best to go for the parallel port method, if there's something that can read it effectively. Or else perhaps some sort of commercial "signal logger" type device, which might come with its own software? :confused: I don't know. I most probably shouldn't have even mentioned the serial port approach in the first place, that's just what usually seems easiest to me, but you're not me! :D The parallel port has its issues but they might not be a problem for you.

It's also probably a very good idea to ask your teachers what they'd recommend, as they'd probably have a better idea what you'd be able to deal with and what your computers could use. Your college might even already have a signal logger like I described!!

(Oh, or Bill's idea there might be good, if your college has one of those; I'd imagine they're expensive to buy yourself?)
 
Ok, thanks very much for your help!
That diagram helps alot!!!!

I am at college tomorrow, so i will ask some questions and get back to you.

Thanks again!
 
First: Nater, please start a new thread of your own to ask for help. Go to one of the forum pages here, such as https://www.electro-tech-online.com/forums/general-electronics-chat/, and click the button that says "New Thread". When you start your new thread, please be sure to explain what your problem actually is too :rolleyes:

Second: Helz15, if you're still reading, I dunno if you got anywhere with asking your teachers for advice, but I must say that Overclocked's suggestion of that data logger is a very good one. I couldn't remember the proper term before, but from what little I've seen of such things in the past, that one is a really good price (about £12?). It would probably save you a ton of bother, if the college doesn't already have some equivalent for you to use :) No need to worry about building your own PC interface that way.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top