Total members 11895 |It is currently Wed Dec 18, 2024 8:08 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Input/Output Operations:
  • Each PIC microprocessor has number of ports number from port A, to port L, depends on how many pins exists in this microprocessor.
  • Each port has 3 special registers associated with it: PORTx, TRISx, and LATx.
  • TRISx is the register which responsible to set the port as input port or output port. Setting TRISx bits to zeros would make portx to be an output port, and setting the TRISx bits to ones would make portx to be an input port.

Example1:

Assign value 66H to the output port C:
asm code
MOVLW	0x0
MOVWF TRISC
L1 MOVLW 0x66
MOVWF PORTC
GOTO L1


Example2:
Make port C as input port, add 12 to it and port B as output port B:
asm code
MOVLW	B’00000000’
MOVWF TRISB
MOVLW B’11111111’
MOVWF TRISC
L2 MOVF PORTC, W
ADDLW 12
MOVWF PORTB
GOTO L2




_________________
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 : Input-Output Operations
 OUTPUT??     -  
 what is the output of this program and how it be?     -  
 Use for loop to output HTML table     -  
 echo command to output HTML     -  
 output associate array by print_r     -  
 Operations on Sucxent++     -  
 Matrix Operations     -  
 C++ Boolean Operations     -  
 Character Operations     -  
 Bit operations-set-get-xor-rotate on bits arrays     -  









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