INP and OUT Port

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

INP and OUT Port

Post by danner »

I am going to wire a keypad to the lpt1 port. does anyone have an example of how to write this? I have read up on it, that the Data Register for LPT1 is address 0x378, but the INP command only accepts integers. I did a test with nothing conneced.. tried INP(378) and it returned a result of 255. 379 I also get 255 returned... 1 I get 170 returned.. 10 I get 0, 50 I get 255, 100 I get 20.. I just can't make sense of any of these. How do I know I have referenced the right port?

Is there anyone here who has used QB 4.5 to communicate to a home made device through the printer port?

I am using Windows 98. The program is for recieving input from an external keypad, then it compares it to a database.. and time zone.. and either grants access or not.. and records the event in a history file. The program works fine on just the computer.. ie... input from the computer keyboard.. and output to the screen. Now I need it to be able to communicate to the external devices for the input and output.

Thanks for the help.

Danner
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Follow up

Post by danner »

Ok.. the index help in the program is wrong.. in the sense that it does not have to be a number. I tried an Oh... O instead of a zero 0.. and for Ox378.. and Ox379.. and Ox37a I get a return value of 170 for each of them. Nothing is connected to the port at this time. Can someone help me understand the meaning here so I can figure out how to manipulate it.

Thank you.
Danner
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

WHAT?

Post by burger2227 »

A keyboard to the port pins? That's why you have a keyboard on a PC to begin with. To send data to the port, it must be reversable. The voltage used is only 5 volts! An unused port will return 255 until you send it something else WHILE it is reversed. All you do is turn appropriate pins on while in the reverse mode ONLY! I can see a fried port in your future!

A Serial port is used for two way communication, but they are harder to work with. There are many references on the web for serial port code.

The main use for a parallel port is to SEND DATA! You can do that quite easily as shown below.

The parallel data pins are sent a number using OUT 888, n:

Code: Select all


D0       D1      D2       D3       D4       D5          D6          D7       

1        2       4        8        16       32          64         128
If you want D1 and D2 on you add those 2 pins and send 6. If you want them all on, send 255. All off send 0. The data pins are on the base port number usually 888. Look in the system devices to find the LPT port in Windows. It will be represented as a Hex number 0378 or &H378 in QB.

For an XP or NT machine you may have to run PortTalk to access the ports. Also, use opticoupler relays and a separate power supply for large relays as the port cannot deliver a lot of current. It is also only 5 volts. There are 8 ground pins to use also. Make sure to use them!

The pins are named for the exponent of 2 values. 2 ^ 0 = 1, 2 ^ 1 = 2, 2 ^ 7 = 128. You can use the exponents of two in a loop to make a sequencial LED flasher. LED's require 1K ohm resistors.

Code: Select all

DO
FOR i = 0 to 7
         OUT 888, 2 ^ i
         SLEEP 1             'or some kind of TIMER delay
NEXT
LOOP
If you want to read the values with INP(888) you will find that the data totals do not exceed 225 and are integers. This is the same as sending the ASCII code to the printer which converts it back to letters. You can only turn on data pins with an external device such as an A/D converter when the port is reversed. This mode is for scanning devices from a printer/scanner combo.

What on earth are you trying to really do? You will have to communicate with the control and status pins to tell your program something. Control is from the PC and Status is from the device connected. Do not try to alter them unless you know what you are doing.

Ted
Last edited by burger2227 on Wed Jun 11, 2008 2:44 pm, edited 3 times in total.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Keypad

Post by danner »

Ted,

I do plan to use resistors in series with the keypad.. not keyboard. The keypad will be used to enter an access code. Then the computer will send a signal which will be used to activate an electronic door strike. I was just trying to read the unconnected port to verify I had addressed it correctly.

I'm at work and will read over your response better later.

Thanks for the help, I hope I've given you a better idea of what I plan to do. I've done something similar with a BasicStamp chip.

Thanks again,
Danner
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Reversing the port

Post by burger2227 »

To reverse a 1284 compatable port send the contol port C5 a value in your program as below:

Code: Select all

 
OUT 890, INP(890) OR 32    'sets C5 on if it is off
Now you can turn the port's pins on using an A/D converter or other type devices using 5 volts. Check that C5 is always set in your PC program. C5 has a timeout interval of about 60 to 80 seconds which then causes the port to have values set before it was reversed. Optocouplers may be of use to protect your device and the port.

Send the status port 889 something to tell the program the device is ready if you need to. Each pin is numbered for the exponent of 2 that it will return when on except for S7 which is an inverted pin.

