Banjo Spam schrieb: > A couple of notes > > 1) I can't tell if the "; do someting" is actual code, > or filler to make the example smaller. In my test circuit there are indeed nop's and nothing else. I stay in Bank 0. > 2) Your interrupt code will modify counter_hi and > counter_lo possibly at the same time you are moveing > to W and send to TXREG. Yes, I'm aware of this. But for testing I'm not interested in a correct result but in an working transmission. > 3) Disable any flow control on the computer > ??? I'm working with a terminal in HEX mode. If there are no interrupts I can see two zeros and a as expected. So when no interrupt is trigeered, everything works fine. > 5) You don't mention if 'freezes' I've added some additional LEDs: - After each second, an LED (LED1) is toggled by the main loop - One LED (LED2) is switched on while waiting for TRMT being cleared after a transmission - One LED (LED3) is switched on when the interrupt routine is entered and switched off before the routine is left Now I can desribe the 'freeze-state' a little more precise: 1 second after power-on and the transmission of the first byte, the PIC waits for TRMT to be cleared (LED2 remains on) and LED1 is not toggled any more - so it waits for ever for TRMT to be cleared. The interrupt is triggered as before (LED3 flickers). When I trigger the comparator interrupt slowly by hand with a potentiometer, the amount of int-calls is transmitted correctly, so the RS232 part works. But when I turn the poti very fast by hand it can happen that the PIC freezes as described above. Maybe I generate some ripples around the hystresis point. In my application I expect about 300-500 impulses per second from an operation amp which last about 125s and the DC-range is from 1,5 to 3,0V. So I use a comperator voltage of about 2V. In this case The circuit freezes (see above) after having sent the first byte. Does the rate of interrupts affect the clearing/setting of TRMT? The UART interrupts are disabled. Can anyone understand this strange behaviour. Regards Markus -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu