DavidMil Posted September 1, 2017 Share Posted September 1, 2017 Some time back I built loopback testers for my 850 and wrote a simple Basic program to test all four RS232 ports and the control lines. This part works fine, but I am having a problem with the printer port. The device I built to test the printer port uses 8 SCR's to capture and light up 8 LED's on data lines, and four more LEDs to test the control lines (the control line portion works fine). I used SCR's because once they are activated you have to manually disrupt the input to shut them off. This would keep the LED's on till the tester opens a normally closed switch to shut off the LED's. I thought creating a character set that would only send one bit at a time to the printer port wouldn't be that much of a problem but it is. When I created the character set using the 8 x 8 matrix, I tried putting a '1' on the right side of one of the lines and all zeros in the rest of the grid. It doesn't matter where I put the '1' (on the right side, or the left side of the grid) multiple bits would be sent out the printer port. Does anyone know of a really low level book or have any experience with the printer port on the 850? I'm beginning to think this may take an assembly language type program to get low enough into the hardware. I have the following books that just don't go deep enough into the workings of the printer port: Programmers Reference Guide for the 400/800 Compute's First & Second Book on the Atari Your Atari Computer De Ra Atari Mapping the Atari and the 850 User and Repair Manuals Any help would be appreciated, DavidMil Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 1, 2017 Share Posted September 1, 2017 I'd be looking up CIO device parameters for OPEN and look up the 850 printer port settings too. It might be that there's different modes like momentary output with strobe set, or persistent output. Can't really suggest much more, haven't used one myself. Quote Link to comment Share on other sites More sharing options...
DavidMil Posted September 3, 2017 Author Share Posted September 3, 2017 I'd be looking up CIO device parameters for OPEN and look up the 850 printer port settings too. It might be that there's different modes like momentary output with strobe set, or persistent output. Can't really suggest much more, haven't used one myself. I was wondering if there might be some low level "hand shake" codes sent when the lines are strobed, but I can't find any info that goes that low. Someone suggested that I look into the printer end to see if it might have any info on LPT port comms. I think that is where I'll go next. David Quote Link to comment Share on other sites More sharing options...
BillC Posted September 3, 2017 Share Posted September 3, 2017 (edited) I was wondering if there might be some low level "hand shake" codes sent when the lines are strobed, but I can't find any info that goes that low. Someone suggested that I look into the printer end to see if it might have any info on LPT port comms. I think that is where I'll go next. David I have never tried it with the printer port, but at one time(20+ years ago) I used GET and PUT to copy a text file in RAM-disk while translating ASCII CR/LF(10/13) to ATASCII EOL(155). I think it should be possible to send a desired byte to any device capable of output. I don't see the need to latch the LEDs, just using PUT in a loop to send the same byte repeatedly should keep the LEDs on(or blinking steadily) until stopped. It should simply be a matter of OPENing a channel to write the printer port. OPEN #2,8,0,"P:" Then PUT a hexadecimal equivalent of a binary number which represents the bits to test. PUT #2,CHR$(01) Edited September 3, 2017 by BillC 1 Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted September 3, 2017 Share Posted September 3, 2017 Does anyone know of a reallylow level book or have any experience with the printer port on the 850? I'm beginning to think this may take an assembly language type program to get low enough into the hardware. There is none. You do not get direct access to the printer port, it is controlled by the microprocessor in the 850 itself. From the host computer side, all you can do is send SIO commands, and they just send the bytes for the printer. The only free parameter is AUX1 which defines the number of characters that fit into the printer buffer, but that's about it. Nothing can be gained from assembly language here - all parameters are exposed to BASIC, it is the AUX2 parameter of OPEN you still can play with. In particular, there is no parameter that controls strobe on the printer port, nor is there any command to read lines like "on line" or "out of paper". 1 Quote Link to comment Share on other sites More sharing options...
DavidMil Posted September 5, 2017 Author Share Posted September 5, 2017 I have never tried it with the printer port, but at one time(20+ years ago) I used GET and PUT to copy a text file in RAM-disk while translating ASCII CR/LF(10/13) to ATASCII EOL(155). I think it should be possible to send a desired byte to any device capable of output. I don't see the need to latch the LEDs, just using PUT in a loop to send the same byte repeatedly should keep the LEDs on(or blinking steadily) until stopped. It should simply be a matter of OPENing a channel to write the printer port. OPEN #2,8,0,"P:" Then PUT a hexadecimal equivalent of a binary number which represents the bits to test. PUT #2,CHR$(01) Therein lies the problem... You would think that sending binary 00000001 would cause one LED to light up, but two LED's light up. Putting 00000010 only lights up one LED. Anything above binary 2 lights up at least four LEDs! The port is good as I've printed many pages to my Epson RX80+ printer without any problems. I've been thinking that maybe I'm getting some 'bounce' and I should try some filter caps. But the data would have to be clean enough for the printer to accept it, unless it's filtered on the printer end? That's why I'm stumped! David David Quote Link to comment Share on other sites More sharing options...
BillC Posted September 5, 2017 Share Posted September 5, 2017 Therein lies the problem... You would think that sending binary 00000001 would cause one LED to light up, but two LED's light up. Putting 00000010 only lights up one LED. Anything above binary 2 lights up at least four LEDs! The port is good as I've printed many pages to my Epson RX80+ printer without any problems. I've been thinking that maybe I'm getting some 'bounce' and I should try some filter caps. But the data would have to be clean enough for the printer to accept it, unless it's filtered on the printer end? That's why I'm stumped! David David Sorry I can't be of further help, but I've used this method for sending DATA(byte by byte) to disk files and thought it might work with the printer port. Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 5, 2017 Share Posted September 5, 2017 Could you make an adaptor to allow you to test your LEDs via the joystick ports? With the PIA outputs you can change them directly programatically. Quote Link to comment Share on other sites More sharing options...
DavidMil Posted September 5, 2017 Author Share Posted September 5, 2017 Could you make an adaptor to allow you to test your LEDs via the joystick ports? With the PIA outputs you can change them directly programatically. I'm sure I can, but to what purpose? David Quote Link to comment Share on other sites More sharing options...
DavidMil Posted September 5, 2017 Author Share Posted September 5, 2017 Sorry I can't be of further help, but I've used this method for sending DATA(byte by byte) to disk files and thought it might work with the printer port. You offered what you could and I appreciate it. Thank you, David Quote Link to comment Share on other sites More sharing options...
BigO Posted September 6, 2017 Share Posted September 6, 2017 A potentially dumb question since A) I don't know the 850 at all and B) I haven't seen your circuit: But, is the triggering of the SCR's working as expected? I mean, if the strobe is intended for edge triggered operation, and the SCR's are gated by level, maybe the data on the bus is changing while the strobe is sitting for a relatively extended period at a HI (or LO, whatever it does). Maybe some sort of edge triggered D flip-flop or latch would capture different results? Just my random thought. Quote Link to comment Share on other sites More sharing options...
DavidMil Posted September 6, 2017 Author Share Posted September 6, 2017 A potentially dumb question since A) I don't know the 850 at all and B) I haven't seen your circuit: But, is the triggering of the SCR's working as expected? I mean, if the strobe is intended for edge triggered operation, and the SCR's are gated by level, maybe the data on the bus is changing while the strobe is sitting for a relatively extended period at a HI (or LO, whatever it does). Maybe some sort of edge triggered D flip-flop or latch would capture different results? Just my random thought. You are correct. I can't image what kind of results you'd get trying to power the 2N5060's from a 250us pulse. The SCR's are only to power the 8 LED's. They are actually enabled by 3904's connected to their gates. It is actually the 3904's that are connected to the 8 data lines from the 850. All the 2N5060's and the 2N3904's all get their power from the 5 volt pull up line (Pin 9). After each data line is tested the user is prompted to press a normally closed tactile switch in the 5 volt line which turns off all the SCR's. I hope I'm making sense? David 1 Quote Link to comment Share on other sites More sharing options...
BigO Posted September 6, 2017 Share Posted September 6, 2017 If I have this right, the gates of the SCR's are driven by transistors which are driven by the data lines. Is it not the function of the strobe line, essentially, to tell the peripheral device that the data on the bus is ready/stable? Maybe you're capturing the bus before or after it's holding data intended for the printer port. The strobe should somehow be controlling when your latching circuitry is allowed to capture what's on the bus. I was just working with 7474's in an old video game. They are essentially two bit latching registers which read and latch data on the leading edge of a clock signal. It would take four of those to latch your 8 bits of data. Then you might need to use the transistors or other buffer to drive your LEDs. There's probably an edge triggered octal data latch out there somewhere. To use any sort of latch, you'd want to make sure it's triggered on the same edge as the strobe is designed for. Having said that, the strobe may be designed to trigger the peripheral read on level instead of an edge. I imagine there's a reference somewhere that describes the function of the strobe signal. Again, I'm just taking a semi-educated guess so you'll want to question and verify anything that I might suggest. Quote Link to comment Share on other sites More sharing options...
DavidMil Posted September 6, 2017 Author Share Posted September 6, 2017 (edited) Here is the way I remember the data transfer procedure on the parallel bus from the 850... Data is put on the bus and allowed to stabilize for 35us. Then the strobe fires (actually I think it goes low). The data is maintained on the bus for another 200us, and then it clears and loads the next byte. And that process repeats as long as the busy line is low. I'm not using the strobe as this is a single binary number being put on the bus by the test program. But you bring up a point that may be my problem... Once the data is put on the data lines, it only remains for 200us and then it clears. If there is any 'junk' in the buffers, it is going onto the buss if a binary zero isn't sent. This may be my problem! So, I'm going to modify the program to send a binary zero to clear the bus before and after the test byte is sent. And then again, can clearing the bus send more 'bad data'? I may have to incorporate the strobe into the circuit to pin down the exact status of the 8 data lines before the LED's are lite up. I'm going to have to put some more thought into this. I'll keep you informed! I really appreciate the help and the feedback! David Edited September 6, 2017 by DavidMil Quote Link to comment Share on other sites More sharing options...
BigO Posted September 7, 2017 Share Posted September 7, 2017 I think of the strobe signal as being an indicator that says two things to the printer/peripheral: 1) Data on the bus is stable 2) The stable data on the bus is for you I haven't studied the schematic so I don't this to be true, but it's likely that the bus you're looking at is not exclusive to the printer port that you're monitoring. It may have data or commands on it for any number of other devices. The only way to know when the data on the bus is valid for you to look at is the strobe line. If you're not using the strobe line to determine when it's okay to grab data, I'd assume it's a total crap shoot what you're going to get from the bus. The strobe on the 850 printer port is active low per this document: http://www.jsobola.atari8.info/dereatari/literatdere/850om.pdf The Parallel Printer Port Specifications section (p. 83) has a lot of useful information, especially the timing diagram and notes on p. 89 looks particularly helpful. You might also want to take note of the comments about pull up resistors. The 74373 octal data latch works with an active low strobe signal. If I were doing what you're doing, I'd try to lay hands on one of these as that is the exact purpose of this chip: http://ecee.colorado.edu/~mcclurel/sn74ls373rev5.pdf The 74LS373 appears to be readily available online and inexpensive (not counting shipping charges): https://www.google.com/search?q=74ls373&rlz=1C1CHZL_enUS720US720&source=lnms&tbm=shop&sa=X&ved=0ahUKEwjSqszFoJLWAhXJilQKHUUuCuAQ_AUICygC&biw=1346&bih=770 Happy tinkering. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.