Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me fix this rc5 bascom 8051 code for displaying address and command on LCD

Status
Not open for further replies.

joy_shukla

Junior Member level 2
Joined
Oct 10, 2009
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Ahmedabad
Activity points
1,445
please help me .. i try to display address and command on lcd but it shows grabage value , sometimes address-0,command-0, address-31,command-63 like that .. please see the code & advice me what to do ??


$regfile = "8052.dat"
$crystal = 12000000

Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = P1.2 , Db5 = P1.3 , Db6 = P1.4 , Db7 = P1.5 , E = P1.1 , Rs = P1.0

Dim New As Bit
Dim Command As Byte , Subaddress As Byte , Tempadd As Bit

Reset Tcon.0 'triggered by rising edge
On Int0 Receiverc5
Enable Int0
Enable Interrupts


Do
If New = 1 Then 'received new code
Disable Int0
Cls
Lcd "Address : " ; Subaddress
Lowerline
Lcd "Command : " ; Command
Wait 1
New = 0 'reset new bit
Enable Int0
End If
Loop


Receiverc5: 'interrupt routine
'the getrc5 routine uses 30 bytes ! of the stack for measuring
'the interval between the bits
Getrc5(subaddress , Command)
If Subaddress.5 = Tempadd Then
New = 1
Tempadd = Subaddress.5
cpl tempadd
End If
Subaddress = Subaddress And &B00011111 'set flag
Return
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top