Lecture # 12. PIC Printer Interface Printer IRQ7 INT ACK Printer Interface.

Slides:



Advertisements
Similar presentations
MICROPROCESSORS AND MICROCONTROLLERS
Advertisements

Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
For(int i = 1; i
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Chapter 3A Review boolean fun = true; if(fun) System.out.print(“yeah!”);
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Example 20 Fuzzy Control Lecture L10.2.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 3 GETTING THE MOST OUT OF C.
Sort the given string, without using string handling functions.
Programming In C++ Spring Semester 2013 Lecture 8 Programming In C++, Lecture 8 By Umer Rana.
Union, bitfield, typedef, enum union nama_u{ }; union nama_u{ struct nama_s byte; }; enum{ }; Tipedef var BYTE.
1 Homework Reading –Tokheim, Section 13-6 Continue mp1 –Questions? Labs –Continue labs with your assigned section.
Flow Diagram: Push flags, CS, IP Pop IP,CS,flags Push AX,BX,CX,DX,ES,DS,SI,DI,BP POP BP,DI,SI,DS,ES,DX,CX,BX,AX.
TCP connection my Computertelnet client web server remote computer 1 character per transmission Telnet uses TCP connection.
TCP connection my Computertelnet client web server remote computer 1 character per transmission * Telnet uses TCP connection * but Nagle's algorithm modifies.
1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter Chapter Interfaces: Parallel Port Systems Manufacturing Training.
EE 316 Computer Engineering Junior Lab Lecture on PC Parallel port.
CHAPTER 10 Keyboard and Printer Interfacing. Matrix Keyboard.
UNIT 8 Keypad Interface Contact Closure Counter Exceptions (Interrupts and Reset)
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
ITÜ COMPUTER ENGINEERING INTERCONNECTION PROTOCOLS PROJECT PRESENTATION Ersan Öztürk /12/2005 JAVA RADIO.
COSC 456 Lesson 19: Laboratory 5 IBM PC Interfacing The parallel port is a 25-pin DB-25 (D-shaped) connector accessible from the back of the PC The expansion.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
Another Example: #include<BIOS.H> #include<DOS.H>
Applications of PPI A/D - Temperature Sensor. Analog to Digital.
ECE291 Computer Engineering II Lecture 12 Josh Potts University of Illinois at Urbana- Champaign.
CPU Speaker Monitor Printer Touch pad Scanner Key Board Mouse Microphone.
CSCE 515: Computer Network Programming TFTP + Errors Wenyuan Xu Department of Computer Science and Engineering.
Printer Port * 0= * 1= * 6= 60 1 * 4 = 4 = 164 Decimal Binary We use Ten Symbols
Lecture 27. Extended Read Service used for extended read is int 13h/42h On Entry AH=42H DL=drive # DS:SI= far address of Disk address packet On Exit If.
Lecture 21. _getproc proc near pushf ;Secure flag register contents push di ;== Determine whether model came before or after === xor ax,ax ;Set.
ECE291 Computer Engineering II Lecture 16 Josh Potts University of Illinois at Urbana- Champaign.
UNIT 7 - INTRODUCTION TO I/O INTERFACING. TWO MAJOR TYPES OF I/O INTERFACING ISOLATED I/O - DEDICATED I/O INSTRUCTIONS ARE USED TO ACCESS I/O DEVICES.
University of Tehran 1 Microprocessor System Design Programmable Interrupt Controller Omid Fatemi
1 Advanced Programming Examples Output. Show the exact output produced by the following code segment. char[,] pic = new char[6,6]; for (int i = 0; i
Microprocessor System Design Programmable Interrupt Controller.
Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
Lecture 15. Modem Controller Register 4310 DTR 0 = Polling Operator 1 = Interrupts Enabled RTS 1 =Self Test 0 =Normal.
#include <dos. h> void interrupt(
Signal Name Direction w.r.t. Printer Function Summary Pin# (25-DB) CPU
Homework Reading Labs Tokheim, Section 13-6 S and S Extracts
Homework Reading Continue mp1 Labs Tokheim, Section 13-6 Questions?
Lecture # 13.
Single CCU System with Control PC and DIRECT Connection
I2C Synchronous Serial Two wire communications (plus ground)
CS-401 Compute Architecture & Assembly Language Programming
Example 21H/42H: handle = open("c:\\abc.txt",O_RDONLY);
Physics 413 Chapter 10.
. - t !!l t. - 1f1f J - /\/\ - ' I __.
Lecture 22.
Introduction to Programming and the C Language
NetSilicon & Digi Confidential
Example 15 Interrupt-Driven Controller
Lecture 10.
Lecture 16.
The centronics port Interfacing to a PC.
Writing Portable and Robust Firmware in C
.. '.. ' 'i.., \. J'.....,....., ,., ,,.. '"'". ' · · f.. -··-·· '.,.. \...,., '.··.. ! f.f.
unsigned char far *scr=0xb ;
Lecture 19.
Lecture # 11.
Scope of variables class scopeofvars {
Introduction to Programming
Window Management in TCP
Lecture 17.
Lecture 24.
Presentation transcript:

Lecture # 12

PIC Printer Interface Printer IRQ7 INT ACK Printer Interface

Interrupt Driven Printer I/O char buf [1024]; int i = 0; void interrupt (*oldint)( ); void interrupt newint (); void main (void) { outport(( *lpt), inport( *lpt) | 4); outport(( *lpt), inport( *lpt) | 0x10); oldint =getvect (0x0F); setvect (0x0F, newint); outport(0x21, inport( 0x21) | 0x80); keep(0,1000); }

void interrupt newint ( ) { outport( *lpt, Buf[ i]); outport(( *lpt)+2, inport(( *lpt)+2) &0xFE); outport(( *lpt)+2, inport(( *lpt)+2) | 1); i++; if( i== 1024) { outport(0x21, inport(0x21)&0x7F); setvect(0x0F,oldint); freemem(_psp); }

#include #include #include #include #include void interrupt (*oldint)(); void interrupt newint(); unsigned int far * lpt = (unsigned int far *)0x ; char st[80]= "this is a test print string !!!!!!!!!!!"; int i ; void main () { oldint = getvect(0x08); setvect(0x08,newint); keep(0,1000); }

void interrupt newint() { if ((( inport((*lpt) +1)) & 0x80) == 0x80) { outport (*lpt,st[i++]); outport ((*lpt)+2, inport((*lpt)+2) & 0xfe); outport ((*lpt)+2, inport((*lpt)+2) | 1); } if (i==32) { setvect (0x08,oldint); freemem(_psp); } (*oldint) (); }

Printer Cable Connectivity 1STROB 2D0 3D1 4D2 5D3 6D4 7D5 8D6 9D7 10ACK 11BUSY 12PE 13SLCT 14AUTO FEED 15ERROR 16INIT 17SLCT IN 18-25GND

Computer to Computer Connectivity

P Q3 P Q4 P Q5 P Q6 P Q7 Q P0 Q P1 Q P2 Q P3 Q P4

0B3B2B1B0 Sender 1B3B2B1B0 Receiver BUSY ACK PE SLC ER D4 D3 D2 D1 D0 E7 E6 E5 E4 E3 Sender sends LOW Nibble and D4 = 0 received as BUSY = 1

1B3B2B1B0 Sender 0B3B2B1B0 Receiver BUSY ACK PE SLC ER D4 D3 D2 D1 D0 Receiver send back LOW Nibble and D4=0 received as BUSY = 1 by Sender

1B7B6B5B4 Sender 0B7B6B5B4 Receiver BUSY ACK PE SLC ER D4 D3 D2 D1 D0 Sender sends Hi Nibble and turns D4 = 1 received as BUSY = 0 by Receiver

0B7B6B5B4 Sender 1B7B6B5B4 Receiver BUSY ACK PE SLC ER D4 D3 D2 D1 D0 Receiver send back Hi Nibble and turns D4 = 1 received as BUSY = 0 by Sender

-d 40: : D 02 x : C gD t. 0040: D D 1C B 3A 27 x-t...d 94.0.:' 0040: B D 1C D E u.m2p : FF A P....p.P : :0060 0E 0D 00 D CC-FF B E2 0B )....k : :0080 1E 00 3E >....` -q

C:\>debug -o 378 0A -i 379 D0 -o i Sending byte 9A C:\>debug -i 379 D7 -o 378 0A -i 379 4F -o