When the project is started (or when reset), only the odd numbered LEDs turn on (i.e. the LEDs connected to bit 1, bit 3, bit 5, and bit 7 of PORTB).
‘*********************************************************************
‘
‘ TURN ON ODD NUMBERED LEDS
‘ ============================
‘
‘ This program turns on odd numbered LEDs (bit 1, bit 3, bit 5, bit 7) connected
‘ to PORTB of a PIC16F627 microcontroller.
‘
‘
‘
‘ Author: Dogan Ibrahim
‘ Date: October, 2005
‘ Compiler: PicBasic
‘ File: LED5.BAS
‘
‘ Modifications
‘ ===========
‘
‘*********************************************************************
‘
‘ SYMBOLS
‘
Symbol TRISB = $86 ‘ TRISB address
Symbol PORTB = $06 ‘ PORTB address
‘
‘ START OF MAIN PROGRAM
‘
POKE TRISB, 0 ‘ Set PORTB pins as outputs
POKE PORTB, $AA ‘ Turn on odd numbered LEDs
END ‘ End of program
‘*****************************************************************
‘
‘ TURN ON ODD NUMBERED LEDS
‘ ============================
‘
‘ This program turns on odd numbered LEDs (bit 1, bit 3, bit 5, bit 7) connected
‘ to PORTB of a PIC16F627 microcontroller.
‘
‘
‘
‘ Author: Dogan Ibrahim
‘ Date: October, 2005
‘ Compiler: PicBasic Pro
‘ File: LED6.BAS
‘
‘ Modifications
‘ ==========
‘
‘*****************************************************************
‘
‘ DEFINITIONS
‘
‘
‘ START OF MAIN PROGRAM
‘
TRISB = 0 ‘ Set PORTB pins as outputs
PORTB = $AA ‘ Turn on odd numbered LEDs
END ‘ End of program
‘
‘ TURN ON ODD NUMBERED LEDS
‘ ============================
‘
‘ This program turns on odd numbered LEDs (bit 1, bit 3, bit 5, bit 7) connected
‘ to PORTB of a PIC16F627 microcontroller.
‘
‘
‘
‘ Author: Dogan Ibrahim
‘ Date: October, 2005
‘ Compiler: PicBasic Pro
‘ File: LED6.BAS
‘
‘ Modifications
‘ ==========
‘
‘*****************************************************************
‘
‘ DEFINITIONS
‘
‘
‘ START OF MAIN PROGRAM
‘
TRISB = 0 ‘ Set PORTB pins as outputs
PORTB = $AA ‘ Turn on odd numbered LEDs
END ‘ End of program
Comments
Post a Comment