> > ...the "goto" just jumps to the next instruction and do not > > jump over the interrupt vector address (h'0008'). And I can not > > see any specific code to disable all interrupt sources. Have you > > checked the no interrupt can happen ? > > > > Jan-Erik. > > Good point! I'll alter the code now and try it. > > Regards, > Stephen D. Barnes OK...corrected that part of the code. Same problem exists. Been reading the datasheet to find anything that I may or may not be doing to cause this. Nothing jumps out at me. Here is the corrected code per your suggestion. Regards, Stephen D. Barnes LIST P=18F4320 ;directive to define processor #include ;processor specific variable definitions ;*************************************************************************** *** ;Configuration bits __CONFIG _CONFIG1H, _IESO_OFF_1H & _FSCMEN_OFF_1H & _INTIO2_OSC_1H __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_OFF_2L __CONFIG _CONFIG2H, _WDT_OFF_2H __CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBAD_DIG_3H & _CCP2MX_C1_3H __CONFIG _CONFIG4L, _BKBUG_OFF_4L & _LVP_OFF_4L & _STVR_OFF_4L __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L __CONFIG _CONFIG7H, _EBTRB_OFF_7H ;*************************************************************************** *** ;Variable definitions CBLOCK 0x000 WREG_TEMP ;variable used for context saving STATUS_TEMP ;variable used for context saving BSR_TEMP ;variable used for context saving dataL recdat ;variable used to hold RCREG data txdat ;variable used to hold TXREG data ENDC ORG 0x0000 goto Main ;go to start of main code ;*************************************************************************** *** ;High priority interrupt vector ; This code will start executing when a high priority interrupt occurs or ; when any interrupt occurs if interrupt priorities are not enabled. ORG 0x0008 bra HighInt ;go to high priority interrupt routine ;Low priority interrupt vector and routine ; This code will start executing when a low priority interrupt occurs. ; This code can be removed if low priority interrupts are not used. ORG 0x0018 movff STATUS, STATUS_TEMP ;save STATUS register movff WREG, WREG_TEMP ;save working register movff BSR, BSR_TEMP ;save BSR register ; *** low priority interrupt code goes here *** movff BSR_TEMP, BSR ;restore BSR register movff WREG_TEMP, WREG ;restore working register movff STATUS_TEMP, STATUS ;restore STATUS register retfie ;High priority interrupt routine ; The high priority interrupt code is placed here to avoid conflicting with ; the low priority interrupt vector. HighInt: ; *** high priority interrupt code goes here *** retfie FAST ;*************************************************************************** *** ;Start of main program Main: bcf RCON, IPEN ;disable interrupt priority levels bcf INTCON, GIE ;disable all interrupts ; -------------------------------- ; SET ANALOG/DIGITAL INPUTS PORT A ; -------------------------------- movlw 7 movwf CMCON ;CMCON=7 set comparators off ; ---------------- ; INITIALIZE PORTS ; ---------------- movlw b'10111111' movwf TRISA ;portA pins set per datasheet for USART movlw b'00000000' ;portB pins all output movwf TRISB ; ------------------------------------ ; SET BAUD RATE TO COMMUNICATE WITH PC ; ------------------------------------ ; Boot Baud Rate = 19200, No Parity, 1 Stop Bit movlw 19 ;19200 movwf SPBRG movlw b'00100100' ;brgh = high movwf TXSTA ;enable Async Transmission, set brgh movlw b'10010000' ;enable Async Reception movwf RCSTA ; ------------------------------------ ; PROVIDE A SETTLING TIME FOR START UP ; ------------------------------------ clrf dataL settle decfsz dataL, F goto settle movf RCREG, W movf RCREG, W movf RCREG, W ;flush receive buffer ; --------- ; MAIN LOOP ; --------- call alive loop call receive movf recdat, W sublw "1" btfsc STATUS, Z call echo goto loop ; ------------------------------------------- ; RECEIVE CHARACTER FROM RS232 AND STORE IN W ; ------------------------------------------- ; This routine does not return until a character is received. receive btfss PIR1, RCIF ;(5) check for received data goto receive movf RCREG, W ;save received data in W movwf recdat bsf PORTB, 0 return ; ------------------------------------------------------------- ; SEND CHARACTER IN W VIA RS232 AND WAIT UNTIL FINISHED SENDING ; ------------------------------------------------------------- send movwf TXREG ;send data in W TransWt WtHere btfss TXSTA, TRMT ;(1) transmission is complete if hi goto WtHere return alive movlw "I" call send movlw " " call send movlw "A" call send movlw "M" call send movlw " " call send movlw "A" call send movlw "L" call send movlw "I" call send movlw "V" call send movlw "E" call send return echo clrf PORTB bsf PORTB, 5 movlw d'13' call send movlw d'10' call send call alive return ;*************************************************************************** *** ;End of program END -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body