On Mon, 13 Oct 1997 10:21:38 -0600 Scott Horton writes: > >Can I use the WDT to "reboot" it? I had invisioned having the WDT >timer >running and putting lots of resets to the WDT in my code. Then, if it >gets >stuck, the WDT timer will time out and trigger a reset of the 16C84? Tha'ts exactly how it works, but I suggest putting just one CLRWDT in the code at the end of the main loop (assuming the WDT doesn't time out before it gets around the loop). Putting a bunch of CLRWDTs in your code may result in the processor getting lost somewhere and STILL finding a CLRWDT. Here's some of my cut up code for the 16c74a. Harold start movlw b'00001111' bank1 ; movwf option_reg ; Port b weak pull-ups enabled bank0 ; External interrupt on falling edge ; Timer 0 uses internal clock ; Timer 0 increments on positive edge ; Prescaler assigned to WDT ; WDT prescaler=128 movlw b'01100000' ; Disable global interrupts for now ; Enable un-masked peripheral interrupts ; Enable timer 0 interrupt ; Disable external interrupt ; Disable port B change interrupt ; Clear various interrupt flags movwf intcon movlw b'00100000' ; Disable parallel slave port interrupt ; Disable A/D interrupt ; Enable async serial receive interrupt ; Disable async serial transmit interrupt ; disable synchronous serial port interrupt ; Disable Timer 1 capture/compare interrupt ; disable timer 2 interrupt ; disable timer 1 interrupt bank1 movwf pie1 bank0 call InitPorts ; Set up data direction registers call Init_serial ; Set up serial port call initDmxRam ; Set up dmx pointers, etc. call ClearRamPort ; Go clear ram port clrf mptl clrf mpth ; Clear move pointers movlw 0xff bank1 movwf trisb ; Set port b as input to read jumpers on RamPort bank0 comf portd,0 ; Convert active low to active high Row1StartChan in W movwf Row1StartChan ; and save it bsf portc,3 ; Make sure RamPort clock is high bsf portc,4 ; and deselect memory, passing thru port comf portb,0 ; Get row2 jumper settings thru RamPort and invert (active low) movwf row2StartChan ; If we have 2 rows of 12 pots, Row2=13 EnableIRQ ; enable interrupts Loop clrwdt call XferData ; Transfer received data and A/D to transmit buffer goto loop