Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

KBD Interrupt on AT89C51ED2

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-8051
View previous topic :: View next topic  
Author Message
dunkelbunt

Bascom Member



Joined: 06 Mar 2009
Posts: 1

germany.gif
PostPosted: Wed Mar 28, 2018 4:20 pm    Post subject: KBD Interrupt on AT89C51ED2 Reply with quote

Hi,
I'm dealing with a AT89C51ED2. I'd like to use the kbd-interrupt, which rises when input on P1.x changes.
But when code is compiled the following error come up:
Error 13: UNKNOWN INTERRUPT [KBD]
Is there a way to solve that problem or isn't this interrupt supported by BASCOM?
Thank you for your help. Smile

Code:

$regfile "89C51ED2.dat"
$baud = 9600                                                  'set your own baudrate
$crystal = 20000000

Dim S1 As String * 16
Dim I As Integer
Dim Count As Integer

On Kbd Kbd_init

Enable Interrupts
Enable Kbd                                                    'set your own crystal frequen

 Do
   Print Count
   If Count > 10 Then
      I = Makeint(p1 , P4)
      S1 = Bin(i)
      Print "Port1: " ; S1
      Count = 0
   End if
 Loop
End

Kbd_init:
Incr Count
Return
 
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Wed Mar 28, 2018 8:29 pm    Post subject: Reply with quote

you can add them to the dat file.
open it with notepad then make sure the end of the file looks like this :

[MISC]
I_TIMER2 = 2B
I_PCA=33
I_KBD=3B
I_DUM=43
I_SPI=4B
up=89C51ED2
IRAM = 256
org = 2E
clockdiv = 6


to enable the interrupt you manual need to set the register : Ie1.1 = 1

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-8051 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum