Now the only interrupt I'm using is the high USART receive, I was = considering adding USART transmit, though most of the examples leave = that at polled. The ADC conversion done also could be an interrupt. I = could make either or both high interrupts, but don't know whether that's = the better way to handle it. I could easily change the 8mz to 16 or 20, could it be I have run out of = processing time? As for the output timing, that's not an issue, even at = once a minute sending, is more than adequate, the items don't change = that quckly. By saving at interrupts, I now have the string array and index variables = declared (global) before and outside any functions. I do not have any = compiler managed resources saved/unsaved. As I am writing, Mike Rigby's message came in. In the receive interupt, = I do have a receive buffer where the routine looks for the first = incoming character of the RS-485 command, and then starts filling the = array (7 characters), when the required number of characters is = received a strncmp() compares with the required string and sets a flag. = For the transmit I do build a string array (buffer), which I have been = just using printf to send out the USART. I can change that to interrupt = driven. The number of characters in the outgoing message is less than 20. Jan-Erik S=F6derholm wrote: > Carl Denk skrev: > = >> I have an 18F1320 @ 8mhz. with RS-285 as slave on the USART, and 3 = >> active ADC channels. The USART receive is a high priority interrupt, >> = > > Are *all* interrupts (used) high prio ? > > = >> I haven't been doing any special save at the interrupts. >> = > > Not even what's specified in the datasheet ? > > = >> What would be the appropriate way to handle interrupts and polling. >> :) >> = > > First, to follow the datasheet... > > Then, to *not* use high/low interrupt prio's if not > absolutely needed. Running with one level is much easier. > > Jan-Erik. > > = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist