Quote Originally Posted by financecatalyst View Post
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