SoftwareExamplesManual.pdf
(
1024 KB
)
Pobierz
Software Examples Manual
Copyright
ã
2002 Frontline Electronics Pvt Ltd. All Rights Reserved.
Information in this document is subject to change without notice. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose without the express written permission of Frontline Electronics Pvt Ltd.
81
Software Examples Manual
Contents
Chapter 1 - Introduction
1.1 Introduction ..................................................................................................................... 1
1.2 Interrupts ......................................................................................................................... 5
Chapter 2 - Example Programs
Example 1:
Example 2:
Flashing the LED connected to port line P1.4 using CPL instruction ...... 7
Flashing the LED connected to port line P1.4 using SETB and CLR
instructions. ................................................................................................... 8
Example 3:
Read the status of the switch SW1 (connected to portline P1.2)
and display it on LED connected to Port line P1.5. .................................. 9
Example 4:
Example 5:
Example 6:
Example 7:
Example 8:
Example 9:
AND operation using ANL instruction. ....................................................... 10
NAND operation using ORL instruction. .................................................... 11
OR operation using ORL instruction. ......................................................... 12
NOR operation using ORL instruction. ...................................................... 13
Up/Down Counter ......................................................................................... 14
Study of INT1 interrupt (using Level triggering) ........................................ 16
Example 10: Study of INT1 interrupt (Using Edge triggering) ........................................ 19
Example 11: Study of Timer 0 - External Event Counter ............................................... 22
Example 12: Study of Serial Port ..................................................................................... 23
Example 13: Addition of two 8 bit numbers ..................................................................... 26
Example 14: Subtraction of two 8 bit numbers ............................................................... 28
Example 15: Multiplication of two 8 bit numbers ............................................................ 30
Example 16: Division of two 8 bit numbers ...................................................................... 32
Example 17: Display message "HELLO" ......................................................................... 33
Example 18: Flash message "HELP" ............................................................................... 35
Example 19: 32 Bit Addition .............................................................................................. 36
Example 20: 32 Bit Subtraction ........................................................................................ 38
78
Software Examples Manual
Example 21: 5 Digit BCD to binary conversion ............................................................... 40
Example 22: 16 bit binary to BCD conversion ................................................................. 43
Chapter 3 - Routines
Routine 1:
Routine 2:
Routine 3:
Clears the seven segment display. ............................................................ 47
Displays a message. ................................................................................... 48
Displays Carry and Accumulator contents in the seven
segment display ........................................................................................... 49
Routine 4:
Displays B register and Accumulator contents in
first 4 digits of seven segment display. ..................................................... 50
Routine 5:
Displays the lower nibble of Acc(hex) in the seven
segment display. .......................................................................................... 51
Routine 6:
Routine 7:
Routine 8:
Routine 9:
Displays a character in the seven segment display. ............................... 52
Delay Routine (approximately one second). ............................................. 53
Displays the contents of DPTR in first four digits of the display ............ 54
Displays the contents of accumulator ....................................................... 55
Routine 10: Checks the keyboard status and waits until a key is pressed
Note that the key value is not read from Keyboard display
controller. ...................................................................................................... 57
Routine 11:
Checks the keyboard status waits until a key is pressed.
The key value is read and returned in Acc. .............................................. 58
Routine 12: Reads a four digit data from keyboard and displays them in the
first 4 digits of the display. ......................................................................... 59
Routine 13: Reads 2 digit data from keyboard and displays it in the display ............ 60
Routine 14: Reads a byte from keyboard/display controller. ....................................... 61
Routine 15: Writes a byte to keyboard/display controller. ........................................... 62
Routine 16: Serial Port initialization routine. ................................................................. 64
Routine 17: Waits until a byte of data is received on serial port. ............................... 66
Routine 18: Sends the Accumulator data to Serial port. ............................................. 67
79
Software Examples Manual
Routine 19: Hexadecimal to Decimal conversion routine
(Both Input and output values are in internal memory) ............................ 68
Routine 20: Hexadecimal to Decimal conversion routine
(Both Input and output values are stored in external memory) ............... 70
Routine 21: Decrements DPTR by one (16 bit decrement) .......................................... 72
Routine 22: Writes a byte to RTC ................................................................................... 73
Routine 23: Reads a byte from RTC ............................................................................... 74
80
Software Examples Manual
Plik z chomika:
abys
Inne pliki z tego folderu:
Dobry_Darmowy_Kompilator_C_8051.zip
(23927 KB)
8255_example.zip
(290 KB)
Czytaj(9).txt
(0 KB)
asc2bin(1).asm
(0 KB)
Algoritmy_principy.zip
(8 KB)
Inne foldery tego chomika:
- rozne ❎ Diagnostyka Pojazdów
! Wednesday (2022) serial
• ACTIA MultiDiag Full DVD Release 2011
• Spawarki - schematy itp
• Spawarki - schematy itp(1)
Zgłoś jeśli
naruszono regulamin