Either way, your program will need to be running. So why not just use a keyboard entry code and use one of the data pins to control one relay if the code is correct. That would be a lot simpler plus you would have 7 pins left to do other stuff. I have a DLL that will allow you to do it in VB also. QB has a habit of slowing down a system or minimizing and the code would be the same. I have already made a parallel port monitor in both QB and VB on my XP. I needed PortTalk for QB and Inpout for VB to use INP and OUT like QB does.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Follow up

Post by danner »

Ted,

The keypad is a 3 x 4 matrix. It will be installed on the exterior near the door. It has 7 pins.. four rows, plus 3 columns equals the 7 pins. So, for example.. when number one.. top left is pressed.. the top row pin and leftmost column pin have continuity. The strike itself will only need one pin out for the relay.

If I understood you right.. I will need as part of the loop to keep the data pins in the input mode as it monitors for input? In my head I was picturing the data pins in a binary mode... where only the two corresponding to the row/column would be a one and the rest a zero. Now that you have a better idea the parts I am working with I would be interested in hearing your advice as far as my approach. Speed wise I am not too worried. The program, other than monitoring for input.. once it has the input is a very simple program. The computer will only be used for one other thing.. to capture video. The video program I use really doesn't use as many resources as you might think. I have had it running on some pretty old machines with limited resources. These are the only two things the computer will be doing so I don't expect speed to be a problem.

I'm not sure I'll get much work done on it this next week... this project only gets attention during free time. I will always get back to you one way or the other.

Thanks again,
Danner
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: Follow up

Post by Mac »

danner wrote:Ted, (blah-blah)
Right! You're working with the right man for this job!

(I know zip)

Mac
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

The port will have to be in reverse mode waiting for input

Post by burger2227 »

That is why I said that the program has to be constantly running and the port will have to be constantly reversed by the program as it may timeout. That should not hurt anything.

When you send 5 volts to a reversed port pin it tells INP(888) that it is ON. Use the chart I made above for the exponents of 2. All of the pin diagrams I have seen name the pins for the exponent of 2 value. For example C5 is 2 ^ 5 = 32. If you need a good pinout I can send you one.

Your program can read the entire 8 pins for any 5 volt signal and interpret which pin is set with INP(888). Once that happens the program will quit looping around and wait for the next pin value, etc.

Let's say your first secret code number is 0. Then INP(888) will return 1 when pin 0 gets the 5 volts. If the number is 7 then pin 7 gets 5 volts and the program will return INP(888) = 128. You will be limited to 0 to 7 in exponents of 2, but that is more than a combination lock has.

Another option is to wake up the program with a data pin not used or send that to a status pin. Forget S7 it is inverted. It's like me, normally high, but goes low when ya tell it to do something. LOL. If you do it with a pin being monitored, then your program can reverse the port by setting C5.

Just keep it 5 volts and make sure there are no short circuits!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Pins

Post by danner »

Ted,

I am starting to get a better picture thanks to your help. I did have one thought I wanted to pass by you to see if it would work. Since the 7 pin matrix keypad is basically a short between one of the column pins and one of the row pins... I was wondering if I could use 4 out pins for the row pins and 3 in pins for the columns. Of course a proper resistor and diode would be in line. Would that work to send out one of the rows.. and test to see which column.. or in it came back on if any? If that would work, I would not have to reverse the data pins. I would use the star key as the first thing they have to hit, so initially it would only be monitoring that row out and column in and would not look at the others until it detected that one. If that is not possible can you try to explain it to me what I've missed?

Thank you again for your expertise. I am surprised there are not more people using the parallel port for things. Most of the examples I have found on the net are using C programming so it has been harder to follow and understand. A testament to how much sense BASIC makes. I took a class 14 years ago and was able to look at my book and write the rest of the program without asking for help. After this answer I will see if I can rough some code up for you to look at.

Thank you, and have a great weekend.
Daniel
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

I don't understand your new idea about the pad and not reversing the port at all. How can you get much out of the keypad if it just shorts rows and columns. Obviously you would have to feed the 3 columns 5 volts and read just 4 rows. This would make it only a matter of mixing 4 keypresses or actually a nibble(4 bits) mode instead of a byte mode:

Code: Select all

            4 * 3 * 2 = 24 choices using 4 presses   
For that you only need to monitor the status pins S3 to S6 without the port needing to be reversed. Just monitor the status port 889 using:

Code: Select all

                Status = INP(889)          
