Total members 11889 |It is currently Fri Mar 29, 2024 9:59 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Read input from PORTS and print it to the LEDs,
Code:

TITLE 
"READ SWITCHES AND OUTPUT"
list p16f877
include <p16f877.inc>
BANK0 macro
bcf STATUS
,RP0
bcf STATUS
,RP1
endm
BANK1 macro
bsf STATUS
,RP0
bcf STATUS
,RP1
endm
BANK2 macro
bcf STATUS
,RP0
bsf STATUS
,RP1
endm
BANK3 macro
bsf STATUS
,RP0
bsf STATUS
,RP1
endm

ORG 0 
;START ADDRESS
NOP
GOTO START 
;PROGRAM START

ORG 0x20
START CALL INITP 
;INITIALISE PORTS
REPEAT
MOVF PORTA
,;READ PORT A
MOVWF PORTD 
;OUTPUT DATA
GOTO REPEAT 
;REPEAT FoREVER

;PORT INIT ROUTINE
INITP BANK1
MOVLW 06 
;MAKE PORT A DIGITAL
MOVWF ADCON1
MOVLW 0xFF
MOVWF TRISA 
;MAKE A INPUT
CLRF TRISD 
;MAKE PORT D OUTPUT
BANK0 
BACK To BANK 0
RETURN
END




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Read input from ports and print it on the LEDs
 Read input from SWITCHES and PORTS     -  
 Write data to ports     -  
 interminert connection to gsm network using virtual ports     -  
 Help for Print using php     -  
 getting a full line input     -  
 Input-Output Operations     -  
 Only numeric input in JTextField     -  
 input suggestion using Javascript     -  
 Print the ASCII Set     -  
 Input username and password in JAVA     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com