Thanks for the advice, I tried it and traced the problem back to the 555. Boosting the voltage on the 555 to 6V solved the problem Thanks Stephan ----- Original Message ----- From: Jan Erik Bertram To: Sent: Saturday, December 18, 1999 3:37 AM Subject: Re: TMR1 Problem on 16c74a > Perhaps you should connect RC0 with RC1 and then change your program a bit. > > loop1 > bcf PORTC,1 > bsf PORTC,1 > btfss PIR1,0 ; check if done > goto loop1 ; no, wait > return ; done > > If this don't run then you have a problem with the pic, else it's a problem > with your 555. > > Ciao > Jan Erik Bertram > > ----- Original Message ----- > From: "Stephan Kotze" > To: > Sent: Friday, December 17, 1999 8:13 PM > Subject: TMR1 Problem on 16c74a > > > Dear list > > I have been running into a strange problem on the 16c74a. I am trying to use > tmr1 as a state machine clock but it won't for the life of me work. I > include the relevant code snippets > bsf STATUS,RP0 ; Page 1 of registers > clrf TRISD ; > clrf TRISE ; Ports D and E all outputs > movlw 0x9b ; all bits are outputs except RC0,SDI,sck & RX > movwf TRISC ; do it > bcf STATUS,RP0 ; Back to page 0 > initTMR1 > clrf TMR1L > clrf TMR1H ;clear high and low registers > MOVLW B'00000110' ; > MOVWF T1CON ; Enable T1 Oscillator, Ext Clock, Async, prescaler = 1 > BSF T1CON, TMR1ON ; Turn Timer1 ON > > to initialise and then > > cycle > movlw 0x02 > call Timer_wait > comf PORTE,f ; cycle portE > comf PORTD,f ; Cycle port D > goto cycle ; > Timer_wait ; number of cycles to wait in W > bcf T1CON,0 ;stop timer > movwf TMR1L ; put in low byte > comf TMR1L,f ; compliment to count up > bcf PIR1,0 ; clear overflow flag > movlw 0xff ; put in W > movwf TMR1H ; high byte > bsf T1CON,0 ; start timer again > loop1 > btfss PIR1,0 ; check if done > goto loop1 ; no, wait > return ; done > > The clock signal on RC0 is a slow (20ms) pulse from a 555. Removing the > "call Timer_wait" instruction cycles the ports perfectly at clock rate. Also > running the code in MPSIM works perfectly. > > Please help!!!! > > Stephan