Turn left led on movwf porta rcall lled call the

This preview shows page 3 - 5 out of 5 pages.

;Turn Left LED ON MOVWF PORTA RCALL LLED ;Call the Subroutine RLED to turn on RightLED MOVLW B'0000100' ;Turn Center LED ON MOVWF PORTA RCALL CLED ;Call the Subroutine CLED to turn on CenterLED MOVLW B'00000010' ;Turn RIGHT LED ON MOVWF PORTA RCALL RLED ;Call the Subroutine LLED to turn on LeftLED LLED BCF INTCON,TMR0IF ; Clear TMR0IF flag, precautionary step MOVLW 26470/128 ;load high byte in TMR0 MOVWF TMR0H MOVLW 26470%128 ;load low byte in TMR0 MOVWF TMR0L MOVLW B'10000110' ; Setup T0CON 16-bit mode, Prescaler 1:128 MOVWF T0CON ; Check2s BTFSS INTCON,TMR0IF ; Test TMR0IF flag GOTO Check2s ; Check again if not set BCF INTCON,TMR0IF ; If set, clear flag & return RETURN CLED BCF INTCON,TMR0IF ; Clear TMR0IF flag, precautionary step MOVLW 31360/256 ;load high byte in TMR0 MOVWF TMR0H MOVLW 31360%256 ;load low byte in TMR0 MOVWF TMR0L MOVLW B'10000111' ; Setup T0CON 16-bit mode, Prescaler 1:128 MOVWF T0CON ; Check35s BTFSS INTCON,TMR0IF ; Test TMR0IF flag GOTO Check35s ; Check again if not set BCF INTCON,TMR0IF ; If set, clear flag & return RETURN RLED BCF INTCON,TMR0IF ; Clear TMR0IF flag, precautionary step MOVLW 16710/256 ;load high byte in TMR0 MOVWF TMR0H MOVLW 16710%256 ;load low byte in TMR0 MOVWF TMR0L MOVLW B'10000111' ; Setup T0CON 16-bit mode, Prescaler 1:128 MOVWF T0CON ;
Image of page 3

Subscribe to view the full document.

Check5s
Image of page 4
Image of page 5
You've reached the end of this preview.
  • Fall '12
  • azhar
  • PIC Microcontroller, load high byte, load low byte

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern