<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.mcselec.com/bavr/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.mcselec.com/bavr/index.php?action=history&amp;feed=atom&amp;title=CONFIG_KEYBOARD%2Fde</id>
		<title>CONFIG KEYBOARD/de - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.mcselec.com/bavr/index.php?action=history&amp;feed=atom&amp;title=CONFIG_KEYBOARD%2Fde"/>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=CONFIG_KEYBOARD/de&amp;action=history"/>
		<updated>2026-05-07T02:38:46Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>http://wiki.mcselec.com/bavr/index.php?title=CONFIG_KEYBOARD/de&amp;diff=2189&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=CONFIG_KEYBOARD/de&amp;diff=2189&amp;oldid=prev"/>
				<updated>2013-02-15T19:13:32Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:13, 15 February 2013&lt;/td&gt;
		&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://wiki.mcselec.com/bavr/index.php?title=CONFIG_KEYBOARD/de&amp;diff=2188&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;= &lt;span class=&quot;f_Header&quot;&gt;Action&lt;/span&gt; =  Configure the GETATKBD() function and tell which port pins to use.  &lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;  &lt;span style=&quot;fon...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=CONFIG_KEYBOARD/de&amp;diff=2188&amp;oldid=prev"/>
				<updated>2013-02-07T21:15:54Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Action&amp;lt;/span&amp;gt; =  Configure the GETATKBD() function and tell which port pins to use.  &amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;  &amp;lt;span style=&amp;quot;fon...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== (**COPIED FROM ENGLISH PAGE**) === &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Action&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
