On Sun, Dec 7, 2008 at 8:20 PM, Bob Ammerman wrote: > Again, you do *not* actually need to use an interrupt handler, nor globally > enable interrupts to get interrupt-on-change to work to wake up from sleep. > > As Olin noted, an enabled interrupt-on-change causes an interrupt > *condition*, but it only becomes an actual interrupt if interrupts are > globally enabled. > > So, you want to do the following: > > 1: Make sure you properly initialize your inputs as digital as opposed to > analog (often controlled by a port called ANSEL, but this varies amoung > several different PICs). > > 2: Make sure your inputs are set up as inputs rather than outputs (this is > the default condition, check out TRIS registers for this). > > 3: Make sure that interrupts are globally disabled (often a flag bit called > GIE). This is the default condition. > > 4: Make sure the interrupt-on-change interrupt is enabled (another flag > bit). > > Now a SLEEP should be terminated when the input bit changes, but no > interrupt handler is needed. > > > Some baby steps: > > I would start by trying to write a program that just copied the state of an > input bit to an output bit. This makes sure you have inputs set up as inputs > and outputs as outputs. Then I would try to add the > interrupt-on-change/wakeup from SLEEP logic. > > -- Bob Ammerman Very helpful, thank you. Attempting now. -- ..::[ solarwind ]::.. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist