Your SlideShare is downloading. ×
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Digital dice (minor project; ece)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Digital dice (minor project; ece)

1,454

Published on

The minor project on a Dgital Dice that also displays on its LCD with full description and program.

The minor project on a Dgital Dice that also displays on its LCD with full description and program.

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,454
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
100
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Complex/reduced instruction set computing
  • 80h to ffh we have special function registers
  • Transcript

    • 1. DIGITAL DICE USING 8051 MICROCONTROLLERS
    • 2. ….. Man’s glory lies in his knowledge, his upright conduct, his praise-worthy character, his wisdom, and not in his nationality or rank --Baha’ullah (From, the book The 8051 Microcontroller and Embedded systems- Mazidi )
    • 3. An EMBEDDED SYSTEM • Means a processor is embedded in that application • Only one application software typically burnt into the ROM • Only one task can be performed using the micro controller/processor • E.g. Video game player, printer, keyboard etc.
    • 4. 10/5/2013 CDAC,Mohali 4 Features of Different processor Architectures… CISC •Addressing modes. •Variable length inst. •No. of clocks >1 •Less general purpose internal registers •x86,8051… RISC •Load/store Architecture generally. •Fixed length instruction •Generally inst.=1 clock •More general purpose internal registers •PIC,ARM,AVR…
    • 5. 10/5/2013 CDAC,Mohali 5 Address space architecture • Memory is needed for programs and data. • Program memory used in embedded systems is typically of non-volatile type. • Data memory used is SRAM- or DRAM- type volatile memory. Von Neumann-architecture: Program and data located in same address space. Harvard-architecture: Separate address spaces and buses for program and data memories.
    • 6. Harvard Vs Von Neumann…
    • 7. Need to learn Microprocessors/controllers • The microprocessor is the core of computer systems. • Nowadays many communication, digital entertainment, portable devices, are controlled by them. • A designer should know what types of components he needs, ways to reduce production costs and product reliable. • Reduce chip count. • Many applications do not require as much computing power. • Reduced power consumption. • Reduced design cost
    • 8. Necessary tools for a microprocessor/controller • CPU: Central Processing Unit • I/O: Input /Output • Bus: Address bus & Data bus • Memory: RAM & ROM • Timer • Interrupt • Serial Port • Parallel Port
    • 9. Microprocessor vs. Microcontroller Microprocessor • CPU is stand-alone, RAM, ROM, I/O, timer are separate • designer can decide on the amount of ROM, RAM and I/O ports. • expansive • versatility • general-purpose Microcontroller • CPU, RAM, ROM, I/O and timer are all on a single chip • fix amount of on-chip ROM, RAM, I/O ports • for applications in which cost, power and space are critical • single-purpose
    • 10. 10/5/2013 CDAC,Mohali 10 •Useful for small computing tasks •Adequate for many control and monitoring applications •Used in communications as serial ASCII data is also stored in byte size. •Most integrated circuit memories arranged in an 8-bit configuration Eight - Bit Microcontrollers
    • 11. Block Diagram Of 8051 CPU On-chip RAM On-chip ROM for program code 4 I/O Ports Timer 0 Serial PortOSC Interrupt Control External interrupts Timer 1 Timer/Counter Bus Control TxD RxDP0 P1 P2 P3 Address/Data Counter Inputs
    • 12. Pin Description of the 8051 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (T0)P3.4 (T1)P3.5 XTAL2 XTAL1 GND (INT0)P3.2 (INT1)P3.3 (RD)P3.7 (WR)P3.6 Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8) 8051
    • 13. Types of Microcontrollers
    • 14. 10/5/2013 CDAC,Mohali 14 Logic Symbols…
    • 15. RESET Value of Some 8051 Registers: 0000DPTR 0007SP 0000PSW 0000B 0000ACC 0000PC Reset ValueRegister RAM are all zero.
    • 16. Stack in the 8051 • The register used to access the stack is called SP (stack pointer) register. • The stack pointer in the 8051 is only 8 bits wide, which means that it can take value 00 to FFH. When 8051 powered up, the SP register contains value 07. 7FH 30H 2FH 20H 1FH 17H 10H 0FH 07H 08H 18H 00H Register Bank 0 (Stack) Register Bank 1 Register Bank 2 Register Bank 3 Bit-Addressable RAM General User RAM & Stack space Internal RAM
    • 17. 10/5/2013 CDAC,Mohali 17 Alternate uses of Port- 3 pins PINS ALTERNATE USE SFR P3.0 RXD Serial data input SBUF P3.1 TXD Serial data output SBUF P3.2 INT0 External Interrupt 0 TCON.1 P3.3 INT1 External Interrupt 1 TCON.3 P3.4 T0 External Timer 0 I/P TMOD P3.5 T1 External Timer 1 I/P TMOD P3.6 WR External Memory write pulse - P3.7 RD External Memory read pulse -
    • 18. TMOD Register: • Gate : When set, timer only runs while INT(0,1) is high. • C/T : Counter/Timer select bit. • M1 : Mode bit 1. • M0 : Mode bit 0.
    • 19. TCON Register: • TF1: Timer 1 overflow flag. • TR1: Timer 1 run control bit. • TF0: Timer 0 overflag. • TR0: Timer 0 run control bit. • IE1: External interrupt 1 edge flag. • IT1: External interrupt 1 type flag. • IE0: External interrupt 0 edge flag. • IT0: External interrupt 0 type flag.
    • 20. Interrupts
    • 21. Interrupt Enable Register : • EA : Global enable/disable. • --- : Undefined. • ET2 :Enable Timer 2 interrupt. • ES :Enable Serial port interrupt. • ET1 :Enable Timer 1 interrupt. • EX1 :Enable External 1 interrupt. • ET0 : Enable Timer 0 interrupt. • EX0 : Enable External 0 interrupt.
    • 22. PROGRAM STATUS WORD 10/5/2013 CDAC,Mohali 22 Symbol Function CY Used in arithmetic, jump, rotate & Boolean inst AC Used for BCD arithmetic F0 User flag 0 RS1 RS1 and RS0 used to select one of the 4 RS0 register banks of internal RAM OV Used in arithmetic instructions P Shows the parity of register A CY AC F0 RS1 RS2 OV - P
    • 23. Seven segment Interfacing
    • 24. COMMANDS TO 7-SEGMENT INSTRUCTION REGISTER
    • 25. • CODE(HEX) COMMAND TO LCD INSTRUCTION REGISTER • 1 CLEAR DISPLAY SCREEN • 2 RETURN HOME • 4 DECREMENT CURSOR(SHIFT CURSOR TO LEFT) • 6 INCREMENT CURSOR(SHIFT CURSOR TO RIGHT) • 5 SHIFT DISPLAY RIGHT • 7 SHIFT DISPLAY LEFT • 8 DISPLAY OFF,CURSOR OFF • A DISPLAY OFF,CURSOR ON • C DISPLAY ON,CURSOR OFF • E DISPLAY ON CURSOR BLINKING • F DISPLAY ON CURSOR BLINKING • 10 SHIFT CURSOR POSITION TO LEFT • 14 SHIFT CURSOR POSITION TO RIGHT • 18 SHIFT THE ENTIRE DISPLAY TO THE LEFT • 1C SHIFT THE ENTIRE DISPLAY TO THE RIGHT • 80 FORCE CURSOR TO BEGINNING OF 1ST LINE • C0 FORCE CURSOR TO BEGINNING OF 2ND LINE • 8 2 LINES AND 5x7 MATRIX
    • 26. LCD PIN DESCRIPTION Pin No. Name Description Pin no. 1 D7 Data bus line 7 (MSB) Pin no. 2 D6 Data bus line 6 Pin no. 3 D5 Data bus line 5 Pin no. 4 D4 Data bus line 4 Pin no. 5 D3 Data bus line 3 Pin no. 6 D2 Data bus line 2 Pin no. 7 D1 Data bus line 1 Pin no. 8 D0 Data bus line 0 (LSB) Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller) Pin no. 10 R/W 0 = Write to LCD module 1 = Read from LCD module Pin no. 11 RS 0 = Instruction input 1 = Data input Tie VEE (3) pin to 0V for maximum Contrast
    • 27. THE FOLLOWING PROGRAM FEATURES: » A DISPLAY » A TOGGLING LED & » A DICING 7-SEGMENT
    • 28. org 00h acall LCD acall LED acall DICE LCD:mov a,#38h lcall command mov a,#0fh lcall command Mov a,#01h Lcall command Mov a,#80h Lcall command Mov a,#’W’ Lcall display Mov a,#’E’ Lcall display Mov a,#’L’ Lcall display Mov a,#’C’ Lcall display 1 Mov a,#’O’ Lcall display Mov a,#’M’ Lcall display Mov a,#’E’ Lcall display ret Command: lcall ready Mov p1,a Clr p3.2 Clr p3.3 Setb p3.4 Clr p3.4 Ret Ready: clr p3.4 Clr p3.2 Mov p1,#0ffh L1:setb p3.3 Jb p1.7,L1 Clr p3.4 Ret Display: lcall ready Mov p1,a Setb p3.2 Clr p3.3 Setb p3.4 Clr p3.4 Ret Delay: mov r3,#25h Here: mov r1,#49h Nop Nop Here1:Djnz r1,here1 Djnz r3,here Ret LED: mov p1, #00h Loop1: setb p1.2 Acall delay Clr p1.2 Sjmp loop1 ret DICE: mov p1,#03fh Acall delay Mov p1,#06h Acall delay Mov p1,#5bh Acall delay Mov p1,#4fh Acall delay Mov p1,#66h Acall delay Mov p1,#6dh Acall delay Mov p1,#7dh Acall delay Mov p1,#07h Acall delay Mov p1,#7ch Acall delay Mov p1,#67h Acall delay ret end
    • 29. CLICKCLICKSNAP
    • 30. THANKYOU!

    ×