Preview

Bascom8051 Program

Satisfactory Essays
Open Document
Open Document
2277 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Bascom8051 Program
BasCom/MIDE 8051 Programming

1. a. 1-bit Inverter

Main:
P0.0 = Not P1.0
Goto Main

b. 8-bit Buffer

P1 = 0
P0 = 0
Do
P0 = P1
Loop

c. 8-bit Inverter

P1 = &HFF
P2 = &HFF
Main:
P1.0 = Not P2.0
P1.1 = Not P2.1
P1.2 = Not P2.2
P1.3 = Not P2.3
P1.4 = Not P2.4
P1.5 = Not P2.5
P1.6 = Not P2.6
P1.7 = Not P2.7
Goto Main

d. 8-input AND Gate

Dim Var As Byte
Main:
If P0 = 255 Then
P1.0 = 1
Else
P1.0 = 0
End If
Goto Main

e. 8-input OR Gate

Dim Var As Byte
Main:
If P0 = 0 Then
P1.0 = 0
Else
P1.0 = 1
End If
Goto Main

f. 8-input NAND Gate

Dim Var As Byte
Main:
If P0 = 255 Then
P1 = 0
Else
P1 = 1
End If
Goto Main

g. 8-bit XOR Gate

Dim A As Bit
Do
A = P0.0 Xor P0.1
A = A Xor P0.2
A = A Xor P0.3
A = A Xor P0.4
A = A Xor P0.5
A = A Xor P0.6
A = A Xor P0.7
P1.0 = A
Loop

1. Write a routine for an open door alarm system that continually monitors the doors of a four door car sedan.

P0 = &B1111
P1.0 = 1
'Door is CLOSED = 0
'Alarm is OFF = 0
Main:
If P0 = 0000 Then
P1.0 = 0
Else
P1.0 = 1
End If
Goto Main

2. Write the program for a system that will turn ON a LED when the PBNO switch is pressed. Pressing and then releasing again this PBNO switch will turn the LED OFF.

'P3.0 = LED
'P2.0 = PBNO Switch

Do
P3.0 = P2.0
Loop

3. Write the program for a system that will turn ON a LED when the PBNO switch 1 is pressed. Pressing and then releasing PBNO switch 2 will turn the LED OFF.

'P0.0 = LED
'P1.0 = Switch 1
'P2.0 = Switch 2
P0.0 = 0
P1.0 = 0
P2.0 = 0
Do
If P1.0 = 1 Then
P0.0 = 1
End If
If P2.0 = 1 Then
P0.0 = 0
End If
Loop

4. Write the program for a system that will switch ON the AC power generator as soon as the main AC source is OFF. Switch OFF the AC power generator when the main AC power is ON.

Main_ac Alias P0.0
Ac_generator Alias P1.0
Do
Ac_generator = Not Main_ac
Loop

5. Write the program for a

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Nt1310 Unit 5

    • 973 Words
    • 4 Pages

    A 100a Distribution Board will be used to power Block L. A ring circuit will provide power to the substation room and Generator/switch room (labelled Sockets, Generator/Switchroom). It will be protected by a 32A BS EN 60898 type C RCBO. The RCBO type C is used as equipment could either be plugged in from outside or attached to an inductive load. Another ring circuit will provide power for the workshop and restroom (labelled Sockets, Workshop/Restroom), this will also be protected by a 32A BS EN 60898 type c RCBO as again, equipment could be plugged in from outside or attached to an inductive load, as well as equipment being used within the restroom. The Electric Roller Shutter Door (labelled Motor Door) will be wired…

    • 973 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    NT1210 Lab 1

    • 319 Words
    • 4 Pages

    1. It is important to know how many system words will fit in a primary storage device on a computer so you know how big of a storage unit you have. The more system words that will fit in a primary storage device, the more memory you have on your computer.…

    • 319 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ECT114 week 3 lab

    • 299 Words
    • 2 Pages

    3. Analyze the switch logic circuit in Figure 1. The light ON is considered a logic HIGH, and the light OFF is considered a logic LOW.…

    • 299 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    ECT-120

    • 1527 Words
    • 9 Pages

    3. Press the A key to close the switch and observe the effect on the capacitor voltage.…

    • 1527 Words
    • 9 Pages
    Good Essays
  • Satisfactory Essays

    Busn311 Unit 5

    • 1291 Words
    • 6 Pages

    Running head: UNIT 5 INDIVIDUAL PROJECT BUSN311 by Barbara Ryals Quantitative Methods and Analysis Irene Tsapara November 7, 2010 Benefits | Intrinsic | | | | | | | | | 1.4 | 5.5 | correl | | | | | | | | 5.4 | 5.5 | 0.209015 | | | | | | | | 6.2 | 5.2 | | | | | | | | | 2.3 | 5.3 | SUMMARY OUTPUT | | | | | | | 4.5 | 4.7 | | | | | | | | | 5.4 | 5.5 | Regression Statistics | | | | | | | 6.2 | 5.2 | Multiple R | 0.209015 | | | | | | | 2.3 | 5.3 | R Square | 0.043687 | | | | | | | 4.5 | 4.7 | Adjusted R Square | 0.009533 | | | | | | | 5.4 | 5.4 | Standard Error | 0.396714 | | Intrinsic is higher | | | | 6.2 | 6.2 | Observations | 30 | | |…

    • 1291 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    Nt1330 Unit 4

    • 920 Words
    • 4 Pages

    1. Which of the following statements describes part of the process of how a switch…

    • 920 Words
    • 4 Pages
    Good Essays
  • Better Essays

    1. Create a Form that contains two buttons, one labeled Stop and one labeled Go. Add a label telling the user to click a button. When the user clicks Stop, change the BackColor of the Form to Red; when the user clicks Go, change the BackColor of the Form to Green.…

    • 1713 Words
    • 7 Pages
    Better Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    17.Write a program to read a binary input from the keyboard and display it. Page: 130…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Pt1420 Unit 1 Assignment 2

    • 1305 Words
    • 6 Pages

    The number in a bit that represents a turned on position is 1. The number in a bit that represents a turned off position is 0.…

    • 1305 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Iscom 473

    • 507 Words
    • 3 Pages

    The Hula Hoop, Disneyland, The Mickey Mouse Club, Interstate Highways, Dishwashers, Hi-fis and Stereos, Poodle Skirts, McDonald’s, Drive-in Theaters, Levittown, Dr. Spock, Ozzie and Harriett, Leave it to Beaver, I Love Lucy, Father Knows Best, The Honeymooners, Amos ‘n Andy, My Little Margie, Echo Park, Persistent Poverty, Black Urban Migration, Urban Renewal, Massive Resistance, Beats; American Bandstand; Elvis Presley; James Dean…

    • 507 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    The most basic circuitry-level computer language, which consists of on and off switches, is _____________.…

    • 4265 Words
    • 23 Pages
    Satisfactory Essays
  • Satisfactory Essays

    NT1210 Unit Lab 1

    • 421 Words
    • 18 Pages

    1.) Write out the powers starting from 20 to 26. Next place the values of the powers below. In each block below enter a one subtract that value from the number 127 until you have nothing remaining and all values equal 127.…

    • 421 Words
    • 18 Pages
    Satisfactory Essays
  • Powerful Essays

    Connect 4 in C++

    • 4604 Words
    • 19 Pages

    Upon running the desired program the users would be presented with a menu offering 3 options. These options can translate into a switch:case:break function within the program and the typical menu will be:-…

    • 4604 Words
    • 19 Pages
    Powerful Essays
  • Powerful Essays

    Final Exam

    • 864 Words
    • 4 Pages

    12. A system consists of 2 components each of which must activate if the system is to activate. One component has a reliability of 99 the other of on is independent…

    • 864 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    4. Block making machine every month to check power lines, to prevent the occurrence of a short circuit and open circuit, to avoid security risks.…

    • 390 Words
    • 2 Pages
    Satisfactory Essays