Solarwind, I tell you a secret - do not tell anyone here in the list ;-) I was NOT borne with the knowledge of PIC microcontrollers. What I have done is to look for PIC tutorials and books on the net. I am pretty sure you did the same with C and linux, you read so many books on the subject. So here are two important links you may start: http://www.piclist.com/techref/piclist/begin.htm http://www.mikroe.com/en/books/ The first one gives you many starting up points, while the second one is a free library, you can read those books free of charge. Hope it helps Tamas On Mon, Dec 8, 2008 at 1:26 AM, solarwind wrote: > 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 > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist