Exactly. The interrupt routine in general should do as little as possible. If you want to process one channel each interrupt, indeed, just have a counter in the main loop. It all depends on what else is going on in your program, and how long it takes to read the data from the ADC. If it won't bother anything else to take the time to process all 8 channels at once, then do so, as it simplifies your code a bit. At 10:24 AM 3/2/2004 -0500, you wrote: >So basically, instead of having the analog data read in the actual >interrupt routine, the interrupt routine is >only setting a flag. In the main program when the flag is set, the main >program itself will start reading in >data? > >I guess you could increment a register as well so you can INTERLEAVE the >gathering of analog data. So each >interrupt gets the next analog sample. This way, the main program loop >could run more smoothly then having >to interrupt and gather all 8 analog samples in one chunk. > >Dan > > > >The way I do things that need to happen at specific intervals is to have >a timer interrupt set a flag. The main program runs in a loop checking >the flag, then does the conversion and resets the flag. As long as the >time taken to go through the loop is less than the interval, all is >well. > > >At 07:48 AM 3/2/2004 -0500, you wrote: > >I wanted to ask your advice regarding the use of a MAX127 IC in my > >program. I'm currently using a PIC16C76 and a MAX127 using I2C > >interface. > > > >All i'm really doing with this program is reading in 8 pieces of analog > > >data, comparing it with threshold information, and then displaying the > >data on an LCD and sending control bits based on the data. > > > >I'm using a 4x20 LCD and have about five screens which display the > >information differently. The user cycles through screens using a > >pushbutton. > > > >My question is, what is the best way to add a MAX127 read into my > >program. > > > >I was thinking maybe have the whole routine triggered of an internal > >timer interrupt. So every X seconds, the program would be interrupted > >and gather all 8 samples of analog data. > > > >Is this what is typically done? > > > >Any help appreciated. > >Thanks > > > >Dan > > > > > > > >-- > >http://www.piclist.com hint: PICList Posts must start with ONE topic: > >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > >Larry Bradley >Orleans (Ottawa), Ontario, CANADA > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads Larry Bradley Orleans (Ottawa), Ontario, CANADA -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads