Marcelo Rodrigues wrote: > Hi All > > I`m developing a program and it have to do basically 4 tasks: > > 1 - read 4 push-buttons > 2 - process the commands according to the read buttons > 3 - load a screen in the internal buffer > 4 - write the buffer to the LCD > > The push-button read function, once called, takes about 4ms, each button > is > read in intervals of 1ms and LCD write function, once called, takes about > 32ms, each of the 32 characters are written in intervals of 1ms. > > My question is about the hardware interfacing functions (1 and 4), which > is > the best frequency to call them? > > I`ve already tried to call them in intervals of 100ms, it worked, but is > it > the best way to do it? or it is better to call them in the main loop of > the > code with no time interval? For a simple application like this, calling the functions in the main loop as fast as possible seems like the simplest solution. You really only want to synchronize to a tick when timing is important. Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist