














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of the digital i/o peripherals in pic16 mcus, including i/o ports, i/o pin operation, and reading data. It covers the use of trisx registers to control the direction of i/o ports, the difference between analog and digital i/o pins, and the importance of setting the correct direction before using the ports. It also explains how to read data from a port and provides examples of low-level programming using trisx and portx.
Typology: Slides
1 / 22
This page cannot be seen from the preview
Don't miss anything!















DataDirectionTri-stateLatch^ OutputEnableOutput OutputCurrentDataDriverLatch InputDataLatch Write TRIS bit Write data bitRead databit Analogue inputmultiplexer The pin can be set for input or output data transfer
6 bits
8 bits
8 bits
8 bits
3 bits
33 pins
Before^ Using PORTx
PORTx Is OUTPUT (0 = O)
PORTx Is INPUT (1 = I)
L1^ MOVLW^
0x55^ ;WREG = 55HMOVWF PORTB^ ;put 55H
on PORTB CALL^ DELAYMOVLW^ 0xAA
;WREG = AAH MOVWF^ PORTB
;put AAH^
on PORTB CALL^ DELAYGOTO^ L^
;^ Loop
Bit-Oriented Instructions inAssembly • BSF^ Bit^ Set^ fileReg• BCF^ Bit^ Clear
fileReg
Toggle fileRe
g
Test^ fileReg,
Skip if^ Clear
Test^ fileReg,
Skip if^ Set