Configure the GETATKBD() function and tell which port pins to use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Syntax&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;f_Syntax&amp;quot;&amp;gt;CONFIG KEYBOARD&amp;lt;/span&amp;gt;&amp;amp;nbsp;= PINX.y , DATA = PINX.y , KEYDATA = table&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Remarks&amp;lt;/span&amp;gt; =&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0px; margin: 0px 0px 0px 4px;&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;604&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;1&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;18%&amp;quot; style=&amp;quot;width: 105px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
KEYBOARD&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 490px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
The PIN that serves as the CLOCK input.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;18%&amp;quot; style=&amp;quot;width: 105px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
DATA&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 490px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
The PIN that serves as the DATA input.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;18%&amp;quot; style=&amp;quot;width: 105px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
KEYDATA&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 490px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
The label where the key translation can be found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AT keyboard returns scan codes instead of normal ASCII codes. So a translation table s needed to convert the keys.&lt;br /&gt;
&lt;br /&gt;
BASCOM allows the use of shifted keys too. Special keys like function keys are not supported.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AT keyboard can be connected with only 4 wires: clock,data, gnd and vcc.&lt;br /&gt;
&lt;br /&gt;
Some info is displayed below. This is copied from an Atmel data sheet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The INT0 or INT1 shown can be in fact any pin that can serve as an INPUT pin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application note from Atmel works in interrupt mode. For BASCOM we rewrote the code so that no interrupt is needed/used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;[[File:Basc0085.gif|center|Basc0085.gif]]&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;See also&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
[[GETATKBD]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Example&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;source lang=&amp;quot;bascomavr&amp;quot;&amp;gt;&lt;br /&gt;
'-----------------------------------------------------------------------------------------&lt;br /&gt;
'name : getatkbd.bas&lt;br /&gt;
'copyright : (c) 1995-2005, MCS Electronics&lt;br /&gt;
'purpose : PC AT-KEYBOARD Sample&lt;br /&gt;
'micro : Mega48&lt;br /&gt;
'suited for demo : yes&lt;br /&gt;
'commercial addon needed : no&lt;br /&gt;
'-----------------------------------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
$regfile = &amp;quot;8535def.dat&amp;quot; ' specify the used micro&lt;br /&gt;
$crystal = 4000000 ' used crystal frequency&lt;br /&gt;
$baud = 19200 ' use baud rate&lt;br /&gt;
$hwstack = 32 ' default use 32 for the hardware stack&lt;br /&gt;
$swstack = 10 ' default use 10 for the SW stack&lt;br /&gt;
$framesize = 40 ' default use 40 for the frame space&lt;br /&gt;
 &lt;br /&gt;
'For this example :&lt;br /&gt;
'connect PC AT keyboard clock to PIND.2 on the 8535&lt;br /&gt;
'connect PC AT keyboard data to PIND.4 on the 8535&lt;br /&gt;
 &lt;br /&gt;
'The GetATKBD() function does not use an interrupt.&lt;br /&gt;
'But it waits until a key was pressed!&lt;br /&gt;
 &lt;br /&gt;
'configure the pins to use for the clock and data&lt;br /&gt;
'can be any pin that can serve as an input&lt;br /&gt;
'Keydata is the label of the key translation table&lt;br /&gt;
Config Keyboard = Pind.2 , Data = Pind.4 , Keydata = Keydata&lt;br /&gt;
 &lt;br /&gt;
'Dim some used variables&lt;br /&gt;
Dim S As String * 12&lt;br /&gt;
Dim B As Byte&lt;br /&gt;
 &lt;br /&gt;
'In this example we use SERIAL(COM) INPUT redirection&lt;br /&gt;
$serialinput = Kbdinput&lt;br /&gt;
 &lt;br /&gt;
'Show the program is running&lt;br /&gt;
Print &amp;quot;hello&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Do&lt;br /&gt;
'The following code is remarked but show how to use the GetATKBD() function&lt;br /&gt;
' B = Getatkbd() 'get a byte and store it into byte variable&lt;br /&gt;
'When no real key is pressed the result is 0&lt;br /&gt;
'So test if the result was &amp;gt; 0&lt;br /&gt;
' If B &amp;gt; 0 Then&lt;br /&gt;
' Print B ; Chr(b)&lt;br /&gt;
' End If&lt;br /&gt;
 &lt;br /&gt;
'The purpose of this sample was how to use a PC AT keyboard&lt;br /&gt;
'The input that normally comes from the serial port is redirected to the&lt;br /&gt;
'external keyboard so you use it to type&lt;br /&gt;
Input &amp;quot;Name &amp;quot; , S&lt;br /&gt;
'and show the result&lt;br /&gt;
Print S&lt;br /&gt;
'now wait for the F1 key , we defined the number 200 for F1 in the table&lt;br /&gt;
Do&lt;br /&gt;
 B = Getatkbd()&lt;br /&gt;
Loop Until B &amp;lt;&amp;gt; 0&lt;br /&gt;
Print B&lt;br /&gt;
Loop&lt;br /&gt;
End&lt;br /&gt;
 &lt;br /&gt;
'Since we do a redirection we call the routine from the redirection routine&lt;br /&gt;
'&lt;br /&gt;
Kbdinput:&lt;br /&gt;
'we come here when input is required from the COM port&lt;br /&gt;
'So we pass the key into R24 with the GetATkbd function&lt;br /&gt;
' We need some ASM code to save the registers used by the function&lt;br /&gt;
$asm&lt;br /&gt;
push r16 ; save used register&lt;br /&gt;
push r25&lt;br /&gt;
push r26&lt;br /&gt;
push r27&lt;br /&gt;
 &lt;br /&gt;
Kbdinput1:&lt;br /&gt;
rCall _getatkbd ; call the function&lt;br /&gt;
tst r24 ; check for zero&lt;br /&gt;
breq Kbdinput1 ; yes so try again&lt;br /&gt;
pop r27 ; we got a valid key so restore registers&lt;br /&gt;
pop r26&lt;br /&gt;
pop r25&lt;br /&gt;
pop r16&lt;br /&gt;
$end Asm&lt;br /&gt;
'just return&lt;br /&gt;
Return&lt;br /&gt;
 &lt;br /&gt;
'The tricky part is that you MUST include a normal call to the routine&lt;br /&gt;
'otherwise you get an error&lt;br /&gt;
'This is no clean solution and will be changed&lt;br /&gt;
B = Getatkbd()&lt;br /&gt;
 &lt;br /&gt;
'This is the key translation table&lt;br /&gt;
 &lt;br /&gt;
Keydata:&lt;br /&gt;
'normal keys lower case&lt;br /&gt;
Data 0 , 0 , 0 , 0 , 0 , 200 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , &amp;amp;H5E , 0&lt;br /&gt;
Data 0 , 0 , 0 , 0 , 0 , 113 , 49 , 0 , 0 , 0 , 122 , 115 , 97 , 119 , 50 , 0&lt;br /&gt;
Data 0 , 99 , 120 , 100 , 101 , 52 , 51 , 0 , 0 , 32 , 118 , 102 , 116 , 114 , 53 , 0&lt;br /&gt;
Data 0 , 110 , 98 , 104 , 103 , 121 , 54 , 7 , 8 , 44 , 109 , 106 , 117 , 55 , 56 , 0&lt;br /&gt;
Data 0 , 44 , 107 , 105 , 111 , 48 , 57 , 0 , 0 , 46 , 45 , 108 , 48 , 112 , 43 , 0&lt;br /&gt;
Data 0 , 0 , 0 , 0 , 0 , 92 , 0 , 0 , 0 , 0 , 13 , 0 , 0 , 92 , 0 , 0&lt;br /&gt;
Data 0 , 60 , 0 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0&lt;br /&gt;
Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0&lt;br /&gt;
 &lt;br /&gt;
'shifted keys UPPER case&lt;br /&gt;
Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0&lt;br /&gt;
Data 0 , 0 , 0 , 0 , 0 , 81 , 33 , 0 , 0 , 0 , 90 , 83 , 65 , 87 , 34 , 0&lt;br /&gt;
Data 0 , 67 , 88 , 68 , 69 , 0 , 35 , 0 , 0 , 32 , 86 , 70 , 84 , 82 , 37 , 0&lt;br /&gt;
Data 0 , 78 , 66 , 72 , 71 , 89 , 38 , 0 , 0 , 76 , 77 , 74 , 85 , 47 , 40 , 0&lt;br /&gt;
Data 0 , 59 , 75 , 73 , 79 , 61 , 41 , 0 , 0 , 58 , 95 , 76 , 48 , 80 , 63 , 0&lt;br /&gt;
Data 0 , 0 , 0 , 0 , 0 , 96 , 0 , 0 , 0 , 0 , 13 , 94 , 0 , 42 , 0 , 0&lt;br /&gt;
Data 0 , 62 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0 , 0&lt;br /&gt;
Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;br/&amp;gt;{{Languages}}&lt;br /&gt;
&lt;br /&gt;
[[Category:BASCOM Language Reference/de]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>