The values are 2 ^ 3 = 8, 2 ^ 4 = 16, 2 ^ 5 = 32, 2 ^ 6 = 64

This way the program can enable just one data pin to a relay to control the latch. Or you could turn C2 on using OUT 890, 4 but the control port also times out and C2 will need to be held low by your program.

There is a keypad especially for latches at MCM Electronics for $50. It has a relay, 3 LED's and a 12 button keypad which is programmable. You would have to get a power supply for it.

The use of your keypad seems like a bad alternative to me. What you need is a digital keypad arrangement that can set one or more data pins using binary outputs IMHO.

My port programming Demo is in Q-basics.zip Chapter 11. The demo also has a lot of other programming ideas:

http://www.qbasicstation.com/index.php? ... &filecat=3

I also have other stuff like ProjectXP and a QB parallel port program called PPort

NOTE: You need a 13 connector Keypad so that all of the buttons are different to do what you want. I found one at Jameco.com for around $20. Otherwise you will need to make a circuit board with 5 IC's on it to convert the button logic properly.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Keypad

Post by danner »

Ted,

I have looked at other keypad options such as the one you referenced from MCM. There are some things my program does which the cheaper models do not. The one I wrote I keep a log of all events. I also have different time zones set up so that tenants can only access areas at certain times but employees at all times. I also like having it run on the computer because I can instantly open the log file.. or the password file and update them on the screen quickly and easily.

I admit, even after doing a lot of reading on printer ports things are still not clear for me. I appreciate your patience with me. In my mind I only see 12 possible combinations on the keypad. Each of the 4 rows can only return through one of the 3 columns. So what I am asking is.. if I put a data out pin high (connected to one of the rows), there are only 3 possible "ins" (columns) it could return on. Is it possible to send out one of the data out pins and monitor and detect which pin it came back in on? Or is this not possible because they occur at the same time?

In case I havn't explained well enough.. picture this. The four rows are four out pins.. out 1, out 2, out3 and out 4.. the 3 columns are four in pins.. In 5, In 6 and In 7. (I'm just using example pin numbers.. these are not the numbers on the connector) If I push the button that corresponds to the 1st row and 1st column (lets say that is number 1 on the keypad) .. Out Pin 1 and In Pin 5 have continuity. So whatever goes out pin one will come in Pin 5. And.. if number 2 from the first row, would go out Pin 1 and in Pin 6.

I hope this example helps you understand the limited picture in my mind at the moment. I tried to underline the question at the end of the above paragraph. This is where I am hung up the most right now.

If the 7 pin keypad won't work because of that reason... or some other. Are there enough pins on the port to monitor a keypad with 12 pins? (one for each button).

Now I will ask a few questions which I hope the answers will let me understand how it is working better. Is Basic able to look at each pin seperately? Or.. does it look at all of them at the same time? For example.. to make it simple for me.. let's say the port only had 4 out pins and 4 in. Binary I see that as 00000000 ... let's say we wanted to change the second pin. Could we send a one directly to it, or would we have to send 01000000? I think the numbers you have given me are hex? and that is what Basic is using.

You wrote"The use of your keypad seems like a bad alternative to me. What you need is a digital keypad arrangement that can set one or more data pins using binary outputs IMHO. " If my kepad will not work I would have to agree with you. I see two options. One.. I could add a chip which would convert the keypad I have to a binary output. or Two.. I would order a keypad which sends out a binary signal.. (I think they only have 4 pins.. but just two send and recieve this data?).

"
My port programming Demo is in Q-basics.zip Chapter 11. The demo also has a lot of other programming ideas:

http://www.qbasicstation.com/index.php? ... &filecat=3
"
Thank you for the link. I will try to read through it soon.

"I also have other stuff like ProjectXP and a QB parallel port program called PPort " From what I read I got the impression it would be harder to do this in XP, so I am sticking with 98 if I can. It will run the program I wrote fine and also the video program. In time I might like it to run on XP, but for now.. as long as it is easier I'll stick with 98. I need all the easy I can get.

I hope my questions don't seem to silly to you. Hopefully I have shared enough that you can see where I am not getting it and clear it up for me.

Thanks again,
Daniel
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Here is what I see

Post by burger2227 »

You just use DataVal = INP(888). This shows the binary bit totals in decimal values. Each time a pin changes value, so does the decimal value.
Then you check each pin value using the AND mathmatical operator in QB.

Code: Select all

DIM SHARED D(0 TO 7) AS INTEGER, DataVal AS INTEGER
DO             
DatVal = INP(888)     'read port data when port is reversed
IF DatVal > 0 THEN
         count = count + 1
         FOR i = 0 TO 7 
             IF (DatVal AND 2 ^ i) THEN D(i) = 1  'set D array if on
         NEXT  
END IF
LOOP UNTIL count = 4
Now you have the readings stored in the D array. You could make a SUB to call and deal with the data, but remember that the keypad will only send one pin's value. It will be cumulative if you make a counter to keep track of the number of presses. Also the keys would have to be 4 different keys. You can clear the array with ERASE D. I am just showing an example, but your array will actually hold the binary equivalent if you print the elements in reverse order as string numbers. The brackets around the AND operation are REQUIRED in an IF statement.

If you are talking about sending values to the port in a program then the port is in normal mode as described in the first post I made.

Your keypad has 3 column pins and 4 row pins = 7 as below:

Code: Select all

                             1      2      3      o-----D0
                             4      5      6      o-----D1
                             7      8      9      o-----D2
                             #      0      *      o-----D3

                             o      o     o    
                             |      |     |
                           5v       5v   5v      'where counter would be connected
The problem is that the columns are not any different in this arrangement. So if 4, 5 or 6 were pressed the 5 volts would go to D1 always. Thus you can only access 4 data pins. You cannot send data with the port and receive it at the same time! You need a way to differentiate the columns somehow.

I came up with a circuit board to do what you need, but I don't know if you can make one. What it does is send 5 volts to each column one at a time using a 4017 decade counter. A 555 timer creates pulses to that counter like a clock. It only counts from 0 to 2 and resets to 0 at a frequency of about 68 cycles per second or 22 per column roughly.

Then you need three 4081 quad AND gate chips to read each column. The AND gates compare the column voltage with the row voltage and when both are high, sends 5 volts to up to 12 parallel port data pins. As I mentioned, the pad can send data to the status port also giving you all of the keys.

If you cannot make the circuit, get a 13 pin keypad and we can work from there. You will also need a 5 volt DC power supply.

Please study the parallel port more if you don't understand. Especially the Status port pins. Printers use those to send messages to a PC program.

As for the XP stuff, both PPORT and ProjectXP should run without needing PortTalk or the included batch files. I included them for XP users.

Ted
Last edited by burger2227 on Sun Nov 18, 2007 10:30 pm, edited 1 time in total.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Follow up

Post by danner »

Ted,

Ok.. I'm following a little better now. I also did some reading up on the Hex system and was able to make more sense of your previous posts. It is going to be a busy week so I'm not sure how soon I'll get back to this. I will check out the 13 pin keypads. I will also weigh that against an encoder for my current keypad.. which I know then it would have to come in on a COM port. Maybe it wouldn't be too bad to program since I will only be receiving from the keypad. The encouder would take care of debouncing the keys too.. will have to kick this one around for a bit. You have been a big help in helping me narrow it down.

I will still need to send the signal out to the relay for the strike when access has been approved. How do I send the signal out for a certain period of time? If I just did a OUT 8?? that would not last long would it? Or.. does it stay hot/on until I send the off signal? What would that 800 number be? which pins would you suggest I use? (I am guessing like D2 for out.. and ground for return.) I may get this part of the program done this week. On a basic stamp you could do a frequency out for a period of time. Is there anything similar on QB 4.5? What is the best way to have the strike activated for a second and then shut off?

Thank you again for your guidance.
Daniel
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

OK, I found an Encoder for Parallel or Serial data from your shorting keypad. It is an EDE1144 IC which requires a 4Mhz crystal, but can also use a beeper to acknowledge a press. It sends out 4 bits of binary data for a parallel port also. It can also be connected to a serial port, but we won't even need to reverse the parallel port. We can use the Status pins S3 to S6 on register 889. I have all of the data from Jameco and it is about $7. Plus it is a "quiet" chip that generates no noise and waits for a keypress.

The parallel port will be the decoder.

Ted
Last edited by burger2227 on Sun Nov 25, 2007 7:43 pm, edited 5 times in total.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

13 pin keypad

Post by danner »

Ted,

Do you have a link to that keypad you saw? I searched the Jameco site but could only find 8 pin keypads there. I also searched Mouser and MCM but didn't find a 13 pin.

Thanks for the advice.

I'm heading to bed. Goodnight.
Daniel
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Update

Post by burger2227 »

I have updated my Q-basics tutorial with your scenario. My idea uses the 5 status pins, including the inverted one (LOL). I also include the encoder chip EDE1144 and a schematic.

http://www.qbasicstation.com/index.php? ... &filecat=3

The chip sends binary numbers to the S3 to S6 pins of the parallel port.
When you press the 1 key on the pad it sends 0001 to the 4 pins so S3 is turned on and INP(889) = 8. If the 8 key is pressed it sends 1000 and INP(889) = 64. So the actual number pad selected = INP(889) / 8.

Code: Select all

 
Pin =               -S7          S6          S5        S4           S3
INP(889) =          128          64          32        16           8
The pin decimal values are added if the pin is turned on or high. The highest value a 4 bit binary number can be is 120 with all 4 pins on or 1111 binary.

The chip also has a data valid signal that tells you when to read the port status pins. If that signal is zero, there is valid data, but when connected to the S7 inverted pin the bit goes high and adds 128 to INP(889). So if a keypad number is pressed the value of INP(889) must be at least 128.

So my code to find the actual key number pressed is:

Code: Select all

DO
    Status = INP(889)
    IF Status >= 128 THEN          'chip indicates data valid
          keypressed = (Status - 128) / 8
          flag = 1: Start! = TIMER: count = count + 1
          code$ = code$ + LTRIM$(STR$(keypressed))  'convert to string code
    END IF
    IF flag = 1 THEN    'key press timer set
         IF Start! > TIMER THEN Start! = Start! - 86400 'midnite TIMER = 0 correction
         IF TIMER > Start! + 5 THEN EXIT DO   '5 second timeout
    END IF
LOOP UNTIL count = 4

I would change the key numbers to strings and add them together until you had the number of presses needed such as 4. I would also add a timeout to the loop if somebody accidentally hits a button or forgets the code. This would allow the procedure to reset. Each new keypress, the timer start is updated for 5 more seconds until 4 digits are pressed.

As to the # and * keys, they send binary 1010 and 1011 or decimal 10 and 11 respectively. The phone company often refers to them as hexadecimal A and B. Oddly enough, some keypads with 16 pads use A, B, C, and D but their hexacecimal values are 2 higher in binary. So D actually equals the hexadecimal F or 1111 in binary or decimal 15!

The chip is also set up for 4 columns, or 16 pads, but we can just not use the Column 3 input and use the Column 0 to Column 2 ones.

I think it would be best to use the control port 890 for the latch relay. There are certain pins that come on at reboot. All of the data pins are on at a reboot, so C3 looks like a winner. It is set hi, but the inverted pin is low so there is 0 volts sent. To set the pin hi, we have to send something without 8 to the port. Just send 4 with OUT 890, 4 and it will go high to activate the relay. C2 will reset anyways and that is why I decided on 4. Just use a delay to keep the latch open for 5 seconds and then send OUT 890, 12 to stop the latch. Incidentally, C3 also resets itself after about 40 seconds!

Finally, what happens if there is a power outage? I would consider a good backup system for the PC and circuitry. However, long outages may require a key access mode.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Notice

Post by burger2227 »

Presently Danner and I are waiting for the parts to come in. I will update this thread when we finally get something running. I contemplate using the Control port 890 to drive the door latch relay using a 4N29 Opto-Isolator chip. I will supply that code later, if anybody is following this thread. We could run into some minor problems.

The code can also be found in the Q-basics.zip file chapter 11, page 8

http://www.qbasicstation.com/index.php? ... &filecat=3

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
danner
Coder
Posts: 17
Joined: Thu Oct 11, 2007 11:21 am
Location: Mt. Sterling, IL
Contact:

Great Help

Post by danner »

I was coming to post for the same reason Ted did.. to let everyone know things are progressing and once all the parts have been put together and the bugs worked out I'll pass on what I have learned.. and a BIG thank you to Ted for all his help!

Danner
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Getting close now

Post by burger2227 »

Dan got covered with ice and the Steelers lost to New England, but we are just about ready to fire this project up! The coding is pretty much figured out. All we need is for the darn thing to work.

Problems at bootup are going to need some new code and/or circuit wiring, but we have it working somewhat.

If you are interested in learning binary coding (the stuff that makes Pc's work) just ask. If you have NT or XP or worser(VISTA) you need PortTalk to access a port!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

PROBLEMS

Post by burger2227 »

Apparently the 1144 chip is sending multiplexed signals to the port status pins. The values returned by INP(289) are not integers and are sometimes just wrong!

The readings should be combinations of: 8, 16, 32, 64 and 128.

Some readings are 7 and 127 instead.

There could be connection or power supply problems, but so far it looks like the chip is not working correctly

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply