
Originally Posted by
financecatalyst
Thanks for the reply. But I still want to know how I can place the transmitter's MCU to power-down mode and wake it up once a key (on port A)is pressed and put it to sleep again once it has sent out the command? Can someone help me with the code changes -thanks

Sleep
interrupt wake up , interrupt on change
Code:
'intcon.0 'RAIF PortA Interrupt Flag
'intcon.1 'INTF PORTA.2 INT Interrupt Flag
'intcon.2 'T0IF Timer 0 Interrupt Flag
'intcon.3 'RAIE PortA Interrupt Enable
'intcon.4 'INTE PortA.2 INT Interrupt Enable
'intcon.5 'T0IE Timer 0 Interrupt Enable
'intcon.6 'PEIE Peripheral Interrupt Enable
'intcon.7 'GIE Global interrupt enable
'enable Global interrupts GIE
'by setting bit 7
'enable on change interrupts
'by setting bit 3 RAIE
'Clear all interrupt flag bits
'bits 0,1,2,
'
intcon = 10001000
' tell it what to do when interrupt occurs
On Interrupt GoTo . . .
'clear the flag bit before going back to sleep
intcon.0 = 0
sleep
'or
@ sleep
check this link
http://www.picbasic.co.uk/forum/showthread.php?t=11325
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks