I am trying this one after work >From: Jinx >Reply-To: "Microcontroller discussion list - Public." >To: pic microcontroller discussion list >Subject: Re:[PIC:] Code question >Date: Wed, 01 Sep 2004 13:17:46 +1200 > >OhBTW Aslam, another simple way I should have mentioned to get >your 0.1s would be to ditch the 4MHz crystal for a hexadecimal value >and use one of the timers free-running > >For example, > >3.2768MHz /64 pre-scaler = 50 TMR0 rollover / sec => 5 / 0.1s > >16.384MHz /64 pre-scaler = 250 => 25 / 0.1s > >19.6608MHz /128 pre-scaler = 150 => 15 / 0.1s > >etc etc etc > >No re-loading of timer necessary, simply set a register to eg - 15 >and at each timer IRQ incfsz > >There may be an initial intuitive link between 1us instruction cycles >and 0.1s timing intervals, but if you consider the binary nature of >register incrementation then a hex value crystal does make life a >little easier from that POV > > >_______________________________________________ >http://www.piclist.com >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist