RSS

Cool RC5 Decoder using ATMEGA 16

20 Jun

$regfile = “m16def.dat”
$crystal = 8000000

Config Pind.2 = Input
Config Rc5 = Pind.2 [ , Timer = 2]

Config Lcd = 16 * 2
Config Lcdbus = 4
Config Lcdmode = Port
Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portc.5 , Rs = Portc.4
Enable Interrupts

Dim Command As Byte
Dim Address As Integer

Cls
Lcd “<===Welcome====>”
Lowerline
Lcd “*–RC5 Decoder-*”
Wait 2
Cls

Cls
Lcd “Waiting for RC5”
Lowerline
Lcd “Press any Key…”
Wait 1
Do
Getrc5(address , Command)
Command = Command And &B01111111
‘If Address <= 255 Then
‘Address = Address And &B00011111
If Command <= 64 Then
Cls
Lcd “Address :” ; Address
Lowerline
Lcd “Command:” ; Command
Waitms 200
End If
‘End If

Loop
End

Advertisements
 
Leave a comment

Posted by on June 20, 2010 in AVR

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: