Changeset 11 in projects
- Timestamp:
- Sep 3, 2008, 6:35:35 PM (16 years ago)
- Location:
- puncher
- Files:
-
- 2 added
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
puncher/FACIT-MANUAL.txt
r10 r11 17 17 it like this: 18 18 19 FACIT direction PC PC Reg 20 4070 pin Bit Function Notes 21 ----- -- ---------------------22 1 Ch1 <===== 2 Data0D0 \23 2 Ch2 <= = 3 Data1D1 |24 3 Ch3 <= D = 4 Data2 D2 | 8 Data Out registers25 4 Ch4 <= A = 5 Data3 D3 | registers26 5 Ch5 <= T = 6 Data4 D4 |27 6 Ch6 <= A = 7 Data5D5 |28 7 Ch7 <= = 8 Data6D6 |29 8 Ch8 <===== 9 Data7D7 /30 9 Ch9 -------------------------+31 10 SD |Stepping Direction signal, leave as is32 11 PI <--------- 1 -Strobe |C0- Strobe = -Punch Instruction33 12 PR ---------> 11 +Busy |S7- Busy signal = Still punching34 13 |35 14 -|36 15 - |37 16 - +----------------------+38 17 - |39 18 - |40 19 EXT |EXT: external data switch, leave as is41 20 ERR1 | +- 20 GroundERR1: Error signal, not important42 21 TL | |- 21 Ground TL: Tape Low Signal43 22 +24V --+ |- 22 Ground +24V from internal power supply44 23 - |- 23 Ground45 24 +6V (5V) |- 24 Ground+6V from internal power supply46 25 0V -----------+- 25 GroundSignal ground, not connected to chassis ground47 48 19 FACIT signal PC pin PC Reg Function Notes 20 4070 direction and name Bit (for FACIT pins) 21 ----- ---------- -------- ------- -------------------------------- 22 1 Ch1 <--------- 2 Data0 D0 \ 23 2 Ch2 <--------- 3 Data1 D1 | 24 3 Ch3 <--------- 4 Data2 D2 | 8 Data Out 25 4 Ch4 <--------- 5 Data3 D3 | registers, to be set 26 5 Ch5 <--------- 6 Data4 D4 | from the computer 27 6 Ch6 <--------- 7 Data5 D5 | 28 7 Ch7 <--------- 8 Data6 D6 | 29 8 Ch8 <--------- 9 Data7 D7 / 30 +--- 9 Ch9 Feed hole channel (logic 1 => always feed hole) 31 |^ 10 SD Stepping Direction signal, leave as is 32 || 11 PI <--------- 1 -Strobe C0- Strobe = -Punch Instruction 33 |c 12 PR ---------> 11 +Busy S7- Busy signal = Still punching 34 |o 13 - \ 35 |n 14 - | 36 |n 15 - | not used at FACIT site 37 |e 16 - | 38 |c 17 - | 39 |t 18 - / 40 || 19 EXT EXT: external data switch, leave as is 41 |V 20 ERR1 +- 20 Ground ERR1: Error signal, not important 42 | 21 TL |- 21 Ground TL: Tape Low Signal, not important 43 +-- 22 +24V |- 22 Ground +24V from internal power supply (log. 1) 44 23 - |- 23 Ground 45 24 +6V (5V) |- 24 Ground +6V from internal power supply 46 25 0V -----------+- 25 Ground Signal ground, not connected to chassis ground 47 48 49 49 Now I'll go into detail with the FACIT pins. I've got a block diagram 50 50 and electronic description. Here you get the light edition with the most 51 51 important things: 52 53 54 time --+------------------------------------------------+--->55 56 DATA ._________________ .57 52 53 0 13 milliseconds 54 time --+------------------------------------------------+---> 55 . . 56 DATA ._________________ . 57 ______| min 200 usec ... ______________________. 58 58 . . 59 PI .______________________________ . 60 ______| min 100us, max 10ms |_________________. 61 . . 62 PR __________ ._____ 63 |__________________________________________| 64 65 Motor shaft motion 66 ________________________ 67 ... 68 ... 69 ... 70 ___________________... 71 72 59 PI .______________________________ . 60 ______| min 100us, max 10ms |_________________. 61 . . 62 PR __________ ._____ 63 . |__________________________________________| 64 . . 65 Motor shaft motion . 66 . ________________________ 67 . ... . 68 . ... . 69 . ... . 70 ___________________... . 71 . . 72 --+------------------------------------------------+---> 73 73 74 As you see, we need only 1 control pin, 1 signal input pin and 74 75 8 data pins for the workflow. Unfortunately, the strobe (PI) … … 76 77 we cannot simply use commands like "cat $file > /dev/lp0" at Linux 77 78 or "copy FILE.TXT LPT0:" in DOS/WINNT, but we need an own driver. 78 79 79 80 In this subproject, we have implemented the diagram above as 80 81 program logic. To keep it more simple, we didn't develop kernel 81 82 driver, but userspace / user mode drivers, using ppdev at linux and 82 83 the third party library "WinIo" at Windows NT. 83 84 84 85 85 86 Sven Köppel, 86 87 documentated at 02. September 2008 -
puncher/Makefile.win
r10 r11 4 4 # 5 5 6 all: cli setoff-strobe 7 6 8 cli: frontend.cli-simple.o backend.win.o 7 9 g++ -o backend.win/cli.exe $^ -Lbackend.win/ -lWinIo 8 10 11 setoff-strobe: setoff-strobe.win.o backend.win.o 12 g++ -o backend.win/setoff-strobe.exe $^ -Lbackend.win/ -lWinIo 13 14 setoff-strobe.win.o: setoff-strobe.win.c backend.h 15 g++ -c setoff-strobe.win.c 16 9 17 frontend.cli-simple.o: frontend.cli-simple.c backend.h 10 18 g++ -c frontend.cli-simple.c -
puncher/backend.dummy.c
r9 r11 7 7 **/ 8 8 9 #include "backend.h" 10 9 11 #include <stdio.h> 10 12 #include <stdlib.h> 11 #include <unistd.h> /* usleep! Unix! Not cross platform! */ 12 #include "backend.h" 13 #ifdef __WIN32__ 14 #define usleep(x) Sleep((x) / 1000) 15 #else 16 #include <unistd.h> 17 #endif 13 18 14 19 PuncherBackend* puncher_backend_new(int debug_flag) { 15 20 PuncherBackend *c = malloc(sizeof(PuncherBackend)); 16 printf("[dummy backend] initialisation...\n");21 fprintf(stderr, "[dummy backend] initialisation...\n"); 17 22 return c; 18 23 } 19 24 20 25 int puncher_backend_write_byte(PuncherBackend* c, unsigned char byte) { 21 printf("[dummy backend] punching 0x%x\n", byte);26 fprintf(stderr, "[dummy backend] punching 0x%x\n", byte); 22 27 usleep (20*1000); // 20ms 23 28 return 0; … … 25 30 26 31 int puncher_backend_destroy(PuncherBackend* c) { 27 printf("[dummy backend] finishing backend...\n");32 fprintf(stderr, "[dummy backend] finishing backend...\n"); 28 33 return 0; 29 34 } -
puncher/backend.h
r10 r11 24 24 int puncher_backend_destroy(PuncherBackend* c); 25 25 #define PUNCHER_BACKEND_DPRINTF(bla...) { if(c->debug_flag) fprintf(stderr,bla); } 26 27 #ifdef __WIN32__ 28 // G++ *braucht* dringend vollstaendige Header 29 void puncher_backend_stop(PuncherBackend *c); 30 #endif -
puncher/backend.win.c
r10 r11 113 113 114 114 // sleep the defined time 115 Sleep(220 / 1000); 115 Sleep(220 / 1000); // 220us 116 116 117 117 // only for debugging, get status values: … … 124 124 return -5; 125 125 PUNCHER_BACKEND_DPRINTF("+ strobe... "); 126 if( !SetPortVal(PARPORT_ STATUS_REGISTER, PARPORT_CONTROL_STROBE, 1) )126 if( !SetPortVal(PARPORT_CONTROL_REGISTER, PARPORT_CONTROL_STROBE, 1) ) 127 127 return -5; 128 128 … … 130 130 wait_time = 40 - (GetTickCount() - time); 131 131 PUNCHER_BACKEND_DPRINTF("\nWaiting for Puncher Ready (%i msec)...\n", wait_time); 132 Sleep(40/1000);133 //if(wait_time > 0)134 // Sleep(wait_time / 1000);132 if(wait_time > 0) 133 Sleep(wait_time); // ms! 134 //Sleep(1000); // debugging: 4 sec 135 135 136 136 // Check status another time. -
puncher/frontend.cli-simple.c
r10 r11 40 40 puncher = puncher_backend_new(1); 41 41 42 for(int xy=0; xy<10;xy++) {42 for(int xy=0;;xy++) { 43 43 unsigned char buf; /* stdin 1 byte buffer */ 44 44
Note: See TracChangeset
for help on using the changeset viewer.