BITWAIT/de

(Difference between revisions)
Jump to: navigation, search
((**COPIED FROM ENGLISH PAGE**) =)
(Remarks)
Line 16: Line 16:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
= <span class="f_Header">Remarks</span> =
+
= <span class="f_Header">Anmerkungen</span> =
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
<div style="padding: 0px; margin: 0px 0px 0px 4px;">
 
{| width="604" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
{| width="604" cellspacing="0" cellpadding="1" border="1" style="border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;"
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
| valign="top" width="12%" style="width: 69px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="12%" style="width: 69px; border: 1px solid rgb(0, 0, 0);" |  
X
+
s
  
 
| valign="top" width="100%" style="width: 526px; border: 1px solid rgb(0, 0, 0);" |  
 
| valign="top" width="100%" style="width: 526px; border: 1px solid rgb(0, 0, 0);" |  
Bit variable or internal register like PORTB.x , where x ranges from 0-7.
+
Bit-Variable oder internes Register wie z.B. PORTB.x , wobei x im Bereich von 0 bis 7 ist.
  
 
|}
 
|}
Line 30: Line 30:
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
When using bit variables make sure that they are set/reset by software otherwise your program will stay in a loop.
+
Wenn eine Bit-Variable benutzt wird dann muss sichergestellt werden, dass die Bit-Variable per Programm gesetzt/gelöscht wird weil das Programm sonst endlos wartet.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>
  
When you use internal registers that can be set/reset by hardware such as PINB.0 this doesn't apply since this state can change as a result from for example a key press.
+
Wenn ein internes Register benutzt wird das durch Hardware gesetzt/gelöscht werden kann wie z.B. PinB.0 dann trifft das nicht zu weil der Zustand sich zum Beispiel durch einen Tastendruck verändern kann.
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>

Revision as of 01:32, 5 March 2013

Contents

Funktion

Warten bis ein Bit gesetzt (1) bzw. gelöscht (0) ist.


 

 

Syntax

BITWAIT x , SET/RESET

 

 

Anmerkungen

s

Bit-Variable oder internes Register wie z.B. PORTB.x , wobei x im Bereich von 0 bis 7 ist.

 

Wenn eine Bit-Variable benutzt wird dann muss sichergestellt werden, dass die Bit-Variable per Programm gesetzt/gelöscht wird weil das Programm sonst endlos wartet.

 

Wenn ein internes Register benutzt wird das durch Hardware gesetzt/gelöscht werden kann wie z.B. PinB.0 dann trifft das nicht zu weil der Zustand sich zum Beispiel durch einen Tastendruck verändern kann.

 

 

 

See also

NONE

 

 

ASM

Calls: NONE

Input: NONE

Output: NONE

 

Code : shown for address 0-31

 

 

label1:

Sbic PINB.0,label2

Rjmp label1

Label2:

 

 

Example


$regfile = "m48def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
 
Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
 
Dim A As Bit
Bitwait A , Set 'wait until bit a is set
'the code above will loop forever since the bit 'A' is not set in software
'it could be set in an ISR routine
 
Bitwait Pinb.7 , Reset 'wait until bit 7 of Port B is 0.
End

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language