These are the relevant portions of a working 18F4320 program that uses PSP to get data from PC printer port. I tried not to wrap the lines. Hope this helps. Djula org 0x08 ;High priority interrupt vector bsf BUSY ;Signal PC that we are busy bcf PIR1,PSPIF ;Reset interrupt flag clrf CommTmr ;Clear inactivity timer movff PORTD,IntTmp1 ;Save data from PC btfsc IntTmp1,7 ;Data bit 7 set? bra SpecialChar ;Yes bra HighPriority ;No, continue org 0x18 ;Low priority interrupt vector bra LowPriority ; HighPriority movf FIFO_Wr,w ;Load FIFO offset address movff IntTmp1,PLUSW2 ;Save data from PC to FIFO incf FIFO_Wr,f ;Increment FIFO write pointer movf FIFO_Wr,w ;FIFO empty or half full? subwf FIFO_Rd,w ; bz EndHandshake ;FIFO empty btfss WREG,7 ;>127 bytes remaining? retfie FAST ;No, half full, leave BUSY on EndHandshake bcf ACK ;Finish handshake nop ; bsf ACK ; bcf BUSY ; retfie FAST ; ;PORTD: 30 PSP7 29 PSP6 28 PSP5 27 PSP4 22 PSP3 21 PSP2 20 PSP1 19 PSP0 ; DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0 ; PRINTER PRINTER PRINTER PRINTER PRINTER PRINTER PRINTER PRINTER ;PORTE: 10 /CS 9 /WR 8 /RD ; GND /STROBE +5V ; UNUSED PRINTER UNUSED movlw B'00001111' ;Turn off A/D convertor movwf ADCON1 ; movlw B'11111111' ; movwf LATD ;Init LATD movlw B'00000111' ; movwf LATE ;Init LATE movlw B'11111111' ; movwf TRISD ;Init TRISD movlw B'00010111' ; movwf TRISE ;Init TRISE movlw B'10000000' ;Enable interrupt priority levels movwf RCON ; bcf INTCON2,TMR0IP ;TMR0 int low priority bcf IPR2,TMR3IP ;TMR3 int low priority bsf PIE2,TMR3IE ;TMR3 int enabled bsf IPR1,PSPIP ;PSP int high priority bsf PIE1,PSPIE ;PSP int enabled movlw B'11100000' ;Enable low and high priority movwf INTCON ;interrupts Thomas C. Sefranek wrote: > Hi All, > > I am working with a PIC18F4585 (for the CAN port), > I want to use the Parallel Slave Port. > > The problem is the PIC IRQ hardware never sees the PSPIF in PIR1. > I have the PSP enabled in TRISE = 0X97, The PSPIE bit is set in PIE1, > The flag bit does go set when it has been selected, but the Interrupt vector > never happens. INTCON is 0XC0 so General and Peripheral IRQ are enabled. > ADCON1 is 0X0A, ECCPCON is 0X00. > > CAN IRQs work... > > I suppose I could write a polling routine, but this should work! > Ideas? > > Tom > > * > | __O Thomas C. Sefranek WA1RHP@ARRL.NET > |_-\<,_ Amateur Radio Operator: WA1RHP > (*)/ (*) Bicycle mobile on 145.41MHz PL74.4 > > ARRL Instructor, Technical Specialist, VE Contact. > http://hamradio.cmcorp.com/inventory/Inventory.html > http://www.harvardrepeater.org > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist