View previous topic :: View next topic |
Author |
Message |
harrydejonge
Joined: 06 Jan 2006 Posts: 19
|
Posted: Mon May 27, 2013 8:02 pm Post subject: Powerdown and RC5 waekup. |
|
|
Hi,
I have a problem with detecting rc5 when the atmel is in powerdown mode.
The program should be awake when pressing any rc5 on the remote and do a reset when i press only 1 specific key.
It never execute the part marked as 'test2'.
anyone have a good sugestion. ?
'----------------------------------------------------------------------------------------------------------------------------
$prog &HFF , &HEE , &HD9 , &HFF ' generated. Take care that the chip supports all fuse bytes.
$regfile = "m128def.dat" ' specify the used micro
Config Submode = New
$crystal = 8000000 ' used crystal frequency
$baud = 4800 ' use baud rate
$hwstack = 200 ' default use 32 for the hardware stack
$swstack = 200 ' default use 10 for the SW stack
$framesize = 200 ' default use 40 for the frame space
Dim Rc5_adres As Byte
Dim Rc5_commando As Byte
Dim Ir_vlag As Bit
Config Rc5 = Pine.6 , Wait = 1000
Enable Int6
Config Int6 = Low Level
On Int6 Int6_isr
Enable Interrupts
'Lcd
Config Lcdpin = Pin , Db4 = Porta.3 , Db5 = Porta.2 , Db6 = Porta.1 , Db7 = Porta.0 , E = Porta.4 , Rs = Porta.6
Config Lcd = 16 * 3 , Chipset = Dogm163v5
Cls
Cursor Off Noblink
Locate 2 , 1 : Lcd " P o w e r o f f"
Config Powermode = Powerdown
'------------------------------------- M A I M ---------------------------------------------------------------------------
Do
' test 1
If Ir_vlag = 1 Then
Cls
Cursor Off Noblink
Locate 2 , 1 : Lcd " P o w e r = o n"
End If
' test 2
If Ir_vlag = 1 Then
Getrc5(rc5_adres , Rc5_commando)
Rc5_commando = Rc5_commando And &B01111111 ' clear toggle bit
If Rc5_adres = &H00 Then
Select Case Rc5_commando
Case 40
Goto _reset
End Select
End If
End If
Loop
'--------------------------------------------------------------------------------------------------------
Int6_isr:
Ir_vlag = 1
Return
'--------------------------------------------------------------------------------------------------------
End
(BASCOM-AVR version : 2.0.7.6 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon May 27, 2013 8:24 pm Post subject: Re: Powerdown and RC5 waekup. |
|
|
harrydejonge wrote: | Code: | '------------------------------------- M A I M ------------------------------------- |
|
Is this a hint on what kind of code is following ? LOL
SCNR |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon May 27, 2013 8:49 pm Post subject: |
|
|
You're aware that a level interrupt is executed as long as the pin level matches ?
Means at pin low the uC is 100 percent busy executing the ISR. |
|
Back to top |
|
|
harrydejonge
Joined: 06 Jan 2006 Posts: 19
|
Posted: Mon May 27, 2013 9:09 pm Post subject: |
|
|
MWS wrote: | You're aware that a level interrupt is executed as long as the pin level matches ?
Means at pin low the uC is 100 percent busy executing the ISR. |
MWS How do you mean, the pin from RC5 is connected to int6. And this pin is not low. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon May 27, 2013 9:26 pm Post subject: |
|
|
harrydejonge wrote: | How do you mean, the pin from RC5 is connected to int6. And this pin is not low. |
The pin changes according the decoded IR signal, it will be high, it will be low, but every time the pin is low, the uC runs exclusively the ISR. Sure, you want that ? |
|
Back to top |
|
|
|